> ## Documentation Index
> Fetch the complete documentation index at: https://documentation.idenfy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a Session

> Create an age estimation session via the iDenfy Partner API or the Dashboard, using the same request body on both surfaces.

<Note>
  **Requirements:**

  * **API key pair** (API key + secret), for the Partner API surface
  * **Age Estimation** feature enabled on your contract (contact iDenfy to activate)
  * Sufficient balance for the age-estimation fee (and a document scan when `escalation` is `DOC`)
</Note>

Age Estimation is exposed on two **separate** surfaces. Both create the same token object and are scoped to your partner account (you only ever see your own sessions).

| Surface               | Authentication                                                                         | Endpoint                                                                                                                        |
| --------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **Partner API**       | Your **API key + secret** (API key pair)                                               | `POST /age-estimation/token/` -- create a session                                                                               |
| **Dashboard (Admin)** | iDenfy dashboard sign-in (manager account) with the `MANAGE_AGE_ESTIMATION` permission | `POST /age-estimation/tokens/` -- create · `GET /age-estimation/tokens/` -- list · `GET /age-estimation/tokens/{id}/` -- detail |

* Use the **Partner API** (API key pair) to create sessions programmatically from your backend. This is the surface you integrate against.
* Use the **Dashboard (Admin)** surface to create, browse, and inspect sessions in the iDenfy admin UI. Listing and per-session detail are **dashboard-only** -- see [Retrieve Tokens](/age-estimation/retrieve-tokens).

***

## Create a Session

Both surfaces accept the same request body and return the same token object. On creation your balance is checked for the age-estimation fee (and, when `escalation = DOC`, also for a document scan); if funds are insufficient the request is rejected.

<Note>
  The [**API Reference**](/api-reference/age-estimation/create-session) page for this endpoint isn't published yet. Once Age Estimation is released, it will appear there automatically with the full request/response schema and an interactive playground -- no further changes needed on this page.
</Note>

### Example (Partner API)

<Tabs>
  <Tab title="Request">
    ```http theme={"system"}
    POST /age-estimation/token/
    Authorization: Basic {API_KEY}:{API_SECRET}
    Content-Type: application/json

    {
      "min_age": 18,
      "confidence_threshold": 85,
      "buffer": 2,
      "escalation": "DOC",
      "save_photo": true,
      "expiry_minutes": 60,
      "success_redirect": "https://partner.example.com/ok",
      "underage_redirect": "https://partner.example.com/denied",
      "webhook_url": "https://partner.example.com/hooks/age",
      "client_id": "user-42"
    }
    ```
  </Tab>

  <Tab title="Response">
    ```json theme={"system"}
    {
      "token": "b7c1…",
      "session_url": "https://capture.idenfy.example/?token=b7c1…",
      "expires_at": "2026-07-14T12:00:00+00:00",
      "min_age": 18,
      "confidence_threshold": 85.0,
      "buffer": 2,
      "escalation": "DOC",
      "retry_limit": 3,
      "save_photo": true,
      "expiry_minutes": 60,
      "client_id": "user-42"
    }
    ```
  </Tab>
</Tabs>

***

## What's Next

Once you have a `session_url`, send the end user to it to complete the selfie capture. When the session finishes, the result is delivered via the [result webhook](/age-estimation/webhooks) (if configured) and is always available through [Retrieve Tokens](/age-estimation/retrieve-tokens) on the Dashboard.


## Related topics

- [Create session](/api-reference/age-estimation/create-session.md)
- [Creating a KYB Session](/guides/dashboard/kyb/creating-session.md)
- [ID Verification (KYC)](/kyc/overview.md)
- [Sole Proprietorship Workflow Step](/guides/dashboard/kyb/step-sole-proprietorship.md)
- [Gambling and Gaming](/guides/use-cases/gambling.md)
