Peleza β€” Trust built on data
Authentication
On this page

Authorization

Obtain an OAuth 2.0 access token using the client credentials flow. Generate client_id and client_secret from the credentials dashboard, then exchange them for a Bearer token. Token lifetime is configured server-side (TOKEN_TTL_SECONDS; currently 360 seconds / 6 minutes).

Request

POST/api/v1/oauth/token
{{baseUrl}}/api/v1/oauth/token
HeaderTypeDescription
Content-Typestringapplication/json

Body Parameters

ParameterTypeDescriptionRequired
grant_typestringMust be "client_credentials"required
client_idstringClient ID from the credentials dashboardrequired
client_secretstringClient secret β€” store server-side onlyrequired

Sample request & response

Sample request body for Sample request & response:

Sample dataSample request body
{
  "grant_type": "client_credentials",
  "client_id": "pel_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
  "client_secret": "skl_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}

Sample response for Sample request & response:

200 OKSample dataSample response
{
  "success": true,
  "response_code": 200,
  "message": "Token generated successfully",
  "data": {
    "access_token": "exAmPlEtOkEn0123456789AbCdEfGhIjKlMnOpQrStUvWxYz ......",
    "token_type": "Bearer",
    "expires_in": 360
  },
  "request_id": "550e8400-e29b-41d4-a716-446655440099"
}

Response Fields

FieldTypeDescription
successbooleanWhether the token request succeeded
response_codenumberApplication response code (typically mirrors HTTP)
messagestringHuman-readable status message
data.access_tokenstringToken to send as Bearer on API calls
data.token_typestringAlways "Bearer"
data.expires_innumberToken lifetime in seconds (360 = 6 minutes)
request_idstringUUID for support and audit trails

Error codes

Standard Peleza HTTP / response_code values (same across all API calls). Validation message text is endpoint-specific. Full reference: Error Codes.

CodeWhen
200Token generated successfully
400Invalid JSON, or missing grant_type / client_id / client_secret
401Invalid client_id or client_secret

401 β€” invalid credentials

401Sample data401 β€” invalid credentials
{
  "success": false,
  "response_code": 401,
  "message": "Invalid client credentials",
  "data": null,
  "request_id": "550e8400-e29b-41d4-a716-446655440020"
}

Set {{baseUrl}} to https://api.peleza.com (production) or https://sandbox.peleza.com (sandbox). Authenticated calls need a Bearer token from POST /api/v1/oauth/token.