Skip to main content
Redirect the user’s browser here to begin the authorization code flow. Chamelio validates the request, shows the user a consent screen listing the scopes you asked for, and redirects back to your redirect_uri with a single-use authorization code. This is a browser redirect, not an API call - do not fetch it from your backend.

Endpoint

Authentication

None. The user authenticates with Chamelio on the consent screen.

Query Parameters

PKCE is mandatory for every client, confidential and public alike, and only the S256 method is accepted. Generate a fresh code verifier per authorization request and keep it until you exchange the code.

Request Example

Generate a PKCE verifier and challenge, then send the user to the authorize URL.

Response

Success Response

Status Code: 302 Found The user is redirected to Chamelio’s consent screen. Once they approve, their browser is redirected to your redirect_uri with the authorization code appended:
Exchange the code immediately at POST /oauth/token.
Authorization codes are single use and short-lived - by default they expire about a minute after they are issued. Reusing a code is rejected as invalid_grant.
If the user declines, the redirect carries an error instead:

Error Responses

Errors arrive in one of two ways depending on whether Chamelio can trust your redirect_uri yet.

400 Bad Request

Returned directly in the browser, without redirecting, when the request cannot be trusted enough to bounce back:

Redirect errors

Once the client and redirect URI are validated, remaining problems are returned to your redirect_uri as query parameters - error, error_description, and your original state:

Notes

The consenting user must belong to the same organization as the application. A user from another organization attempting to approve gets a 403 on the consent screen.
A pending authorization request expires if the user does not act on it - around ten minutes by default. After that they must start the flow again.
Always send state and verify it on the callback. It is the only way to tell your own redirect from a forged one.

Use Cases

  • User sign-in for your integration - Let each user connect their own Chamelio account
  • Least-privilege access - Request only the scopes a feature actually needs
  • Multi-user products - Give every user their own token instead of sharing one credential