Skip to main content
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

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.

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