GladysDevelopers

OAuth2 Token

Exchanges a grant for an access token: client_credentials (your app's own token), authorization_code with PKCE (a user who connected your app), or refresh_token. Send the parameters form-encoded. Errors use the RFC 6749 shape, {"error", "error_description"}.

Choose a TEST app to send requests from the playground.
post/oauth/token

Exchanges a grant for an access token: client_credentials (your app's own token), authorization_code with PKCE (a user who connected your app), or refresh_token. Send the parameters form-encoded. Errors use the RFC 6749 shape, {"error", "error_description"}.

Request Body

application/x-www-form-urlencoded
  1. body
client_id*string
client_secret?string
code?string

For authorization_code

code_verifier?string

PKCE, for authorization_code

grant_type*string

authorization_code, client_credentials, refresh_token

redirect_uri?string

For authorization_code

refresh_token?string

For refresh_token

scope?array<string>

Space-delimited when form-encoded

Response Body

OK

application/json
  1. response
access_token?string
expires_in?integer

Seconds until the access token expires.

refresh_token?string

Issued for authorization_code and refresh_token grants, never for client_credentials.

scope?string

Space-separated.

token_type?string
curl -X POST "https://example.com/oauth/token" \  -H "Content-Type: application/x-www-form-urlencoded" \  -d 'client_id=string&grant_type=string'
{  "access_token": "string",  "expires_in": 3600,  "refresh_token": "string",  "scope": "payments:create payments:read",  "token_type": "Bearer"}