Skip to content

Create an API token

POST
/api-tokens
curl --request POST \
--url https://api.warmup.social/api-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "Reporting script", "expiresAt": "2026-04-15T12:00:00Z" }'

Returns the token value ONCE. Requires a dashboard session; a request authenticated with an API token gets 403. Usually you create tokens in the dashboard.

Media typeapplication/json
object
name
required

A label to recognize the token in the list.

string
>= 1 characters <= 80 characters

Example

Reporting script
expiresAt

Expiry time (ISO 8601), or null for a token that never expires.

string format: date-time
nullable

Token created. The token field is shown only once.

Media typeapplication/json
object
token
required

The token value. Shown only once.

string
info
required
object
id
required
string format: uuid
name
required
string
prefix
required

Display prefix, e.g. wmp_a1b2.

string
lastUsedAt
required
string format: date-time
nullable
expiresAt
required
string format: date-time
nullable
createdAt
required
string format: date-time

Example

{
"token": "wmp_8f3c...redacted",
"info": {
"prefix": "wmp_a1b2"
}
}

Invalid request.

Media typeapplication/json
object
statusCode
required
integer
message
required
One of:
string
error
string
key
additional properties
any

Example

{
"statusCode": 400,
"message": "Invalid request",
"error": "Bad Request"
}

The Bearer token is missing or invalid.

Media typeapplication/json
object
statusCode
required
integer
message
required
One of:
string
error
string
key
additional properties
any

Example

{
"statusCode": 400,
"message": "Invalid request",
"error": "Bad Request"
}

Not enough permissions.

Media typeapplication/json
object
statusCode
required
integer
message
required
One of:
string
error
string
key
additional properties
any

Example

{
"statusCode": 400,
"message": "Invalid request",
"error": "Bad Request"
}