Skip to main content
POST
/
v1
/
regions
/
global
/
auth
/
tokens
Acquire token
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    grantType: 'authorization_code',
    code: '<string>',
    refreshToken: '<string>',
    clientId: '<string>',
    clientSecret: '<string>',
    redirectUri: '<string>'
  })
};

fetch('https://api.example.com/v1/regions/global/auth/tokens', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
{
  "success": true,
  "data": {
    "accessToken": "<string>",
    "tokenType": "Bearer",
    "expiresIn": 123,
    "refreshToken": "<string>",
    "idToken": "<string>",
    "scope": "<string>"
  }
}

Body

application/json
grantType
enum<string>
required

OAuth2 grant type

Available options:
authorization_code,
refresh_token,
client_credentials
code
string | null

Authorization code (for authorization_code grant)

refreshToken
string | null

Refresh token (for refresh_token grant)

clientId
string | null

Client ID (for client_credentials grant)

clientSecret
string | null

Client secret (for client_credentials grant)

redirectUri
string | null

Redirect URI (for authorization_code grant)

Response

200 - application/json

Token acquired

success
enum<boolean>
Available options:
true
data
object

OAuth2/OIDC token response