Skip to content

Exchange M2M client credentials for an access token (RFC 6749 section 4.4).

POST
/oauth2/token
curl --request POST \
--url https://api.siteqwality.com/oauth2/token \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data ''

Accepts a form-encoded body, HTTP Basic client authentication, or a JSON body. Returns a bare RFC 6749 token response with no envelope.

Form-encoded: grant_type=client_credentials&client_id=…&client_secret=…[&scope=read:monitors write:incidents]

Media type application/x-www-form-urlencoded
string

Access token

Media type application/json

RFC 6749 section 5.1 successful access-token response.

object
access_token
required

The bearer token to send as Authorization: Bearer <token>.

string
token_type
required

Always “Bearer” (RFC 6750 casing).

string
expires_in
required

Lifetime in seconds, passed through from the issuer.

integer format: int64
scope

Space-delimited granted scopes. Absent when the token carries none.

string | null
Example generated
{
"access_token": "example",
"token_type": "example",
"expires_in": 1,
"scope": "example"
}

Invalid_request, unsupported_grant_type, or invalid_scope

Media type application/json

RFC 6749 section 5.2 error response.

object
error
required

One of the RFC 6749 error codes: invalid_request, invalid_client, invalid_scope, unsupported_grant_type, temporarily_unavailable.

string
error_description

Human-readable detail. Never distinguishes “unknown client” from “wrong secret”: both are invalid_client with the same description.

string | null
Example generated
{
"error": "example",
"error_description": "example"
}

Invalid_client

Media type application/json

RFC 6749 section 5.2 error response.

object
error
required

One of the RFC 6749 error codes: invalid_request, invalid_client, invalid_scope, unsupported_grant_type, temporarily_unavailable.

string
error_description

Human-readable detail. Never distinguishes “unknown client” from “wrong secret”: both are invalid_client with the same description.

string | null
Example generated
{
"error": "example",
"error_description": "example"
}

Temporarily_unavailable (rate limited)

Media type application/json

RFC 6749 section 5.2 error response.

object
error
required

One of the RFC 6749 error codes: invalid_request, invalid_client, invalid_scope, unsupported_grant_type, temporarily_unavailable.

string
error_description

Human-readable detail. Never distinguishes “unknown client” from “wrong secret”: both are invalid_client with the same description.

string | null
Example generated
{
"error": "example",
"error_description": "example"
}

Temporarily_unavailable (issuer unreachable)

Media type application/json

RFC 6749 section 5.2 error response.

object
error
required

One of the RFC 6749 error codes: invalid_request, invalid_client, invalid_scope, unsupported_grant_type, temporarily_unavailable.

string
error_description

Human-readable detail. Never distinguishes “unknown client” from “wrong secret”: both are invalid_client with the same description.

string | null
Example generated
{
"error": "example",
"error_description": "example"
}