Skip to main content

Authentication

Overview

Authentication is OAuth-based and uses bearer tokens.

Endpoint Summary

MethodRoutePurpose
POST/v2.3/oauth/tokenObtain access token (password, refresh_token) grant
POST/v2.3/oauth/revokeRevoke access token or refresh token

POST /v2.3/oauth/token

Obtain an access token.

Headers

HeaderRequiredValue
Content-TypeYesapplication/json
AcceptYesapplication/json

Request Body Fields

FieldTypeRequiredDescription
grant_typestringYesSupported values: password, refresh_token.
usernamestringConditionalRequired when grant_type=password.
passwordstringConditionalRequired when grant_type=password.
refresh_tokenstringConditionalRequired when grant_type=refresh_token.

Example Request (password grant)

curl -X POST "{{BASE_URL}}/v2.3/oauth/token" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"grant_type": "password",
"username": "{{USERNAME}}",
"password": "{{PASSWORD}}"
}'

Example Request (refresh_token grant)

curl -X POST "{{BASE_URL}}/v2.3/oauth/token" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"grant_type": "refresh_token",
"refresh_token": "{{REFRESH_TOKEN}}"
}'

Success Response (200)

{
"access_token": "<token>",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "<refresh_token>"
}

Response Fields

FieldTypeDescription
access_tokenstringAccess token used in Authorization: Bearer ....
token_typestringToken type (Bearer).
expires_innumberToken lifetime in seconds.
refresh_tokenstringRefresh token used to obtain a new access token.

Error Examples

401 Unauthorized

{
"error": {
"code": "invalid_credentials",
"message": "Invalid username or password."
}
}

422 Unprocessable Entity

{
"error": {
"code": "validation_error",
"message": "The request payload is invalid.",
"details": [
{
"field": "grant_type",
"message": "The selected grant_type is invalid."
}
]
}
}

POST /v2.3/oauth/revoke

Revoke the current token context or provided token payload, depending on implementation policy.

Headers

HeaderRequiredValue
AuthorizationYesBearer {{ACCESS_TOKEN}}
Content-TypeYesapplication/json
AcceptYesapplication/json

Request Body

No request body is required.

Example Request

curl -X POST "{{BASE_URL}}/v2.3/oauth/revoke" \
-H "Authorization: Bearer {{ACCESS_TOKEN}}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Success Response (200)

{
"message": "Token revoked successfully"
}

Error Examples

401 Unauthorized

{
"error": {
"code": "unauthorized",
"message": "Authentication is required."
}
}