REST API: access tokens
Create a permanent API token
Create a token for server-to-server calls.
Purpose
Use this call to create a permanent API token from your own tooling instead of the dashboard. Keep the new token on your server only.
Request
POST <API_BASE_URL>/token/create. All calls are POST under your API address. Replace <API_BASE_URL> with the API address provided with your access.
Send a permanent API token in the token field of the body, or a user token in the token header. See authentication.
Content type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
token | string (uuid) | if no header | Your current permanent API token. Required unless you send a user token in the token header. |
expires | string | no | When the new token stops working, as a UTC timestamp that ends in Z, for example 2027-01-01T00:00:00.000Z. Leave it out for a token that does not expire. |
Response
HTTP 201. The token was created and is usable immediately.
| Field | Type | Description |
|---|---|---|
status | string | Always ok on this body. |
message | string | Human-readable detail. Never branch on it. |
token.id | string (uuid) | The new token. Send it as token in later calls. |
token.expires | string | The expiry as a UTC timestamp, or never. |
Errors
400: The body failed validation. The answer hasstatusoferrorand adetailslist with one entry per offending field (path,expected,actual).401: The token is missing, expired or unknown.
A refusal can also come before the operation runs: an address outside your IP allowlist, a token bound to another address, or a body that is not valid JSON. See response format and errors.
Example
Request:
curl -X POST "<API_BASE_URL>/token/create" \
-H "Content-Type: application/json" \
-d '{
"token": "<your permanent API token>",
"expires": "2027-01-01T00:00:00.000Z"
}'
Response:
{
"status": "ok",
"message": "<detail>",
"token": {
"id": "<token id>",
"expires": "2027-01-01T00:00:00.000Z"
}
}