Skip to main content

OAuth Authentication

Obtain access tokens using OAuth 2.0 Client Credentials flow.

Endpoint

POST /v1/auth/token

Request

Header Parameters


ParameterTypeRequiredExampleDescription
Content-TypestringYesapplication/x-www-form-urlencodedRequest body content type.

Request Body Schema

application/x-www-form-urlencoded
client_idrequired
string
OAuth client identifier issued to your application.
Example: YOUR_CLIENT_ID
client_secretrequired
string
OAuth client secret issued to your application.
Example: YOUR_CLIENT_SECRET

Example request

curl -X POST "${API_URL}/auth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET"

Responses

200 Success

200 Success

Response schema: application/json
data
json-string
OAuth token response wrapper.
Expand for fields.
access_token
string
Access token to use in API requests.
Example: sk-418e41a74ca2e7d941fa4456d73dbed7
token_type
string
Token type.
Example: Bearer
expires_in
integer
Token lifetime in seconds.
Example: 3600

Response sample

{
"data": {
"access_token": "sk-418e41a74ca2e7d941fa4456d73dbed7",
"token_type": "Bearer",
"expires_in": 3600
}
}

400 Bad Request

400 Bad Request

Response schema: application/json
error.code
string
Error code.
Example: 400013
error.code_reason
string
Error reason.
Example: invalid_request
error.message
string
Human-readable message.
Example: Missing or invalid parameters
{
"error": {
"code": "400013",
"code_reason": "invalid_request",
"message": "Missing or invalid parameters"
}
}

401 Unauthorized

401 Unauthorized

Response schema: application/json
code
string
Error code.
Example: 401021
code_reason
string
Error reason.
Example: invalid_client
message
string
Human-readable message.
Example: Invalid client_id, client_secret, or session_key
{
"error": {
"code": "401021",
"code_reason": "invalid_client",
"message": "Invalid client_id, client_secret, or session_key"
}
}

403 Forbidden

403 Forbidden

Response schema: application/json
error
json-string
Access forbidden for this resource.

404 Not Found

404 Not Found

Response schema: application/json
error
json-string
Resource or endpoint not found.

500 Failure

500 Failure

Response schema: application/json
code
string
Error code.
Example: 500999
code_reason
string
Error reason.
Example: API_ERROR
message
string
Human-readable message.
Example: Api Error, please contact customer service
{
"error": {
"code": "500999",
"code_reason": "API_ERROR",
"message": "Api Error, please contact customer service"
}
}