Skip to main content

Create a Token

This page explains how to request an authentication token in our system.

Grant Types

ValueGrant TypeDescription
1ClientCredentialsUsed for server-to-server authentication
2AuthorizationCodeUsed for OAuth2 authorization code flow
3PasswordUsed for username/password authentication

Request a Token

To authenticate with our API, you need to request an access token using your credentials. Below is an example of how to do this using cURL:

curl --request POST \
--url {{HOST}}/api/v1/oauth/token \
--header 'Content-Type: application/json' \
--header 'User-Agent: insomnia/11.1.0' \
--header 'X-Target-Server: authentication' \
--data '{
"client_id": "1626914093",
"client_secret": "54f5941c26074484a122fd3838e8c62d",
"grant_type": 1
}'

Request Parameters

ParameterTypeRequiredDescription
client_idstringYesYour application's client ID
client_secretstringYesYour application's client secret
grant_typenumberYesThe type of grant being requested (see Grant Types table above)

Response

Upon successful authentication, the server will respond with a JSON object containing the access token and related information:

{
"result": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
},
"errors": null
}

Response Fields

FieldTypeDescription
access_tokenstringJWT token to be used for authenticated API requests
expires_innumberToken expiration timestamp
token_typestringType of token, always "Bearer"

Using the Token

For subsequent API requests, include the access token in the Authorization header:

curl --request GET \
--url https://api.example.com/resource \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ8.'