Skip to main content
POST /v1/authorizations/token Obtains access tokens for server-to-server API calls using the OAuth 2.0 Client Credentials grant type. Use this interface to:
  • obtain an access token before calling protected APIs
  • request a new access token after the previous one expires
  • renew an access token proactively before it expires

Client Credentials Model

The Client Credentials grant applies when your system calls Rebell APIs on its own behalf, not on behalf of a specific end user. The access token represents your client application, and the granted scopes belong to the application rather than to any individual user. Rebell authenticates and authorizes the calling system as a whole; the token carries no end-user identity. This grant is suited to server-to-server interactions, system-level operations, and scenarios where your application is trusted to act as the direct API consumer.
If your system serves multiple end users, you must implement and enforce user-specific authorization, role validation, tenant isolation, data access control and prevention of unauthorized operations. Rebell does not differentiate or govern permissions among the end users behind your client application in this model. For user-scoped access, use the user authorization flow with applyToken.

Required Headers

string
required
Basic authentication in the format: Basic Base64(client_id:client_secret)
string
required
SHA256withRSA algorithm signature: algorithm=SHA256withRSA, keyVersion=1, signature=****
string
required
Client identifier provided by Rebell (e.g., 2022091495540562874792). Must be the same value as the client_id used in the Authorization header.
string
required
RFC3339 formatted timestamp accurate to seconds
string
application/json; charset=UTF-8

Request Parameters

string
required
Fixed value: client_credentials
string
Permission scope. Must be openid for the AI Mini Program scenario.

Authorization Header Encoding

The Authorization header uses standard Base64 (not the URL-encoded form used for signatures) of the string client_id:client_secret:

Response Parameters

object
required
Standard result object with resultCode, resultStatus, resultMessage
string
13-digit millisecond timestamp of the response.
string
Bearer token for subsequent API calls.
string
Always Bearer.
number
Token validity period in seconds.
string
Granted permission scopes.

Result Codes

Result Handling

  • result.resultCode = SUCCESS: the request succeeded. Use accessToken as a Bearer token in subsequent protected API calls.
  • result.resultCode != SUCCESS: the request failed. Decide the next action from the result code and message:
    • Parameter errors (PARAM_ILLEGAL, UNSUPPORTED_GRANT_TYPE, INVALID_SCOPE): correct the request and try again.
    • Authentication errors (INVALID_AUTH_CLIENT, ACCESS_DENIED): check client_id, client_secret and the header format.
    • System or unknown errors (UNKNOWN_EXCEPTION): retry later if appropriate.
  • Track expiresIn and request a new access token before the current one expires.

Sample

Request

Response