Skip to main content
POST
/
extension
/
token
cURL
curl --request POST \
  --url https://api.useanima.sh/v1/extension/token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agentId": "<string>"
}
'
{
  "exchangeCode": "<string>",
  "requiresApproval": true,
  "expiresAt": "2023-11-07T05:31:56Z",
  "connectUrl": "<string>"
}

Authorizations

Authorization
string
header
required

JWT Bearer token obtained from authentication. Pass as: Authorization: Bearer

Body

application/json

Request body for creating an extension auth token

agentId
string

Agent requesting the extension token. Required for pre_approved policy checks.

Required string length: 1 - 128

Response

200 - application/json

OK

Extension exchange code with connection details

exchangeCode
string
required

One-time exchange code. The extension trades this for the real token via API.

policy
enum<string>
required

The auth policy that was applied

Available options:
session,
pre_approved,
prompt_owner
tokenTtl
enum<string>
required

Token TTL setting that was applied

Available options:
15m,
1h,
session
requiresApproval
boolean
required

Whether the owner must approve this token in the extension UI

expiresAt
string<date-time> | null
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