> For the complete documentation index, see [llms.txt](https://developers-apps-in-toss.toss.im/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers-apps-in-toss.toss.im/documentation/api-and-sdk-en/sdk/domains-api/user/user.getdeclaredagerange.md).

# User.getDeclaredAgeRange

> Functional API `getDeclaredAgeRange`You can use the same feature with it as well.

### Feature description

Retrieves the declared age range on iOS.

**iOS only** This is an API. It requires iOS 26 or later, and the Toss app **iOS 5.266.0** It can only be used on iOS 26 or later — Android is not supported. Before calling `User.getDeclaredAgeRange.isSupported()`You can check whether it is supported with

### Type

```ts
User.getDeclaredAgeRange(params: GetDeclaredAgeRangeParams): Promise<DeclaredAgeRange>;
```

**Params**

```ts
interface GetDeclaredAgeRangeParams {
  ageGates: number[];
}
```

**Response**

```ts
interface DeclaredAgeRange {
  status:
    | "SHARING"
    | "DECLINED_SHARING"
    | "UNSUPPORTED_OS"
    | "NOT_AVAILABLE"
    | "INVALID_REQUEST"
    | "FAILED";
  lowerBound?: number;
  upperBound?: number;
  ageRangeDeclaration?: string;
  activeParentalControls: string[];
  isEligibleForAgeFeatures?: boolean;
  errorCode?: string;
}
```

### Error

The error code is the `error.code` value.

| Code                      | Description                                                                                                                                                                                                                           |
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `UNSUPPORTED_OS_VERSION`  | If the device's OS is below iOS 26 or is not iOS, this occurs immediately upon calling. `User.getDeclaredAgeRange.isSupported()`Check in advance with `error.message`Show the user the (OS update guidance message).                  |
| `UNSUPPORTED_APP_VERSION` | If the running version of the Toss app is below iOS 5.266.0, this occurs immediately upon calling. `User.getDeclaredAgeRange.isSupported()`Check in advance with `error.message`Show the user the (Toss app update guidance message). |

### Example code

```js
import { User } from "@apps-in-toss/web-framework";

async function handleGetDeclaredAgeRange() {
  try {
    const result = await User.getDeclaredAgeRange({
      ageGates: [13, 18],
    });

    console.log("Age range status:", result.status);
    console.log("lowerBound:", result.lowerBound);
    console.log("upperBound:", result.upperBound);
  } catch (error) {
    console.error(error);
  }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers-apps-in-toss.toss.im/documentation/api-and-sdk-en/sdk/domains-api/user/user.getdeclaredagerange.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
