Create token

Exchanges an authorization code for an access token, or exchanges a refresh token for a new access token. Send parameters as application/x-www-form-urlencoded.

Request

This endpoint expects an object.
grant_typeenumRequired

authorization_code or refresh_token.

Allowed values:
codestringOptional

Authorization code returned from /oauth/authorize.

redirect_uristringOptional
Must match the redirect URI used in the authorization request.
client_idstringOptional

OAuth application client ID (uid).

client_secretstringOptional
Required for confidential clients.
refresh_tokenstringOptional
Refresh token returned from a previous token exchange.
code_verifierstringOptional

PKCE code verifier (required when a code challenge was sent).

Response

OK
access_tokenstring
token_typeenum
The token type returned by OAuth2 token endpoints.
Allowed values:
expires_ininteger
created_atinteger
refresh_tokenstring or null
scopestring or null

Errors