Create a new API token.
Request body
Required.
application/json
expiresAtstring (date-time)namestring · required
{
"expiresAt": "2026-12-31T23:59:59Z",
"name": "My API Token"
}
Responses
| Status | Description |
|---|---|
| 200 | The newly created API token with the JWT (shown only once) |
| 422 | Validation errors |
Response 200 body
{
"id": "019222d4-1d93-7d47-a3c4-b547e009a0f7",
"createdAt": "2024-06-30T19:00:00Z",
"expiresAt": "2026-12-31T23:59:59Z",
"lastUsedAt": null,
"name": "My API Token",
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9..."
}