Authentication

Exchange client credentials for an access token

post/v1/auth/token

Issues a bearer token for use on subsequent API requests. Only grant_type=client_credentials is supported.

Request body

Content type: application/json

grant_type"client_credentials"
OAuth 2.0 grant type. Only client_credentials is supported.
client_idstring
OAuth 2.0 client identifier issued to your integration.
client_secretstring
OAuth 2.0 client secret issued to your integration.

Content type: application/x-www-form-urlencoded

grant_type"client_credentials"
OAuth 2.0 grant type. Only client_credentials is supported.
client_idstring
OAuth 2.0 client identifier issued to your integration.
client_secretstring
OAuth 2.0 client secret issued to your integration.

Returns

access_tokenstring

required

JWT access token to send as Authorization: Bearer <token> on subsequent API requests.
expires_innumber

required

Number of seconds until the token expires.
token_typestring

required

Token type. Always Bearer.
scopestring
Space-separated list of granted scopes, when applicable.

Error codes

400invalid_request
Missing or invalid request fields, or unsupported grant type.
401invalid_client
Client credentials were rejected. Returns an OAuth 2.0 error body.
502temporarily_unavailable
Token issuance failed because the authorization server is temporarily unavailable.
POST /v1/auth/token
curl -X POST "https://api.v2.pd4castr.com.au/v1/auth/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d 'grant_type=client_credentials&client_id=pUIu7Nx8bXC4dEf...&client_secret=N0t-A-Real-Secret-...'
Response
{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJjbGllbnRfYWJjMTIzIn0.signature",
  "expires_in": 3500,
  "token_type": "Bearer",
  "scope": "read:models"
}