Total Access Docs
Openapi

OAuth2 token endpoint

Exchanges an authorization code for access and refresh tokens, or refreshes an expired access token. Supports `authorization_code` and `refresh_token` grant types, as well as `client_credentials` for server-to-server. Accepts both `application/json` and `application/x-www-form-urlencoded` bodies.

POST
/api/v1/oauth/token

Exchanges an authorization code for access and refresh tokens, or refreshes an expired access token. Supports authorization_code and refresh_token grant types, as well as client_credentials for server-to-server.

Accepts both application/json and application/x-www-form-urlencoded bodies.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/oauth/token" \  -H "Content-Type: application/json" \  -d '{    "grant_type": "authorization_code",    "client_id": "string"  }'
{  "access_token": "string",  "token_type": "Bearer",  "expires_in": 0,  "refresh_token": "string",  "scope": "string"}
{  "error": "invalid_request",  "error_description": "string"}