Skip to content

Create new API token

POST
/api-tokens
object
teamId
required

ID of the team this token will provide access to

string
name
required

Human-readable name for the token (1-255 characters)

string
>= 1 characters <= 255 characters
role
required

Permission level for the token: ‘admin’, ‘member’, or ‘readonly’

string
Allowed values: admin member readonly
expiresAt

Optional expiration date (ISO 8601). If null or not set, token never expires

string format: date-time
nullable

API token created successfully

object
token
required

The plaintext API token. IMPORTANT: This is the only time the token is shown. Store it securely immediately.

string
apiToken
required

Metadata about the created token

object
tokenId
required

Unique identifier for the API token (nanoid format)

string
teamId
required

ID of the team this token provides access to

string
name
required

Human-readable name for identifying this token

string
tokenPrefix
required

Prefix of the token for identification (e.g., ‘cat_tok_’)

string
last4
required

Last 4 characters of the token for verification

string
role
required

Permission level: ‘admin’ (full access), ‘member’ (standard access), ‘readonly’ (read-only access)

string
Allowed values: admin member readonly
createdByUserId
required

ID of the user who created this token

string
expiresAt
required

When the token expires (ISO 8601), or null if no expiration

string format: date-time
nullable
lastUsedAt
required

When the token was last used for an API request (ISO 8601)

string format: date-time
nullable
isActive
required

Whether the token is active and can be used for authentication

boolean
createdAt
required

When the token was created (ISO 8601)

string format: date-time
updatedAt
required

When the token was last modified (ISO 8601)

string format: date-time

Bad Request - Validation error or invalid input

object
error
required
string
code
string
details
nullable
retryable
boolean

Unauthorized - Authentication required or invalid token

object
error
required
string
code
string
details
nullable
retryable
boolean

Forbidden - Insufficient permissions

object
error
required
string
code
string
details
nullable
retryable
boolean

Not Found - Resource does not exist

object
error
required
string
code
string
details
nullable
retryable
boolean