Coinbax API

OAuth 2.0

View as Markdown

Revoke access token

POST/api/v2/oauth/revokeBearer token

Revoke an active access token by its JWT ID (jti)

Request body

  • token_jtistringrequired

    JWT ID (jti) of the token to revoke

Responses

200Token revoked successfully

Response follows the unified success / data / meta / error envelope.

404Token not found

Response follows the unified success / data / meta / error envelope.

curl -X POST https://api-staging.coinbax.com/api/v2/oauth/revoke \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "token_jti": "550e8400-e29b-41d4-a716-446655440000"
}'
const response = await fetch('https://api-staging.coinbax.com/api/v2/oauth/revoke', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.ACCESS_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "token_jti": "550e8400-e29b-41d4-a716-446655440000"
  }),
});
const result = await response.json();

List available OAuth scopes

GET/api/v2/oauth/scopesPublic

Get the catalog of available OAuth scopes that can be assigned to clients

Responses

200List of available scopes
array of OAuthScope
object
[
  {}
]
curl https://api-staging.coinbax.com/api/v2/oauth/scopes
const response = await fetch('https://api-staging.coinbax.com/api/v2/oauth/scopes', {
});
const result = await response.json();

OAuth 2.0 Token Endpoint

POST/api/v2/oauth/tokenPublic

Generate access token using Client Credentials flow (RFC 6749)

Request body

  • grant_typeenumrequired"client_credentials"

    OAuth 2.0 grant type

  • client_idstringrequired

    OAuth client ID

  • client_secretstringrequired

    OAuth client secret

  • scopestring

    Space-separated list of requested scopes (optional, defaults to all client scopes)

Responses

200Access token generated successfully
  • access_tokenstringrequired

    JWT access token

  • token_typestringrequired

    Token type (always Bearer)

  • expires_innumberrequired

    Token expiration time in seconds

  • scopestringrequired

    Space-separated list of granted scopes

{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "scope": "read:transactions write:transactions"
}
400Invalid request or unsupported grant type

Response follows the unified success / data / meta / error envelope.

401Invalid client credentials

Response follows the unified success / data / meta / error envelope.

curl -X POST https://api-staging.coinbax.com/api/v2/oauth/token \
  -H "Content-Type: application/json" \
  -d '{
  "grant_type": "client_credentials",
  "client_id": "coinbax_client_a1b2c3d4e5f6g7h8i9j0",
  "client_secret": "coinbax_secret_x1y2z3a4b5c6d7e8f9g0h1i2j3k4l5m6n7o8p9q0",
  "scope": "read:transactions write:transactions"
}'
const response = await fetch('https://api-staging.coinbax.com/api/v2/oauth/token', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "grant_type": "client_credentials",
    "client_id": "coinbax_client_a1b2c3d4e5f6g7h8i9j0",
    "client_secret": "coinbax_secret_x1y2z3a4b5c6d7e8f9g0h1i2j3k4l5m6n7o8p9q0",
    "scope": "read:transactions write:transactions"
  }),
});
const result = await response.json();