The token endpoint issues the bearer tokens used on /v2 endpoints. It supports three grants:
authorization_code, client_credentials, and refresh_token.
Endpoint
Authentication
The request authenticates your application, not a user. Send credentials in the form body
(client_secret_post):
- Confidential clients must send
client_id and a matching client_secret.
- Public clients send
client_id only and prove possession through PKCE.
HTTP Basic authentication is not supported. Client credentials must be form fields in the request
body.
Request Body
Content type: application/x-www-form-urlencoded
Grants
authorization_code
client_credentials
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.
Request Example
Response
Success Response
Status Code: 200 OK
For an application without a token TTL, the response omits both optional fields entirely:
Response Fields
Error Responses
Errors follow the OAuth error format rather than Chamelio’s usual detail body:
401 Unauthorized
400 Bad Request
Notes
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.
Use Cases
- Completing user sign-in - Turn an authorization code into a usable token
- Keeping a session alive - Rotate a short-lived token before it expires
- Confirming a credential - Check that a client ID and secret pair still authenticate