OAuth 2.0
Exchange an authorization code
Exchange the callback code for an access token and rotating refresh token. Perform this request only from your backend.
POST
/oauth2/tokenSECURITY WARNING: Call this endpoint only from your backend. Never call it from browser or mobile frontend code. Your client secret must never be included in frontend application bundles, shipped to users, or exposed to clients.
Request query parameters
| Field | Type | Description |
|---|---|---|
grant_typerequired | string | Must be authorization_code. |
coderequired | string | Code received by your redirect URI. |
redirect_urirequired | string | Must exactly match the URI used during authorization. |
code_verifierrequired | string | Original PKCE verifier used to create the challenge. |
Response
200 · application/json| Field | Type | Description |
|---|---|---|
access_token | string | Bearer token used for resource requests. Store server-side. |
refresh_token | string | Single-use token used to obtain a replacement token pair. |
token_type | string | Bearer. |
expires_in | integer | Access-token lifetime in seconds; currently 3600. |
scope | string | Space-delimited scopes granted by the user. |