Skip to main content
Exchange an authorization code for an access token (and optionally an ID token if openid scope was requested). When the phone scope is granted, the ID token and userinfo response include phone_number and phone_number_verified. This must be done server-side — never expose your client secret in client-side code.

Request Body

string
required
Must be authorization_code
string
required
The authorization code received from the authorize endpoint callback
string
required
Must exactly match the redirect_uri used in the authorization request
string
required
Your OAuth client ID
string
required
Your OAuth client secret
string
PKCE code verifier (required if code_challenge was provided during authorization)

Response Fields

ID Token Claims

When openid scope is included, the ID token contains:

Error Responses

Unsupported grant type:
Invalid or expired code:
Invalid client credentials:
Redirect URI mismatch:
Invalid PKCE verifier:

Authorization codes expire after 10 minutes and can only be used once. Exchange the code immediately after receiving it.