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
- Type: stringclient
_id requiredOAuth2 client ID
- Type: stringclient
_secret requiredOAuth2 client secret
- Type: string enumgrant
_type requiredGrant type
values- authorization
_code - refresh
_token
- Type: stringcode
Authorization code (required for authorization_code grant)
- Type: stringredirect
_uri Redirect URI (required for authorization_code grant)
- Type: stringrefresh
_token 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"
}