Skip to main content
POST
/
oauth
/
token
cURL
curl --request POST \
  --url https://api.useanima.sh/v1/oauth/token \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "code": "<string>",
  "redirectUri": "<string>",
  "clientId": "<string>",
  "codeVerifier": "<string>",
  "refreshToken": "<string>"
}
'
{
  "accessToken": "<string>",
  "tokenType": "<unknown>",
  "expiresIn": 123,
  "scope": "<string>",
  "refreshToken": "<string>",
  "refreshTokenExpiresIn": 123
}

Authorizations

Authorization
string
header
required

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

Body

application/json

OAuth 2.1 token-exchange request

grantType
enum<string>
required
Available options:
authorization_code,
refresh_token
code
string
redirectUri
string<uri>
clientId
string
codeVerifier
string
Required string length: 43 - 128
refreshToken
string

Response

OK

OAuth token response (RFC 6749 §5.1)

accessToken
string
required

oat_* access token; bearer in Authorization header

tokenType
any
required
expiresIn
integer
required

Seconds until access token expires

scope
string
required

Space-delimited granted scope list

refreshToken
string

Rotating refresh token. Each /token call issues a new RT; the old one is consumed and any further use of it triggers chain revocation.

refreshTokenExpiresIn
integer

Seconds until the refresh token expires (~30 days)