Obtain/Refresh Tokens

This endpoint is used to obtain a new access token using various OAuth 2.0 grant types or refresh an existing token. Refreshing rotates both tokens. By default, reusing the old refresh token within 60 seconds returns the same replacement access_token and refresh_token with the remaining expires_in, provided the replacement token record still exists; after the grace period or revocation, the old refresh token is invalid. Unknown clients and failed client_secret or code_verifier checks count as credential failures; requests are rejected when the recorded count is greater than 10. Invalid or already-used authorization codes and refresh tokens after client authentication use a separate failure counter; requests are rejected when its recorded count reaches the configured limit (200 by default). Both counters are per client_id, grant_type, and request IP address (IPv6 addresses are grouped by /64), and use fixed windows starting with the first failure: 600 seconds for credentials, and 600 seconds by default for invalid grants. Later failures do not extend the window. Public clients (no client_secret) also have a counter of distinct invalid refresh tokens per client_id and request IP address, using the invalid-grant window: retrying the same refresh token counts once per window, and requests are rejected when the count reaches the configured limit (30 by default). Any of these counters can return 429 Too many attempts. A refresh that times out waiting for another refresh returns 429 (Token refresh in progress, retry later.) without rotating tokens or incrementing any failure counter; retry later.

Body Params
string
required

The unique identifier for the client application requesting the token.

string
required

The secret key associated with the client application, used for authentication.

string
enum
required

The OAuth 2.0 grant type. Possible values: 'authorization_code' or 'refresh_token'.

Allowed:
string
length ≤ 255

The authorization code received from the authorization endpoint. Required if 'grant_type' is 'authorization_code'.

string
length ≤ 255

The refresh token used to obtain a new access token. Required if 'grant_type' is 'refresh_token'.

Response

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json