Skip to content

Create API Token ​

Create a new API Token for use in authenticating API requests. To learn how to authenticate your requests using your API Token, click here.

HTTP Request ​

POST {API_URL}/api-tokens

Body parameters ​

ParametersRequirementsTypeDescription
nameRequiredstringThe name of the API Token. A string with a maximum length of 50 characters.
descriptionOptionalstringAn optional description of the API Token.

Reponse Attributes ​

status boolean ​

The status of the request to create an API Token. true signifies success, while false indicates an error.

message string ​

A message describing the status of the request to create an API Token.

data object ​

Returns the data object, containing details of the new API Token.

Each API Token specifies the following properties:

  • name: The name of the API Token.
  • token: The API Token value used to authenticate API requests.
  • description: An optional description of the API Token.
  • created_at: The timestamp when the API Token was created.
  • id: The API Token ID.

Example ​

Request ​

curl -X POST '{API_URL}/api-tokens' \
-H 'Authorization: Bearer {ACCESS_TOKEN}' \
-H 'refresh-token: {REFRESH_TOKEN}' \
-H 'Content-Type: application/json' \
-d '{
    "name":"exascale-test-token",
    "description":"This is an example API Token"
}'

Response ​

{
    "status": true,
    "message": "Creating API Token successful",
    "data": {
        "name": "exascale-test-token",
        "id": "670881c41221aabc72ed946b",
        "description": "This is an example API Token",
        "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVC...",
        "created_at": 1728610756
    }
}