v1
latestOpenAPI 3.0.02026-08-04891301.4 MBExchange a grant for OAuth tokens
Issues an access token and a refresh token in exchange for a valid grant. Three grant types are supported: "authorization_code", "refresh_token", and "urn:ietf:params:oauth:grant-type:device_code".
For "authorization_code" grants, supply code, client, redirect_uri, and optionally code_verifier for PKCE flows. Each authorization code is single-use; consuming it a second time returns invalid_grant.
For "refresh_token" grants, supply refresh_token. The endpoint rotates the refresh token on every call and returns a fresh pair of tokens.
For device-code grants, supply device_code and client. Poll this endpoint after receiving authorization_pending until the user approves or the code expires. Slow down polling if you receive slow_down.
This endpoint is rate-limited to 20 requests per IP per 60 seconds. Exceeding the limit returns HTTP 429 with "error": "too_many_requests".
Request body
Example request
{
"client": "string",
"code": "string",
"code_verifier": "string",
"device_code": "string",
"grant_type": "string",
"redirect_uri": "https://example.com",
"refresh_token": "string"
}Response
Successful response
Example response
{
"access_token": "string",
"expires_in": 3600,
"refresh_token": "string",
"scope": "read write",
"token_type": "Bearer",
"user": {
"alias": "jdoe",
"app": "dap_0aBcDeFgHiJkLmNoPqRsTu",
"app_name": "Example Name",
"email": "user@example.com",
"id": "usr_0aBcDeFgHiJkLmNoPqRsTu",
"is_system_user": true,
"metadata": {
"key": "value"
},
"name": "Example Name",
"org": "org_0aBcDeFgHiJkLmNoPqRsTu",
"org_name": "Example Name",
"org_role": "member",
"sandbox": "dsb_0aBcDeFgHiJkLmNoPqRsTu",
"sandbox_name": "Example Name"
}
}