v1

latestOpenAPI 3.0.02026-07-17121287546.7 KB
OAuth2

Exchange authorization code or refresh token for tokens

RFC 6749-compliant token endpoint. Pass client_id in the request body (Section 2.3.1). Use grant_type 'authorization_code' to exchange an auth code for tokens, or 'refresh_token' to refresh an access token. Accepts both application/x-www-form-urlencoded (standard per RFC 6749 Section 4.1.3) and application/json content types.

post/v2/auth/oauth2/token

Request body

OR
OR
OR

Example request

{
  "client_id": "my-client-id",
  "grant_type": "authorization_code",
  "code": "abc123",
  "redirect_uri": "https://example.com/callback"
}

Response

access_tokenstring required

The access token

token_typestring required

The token type

refresh_tokenstring required

The refresh token

expires_innumber required

The number of seconds until the access token expires

Example response

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "bearer",
  "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires_in": 1800
}