---
title: "POST /extension/token"
method: POST
path: "/extension/token"
---

# POST /extension/token

`POST /extension/token`

## Request

- Base URL: `https://api.useanima.sh/v1`
- URL: `https://api.useanima.sh/v1/extension/token`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-API-Key`

## Request body

- object: Request body for creating an extension auth token
  - `agentId` string: Agent requesting the extension token. Required for pre_approved policy checks.

## Response `200`

OK

- object: Extension exchange code with connection details
  - `exchangeCode` string, required: One-time exchange code. The extension trades this for the real token via API.
  - `policy` 'session' | 'pre_approved' | 'prompt_owner', required: The auth policy that was applied
  - `tokenTtl` '15m' | '1h' | 'session', required: Token TTL setting that was applied
  - `requiresApproval` boolean, required: Whether the owner must approve this token in the extension UI
  - `expiresAt` string, date-time, nullable, required: ISO 8601 expiration time. Null for session-based (browser manages lifecycle).
  - `connectUrl` string, uri, required: URL to open in the browser to authenticate the extension

---

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