OAuth2 token endpoint

Exchanges an authorization code for an access/refresh token pair (grant_type: authorization_code) or refreshes an expired access token (grant_type: refresh_token). Returns access_token, token_type: Bearer, expires_in (seconds), and refresh_token.

Body
required
application/json
  • client_id
    Type: string
    required

    OAuth2 client ID

  • client_secret
    Type: string
    required

    OAuth2 client secret

  • grant_type
    Type: string enum
    required

    Grant type

    values
    • authorization_code
    • refresh_token
  • code
    Type: string

    Authorization code (required for authorization_code grant)

  • redirect_uri
    Type: string

    Redirect URI (required for authorization_code grant)

  • refresh_token
    Type: string

    Refresh token (required for refresh_token grant)

Responses
  • application/json
  • 400

    Invalid request or grant

  • 401

    Invalid client credentials

  • application/json
  • application/json
  • application/json
Request Example for post/auth/oauth/token
curl https://test.boost.space/api/auth/oauth/token \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "grant_type": "authorization_code",
  "client_id": "",
  "client_secret": "",
  "code": "",
  "redirect_uri": "",
  "refresh_token": ""
}'
{
  "access_token": "string",
  "token_type": "Bearer",
  "expires_in": 1,
  "refresh_token": "string",
  "scope": "string"
}