---
title: "Create Identity Token"
method: POST
path: "/access_tokens/identity"
tags: ["Identity Tokens"]
---

# Create Identity Token

`POST /access_tokens/identity`

## Request

- Base URL: `https://api.whop.com/api/v1`
- URL: `https://api.whop.com/api/v1/access_tokens/identity`
- Auth: HTTP bearer

Creates a short-lived OIDC identity token for the app, account, or user that owns your API key. Send it to a service outside Whop to prove who is calling, with no shared secret. The `runtime` claim says where your code runs. It is `whop` when your app's server on Whop hosting created the token, and `external` for an API key used anywhere else. A `whop` token also has `env`, which is `production` for the live build and `preview` for any other build, and `app_build_id`, the build that runs. The `sub` claim joins these as `key:value` segments, from the runtime to the environment. An app on Whop hosting gets `runtime:whop:account:biz_xxxxxxxxxxxxx:app:app_xxxxxxxxxxxxx:env:production`. The same app's API key used anywhere else gets `runtime:external:account:biz_xxxxxxxxxxxxx:app:app_xxxxxxxxxxxxx`. An account API key gets `runtime:external:account:biz_xxxxxxxxxxxxx`, and a user API key gets `runtime:external:user:user_xxxxxxxxxxxxx`. A service that matches a subject by prefix must end the prefix on a full segment and its `:`. The `account_id`, `app_id` and `user_id` claims carry the same IDs one by one. The `typ` claim is always `identity`, which no other Whop token carries. The `api_key_id` claim is the API key that created the token. The `iss` claim is `https://api.whop.com`, and the service finds the signing keys through `https://api.whop.com/.well-known/openid-configuration`. Your app's server on Whop hosting can call this endpoint with no key of its own. A session, an OAuth token, or a token created from an API key cannot create an identity token.

## Headers

- `Api-Version-Date` string
- `Idempotency-Key` string

## Request body

- object
  - `audience` string, required: The service that verifies the token, as that service names itself. It becomes the `aud` claim. The service must reject a token with another audience. It must be a URL or a hostname, such as `https://database.example.com` or `sts.amazonaws.com`.

## Response `200`

an identity token was created

- object
  - `expires_at` string, date-time, required: When the identity token expires, as an ISO 8601 timestamp.
  - `token` string, required: The identity token, a signed JWT. Send it to the service named in `audience`.

## Other responses

- `400`: Invalid Parameters
- `401`: Unauthorized
- `403`: Forbidden
- `409`: Conflict

## Changes

- **2026-11-30** `8f1fdd7ae85e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/whop/apis/whop-api/changes/access_tokens/identity/post.md)

---

[API](https://skmtc.dev/whop/apis/whop-api.md) - [All operations](https://skmtc.dev/whop/apis/whop-api/llms.txt) - [OpenAPI document](https://skmtc.dev/whop/apis/whop-api/revisions/b10d1ab093e8?raw)
