Exchange an authorization code, client credentials, or refresh token for an access token
The token endpoint issues the bearer tokens used on /v2 endpoints. It supports three grants:
authorization_code, client_credentials, and refresh_token.
Exchanges a single-use code from /oauth/authorize for a token
bound to the user who consented. This is the grant to use for anything calling /v2.Required: grant_type, client_id, code, redirect_uri, code_verifier (plus client_secret
for confidential clients).The granted scopes are the ones the user approved - you cannot widen them here.
Authenticates the application itself, with no end user involved in the exchange. The token acts as
the admin who created the application and carries that admin’s access.Required: grant_type, client_id, client_secret. The application must be a confidential
client and must have client_credentials among its grant types.
The creating admin sets the ceiling on what these tokens can reach, and deactivating that user
revokes them. See Client credentials tokens.
No refresh token is ever issued for this grant; request a new access token instead.
Exchanges a refresh token for a new access token, carrying over the original scopes and user.Required: grant_type, client_id, refresh_token (plus client_secret for confidential clients).
Refreshing rotates the pair: the old access token and the old refresh token are both revoked
immediately. Store the new refresh_token from the response - the previous one no longer works.
A refresh token only exists if the application set default_token_ttl_seconds. Applications without
a token TTL receive non-expiring access tokens and no refresh token.
The code or refresh token is unknown, already used, expired, revoked, issued to a different client, has a mismatched redirect_uri, or failed PKCE verification
unauthorized_client
The application is not allowed the requested grant
invalid_scope
Requested scope is unknown or exceeds the application’s allowed scopes
unsupported_grant_type
grant_type is not one of the three supported values
Store access and refresh tokens as securely as passwords. Chamelio keeps only a hash, so a token
value cannot be recovered - losing it means requesting a new one.
Scopes are fixed at issuance. To gain an additional scope, send the user through
/oauth/authorize again with the wider scope value.
Verify a fresh token with
GET /v2/users/user-info - it echoes back the user,
organization, and granted scopes the token resolves to.