For AI agents: the documentation index is at /llms.txt, and this page is available as Markdown at /api/auth/oauth-token.md.

Exchange a grant for tokens

POST
/oauth/token

The token endpoint (RFC 6749 4.1.3 and 6), form encoded.

authorization_code consumes the code atomically, checks it was issued to this client and this redirect_uri, and verifies PKCE. A code is single-use: unknown, expired and already-redeemed are one answer, so a caller cannot tell them apart.

refresh_token rotates: the presented token is consumed and the response carries its replacement, minted with the stored audience and scopes, so neither can widen on refresh. Refresh tokens are opaque and single-use; replaying a consumed one revokes every token descended from the same grant.

Rate limit: counts against the Sign-in verification limit, 30 a minute (per ip address, for every caller). See Rate limits.

Request Body

application/x-www-form-urlencoded
  1. body
grant_type*string
Value in"authorization_code""refresh_token"
client_id*string
code?string

Required for authorization_code.

redirect_uri?string

Required for authorization_code; must match the authorize request.

Formaturi
code_verifier?string

Required for authorization_code.

refresh_token?string

Required for refresh_token.

Response Body

Tokens issued

application/json
  1. response
access_token*string

Audience-bound to the resource named in the authorize request.

token_type*"Bearer"
Value in"Bearer"
expires_in*integer

Seconds until the access token expires.

Formatint64
refresh_token?string

Opaque and single-use; each refresh response replaces it.

scope*string

Space-delimited scopes the grant carries.

Example Request
curl -X POST 'https://api.truemarkets.co/v1/auth/oauth/token' \  -H 'Content-Type: application/x-www-form-urlencoded' \  -d 'grant_type=authorization_code&client_id=string'
Example Response
{  "access_token": "string",  "token_type": "Bearer",  "expires_in": 0,  "refresh_token": "string",  "scope": "string"}