Skip to main content
POST
Create an API token

Authorizations

Authorization
string
header
required

Bearer token for the authenticated caller.

Body

application/json
name
string
required

Human-readable name for the token

Required string length: 1 - 100
Example:

"My CLI token"

expires_at
integer | null

Unix timestamp (seconds) when the token expires. Omit or pass null for no expiry.

Required range: x >= 0
Example:

1742169600

workspace_id
string | null

The only Workspace the token may act in. Omitted or null: every Workspace the person may use.

Required string length: 2 - 53
Example:

"ws_j572abc123def4"

roles
object | null

A ceiling of IAM roles: the token may do only what one of these roles includes, and only what the person may. Omitted or null: the rights of the person.

Response

Token created. The token field is shown only once.

id
string
required

API token ID.

Required string length: 3 - 54
Example:

"tok_3k9x2mfq8a1b7c4d5e6f"

name
string
required
Required string length: 1 - 100
Example:

"My CLI token"

prefix
string
required

The first 12 characters of the token, for recognizing it. Never the secret.

Example:

"sk_akua_a3B2"

workspace_id
string | null
required

The only Workspace the token may act in. Omitted or null: every Workspace the person may use.

Required string length: 2 - 53
Example:

"ws_j572abc123def4"

roles
object | null
required

A ceiling of IAM roles: the token may do only what one of these roles includes, and only what the person may. Omitted or null: the rights of the person.

created_at
integer
required

Unix timestamp (seconds)

Required range: x >= 0
last_used_at
integer | null
required

Unix timestamp (seconds) of last use, or null if never used

Required range: x >= 0
expires_at
integer | null
required

Unix timestamp (seconds) when the token expires, or null if never

Required range: x >= 0
token
string
required

The full token. This is shown only once - store it securely.

Example:

"sk_akua_a3B2c4D5e6F7g8H9i0J1k2L3m4N5o6P73jZRME"