Skip to navigation

OAuth Token

OAuth Token Exchange

Exchange an authorization code for an access token using the OAuth 2.0 Authorization Code flow.

Endpoint

POST {{baseUrl}}/oauth/token

Request Headers

HeaderValue
Content-Typeapplication/json
Acceptapplication/json

Request Body

FieldTypeDescription
codestringThe authorization code received from the authorization server.
clientIdstringThe client ID of your application.
clientSecretstringThe client secret of your application.
redirectUristringThe redirect URI used during the authorization request. Must match exactly.
grantTypestringMust be authorization_code for this flow.
refreshTokenstring(Optional) A refresh token to obtain a new access token without re-authorization.

Example Request Body

{
"code": "auth-code-123456",
"clientId": "client-id-123",
"clientSecret": "client-secret-123",
"redirectUri": "https://example.com/callback",
"grantType": "authorization_code",
"refreshToken": "refresh-token-123"
}

Responses

✅ 200 OK — Access token generated successfully

Returns an access token and related metadata.

❌ 400 Bad Request — Invalid authorization code

Returned when the provided authorization code is invalid, expired, or already used.


Request

This endpoint expects an object.
codestringOptional
clientIdstringOptional
redirectUristringOptional
clientSecretstringOptional
grantTypestringOptional
refreshTokenstringOptional