Skip to content

Create API Token ​

Generate a new API Token for API request authentication. For detailed authentication implementation guidelines, please refer to our Authentication Documentation.

HTTP Request ​

POST {API_URL}/api-tokens

Body Parameters ​

ParameterRequirementTypeDescription
nameRequiredstringUnique identifier for the API Token (maximum 50 characters)
descriptionOptionalstringSupplementary information about the token's purpose and usage

Response Structure ​

status boolean ​

Operation result indicator. Returns true for successful execution, false when encountering an error.

message string ​

Descriptive response indicating the outcome of the token creation request.

data object ​

Contains the newly generated API Token information with the following attributes:

  • name: Designated token identifier
  • token: Authentication credential for API requests
  • description: Optional contextual information
  • created_at: Token generation timestamp
  • id: Unique token identifier

Implementation Example ​

Request ​

bash
curl -X POST '{API_URL}/api-tokens' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'refresh-token: {REFRESH_TOKEN}' \
-H 'Content-Type: application/json' \
-d '{
    "name": "rich-test-token",
    "description": "Production environment API token"
}'

Response ​

json
{
    "status": true,
    "message": "API Token successfully generated",
    "data": {
        "name": "rich-test-token",
        "id": "6762a94b91e67919c066540d",
        "description": "Production environment API token",
        "token": "eyJlbWFpbCI6InRlYW1AZXhhYml0cy5haSIsInVzZXJuYW1l...",
        "created_at": 1735475573
    }
}