OAuth Token Endpoint
/oauth/tokenThe OAuth token endpoint, supporting authorization_code and refresh_token.
This endpoint does not require an API Key.
Request
Base URL: https://api.bluehola.com
Request body
A request body is required.
Request body fields
| Field | Type | Required | Description |
|---|---|---|---|
grant_type | string | Yes | authorization_code or refresh_token |
client_id | string | Yes | |
client_secret | string | Yes | This is the client authentication method — which is why this endpoint carries no API Key auth |
code | string | No | Required when grant_type=authorization_code |
redirect_uri | string | No | Required when grant_type=authorization_code, and must match the one used at issue time character for character (RFC 6749 §4.1.3) |
code_verifier | string | No | Required if a code_challenge was sent during authorization, otherwise 400 — allowing it to be omitted would let anyone who intercepts a code bypass the whole of PKCE simply by not sending it |
refresh_token | string | No | Required when grant_type=refresh_token |
Content-Type: application/json
Schema:
{
"type": "object",
"properties": {
"grant_type": {
"type": "string",
"description": "string · required — `authorization_code` or `refresh_token`"
},
"client_id": {
"type": "string",
"description": "string · required — "
},
"client_secret": {
"type": "string",
"description": "string · required — This *is* the client authentication method — which is why this endpoint carries **no API Key auth**"
},
"code": {
"type": "string",
"description": "string · optional — Required when grant_type=authorization_code"
},
"redirect_uri": {
"type": "string",
"description": "string · optional — Required when grant_type=authorization_code, and must match the one used at issue time **character for character** (RFC 6749 §4.1.3)"
},
"code_verifier": {
"type": "string",
"description": "string · optional — **Required** if a code_challenge was sent during authorization, otherwise 400 — allowing it to be omitted would let anyone who intercepts a code bypass the whole of PKCE simply by not sending it"
},
"refresh_token": {
"type": "string",
"description": "string · optional — Required when grant_type=refresh_token"
}
},
"required": [
"grant_type",
"client_id",
"client_secret"
]
}
Response
| Status | Description |
|---|---|
200 | OK |
4xx | Client error |
200 response schema
{
"$ref": "#/components/schemas/OAuthTokenResponse"
}
For the common error envelope and how to handle it, see Error Codes.
Notes
Response
access_token, refresh_token, token_type: Bearer, expires_in (seconds), scope, account_id, project_id, connection_id.
Lifetimes and rotation
Access tokens last 1 hour, refresh tokens 30 days. Every refresh rotates them: the old pair is revoked immediately and a brand-new pair is issued. This is not for convenience — if a refresh token leaks, rotation means only one of the attacker and the real client can keep using it, and the other one's next refresh failing is your signal that something is wrong. Renewing the same row in place would leave the leaked copy usable forever, with no trace.
Failure semantics
An authorization code that does not exist, has already been used, or has expired returns the same message in all three cases, deliberately undifferentiated — distinguishing them would turn this endpoint into a probe for code state. The code is consumed with a single conditional UPDATE (WHERE used_at IS NULL AND expires_at > now(), judged by the database clock) rather than a read followed by a write: two concurrent requests would both pass the read and each obtain a token, and authorization code replay is the most classic OAuth attack there is.
Calling business endpoints with an access token
Authorization: Bearer oat_..., using the same header as an API Key. An access token's reach is fixed to the Business Portfolio chosen at authorization time; it cannot be widened through request parameters, and it cannot reach another customer's assets.