Skip to main content
POST
Create an API key

Authorizations

X-API-Key
string
header
required

Body

application/json
name
string
required

The unique name of the API key.

Required string length: 1 - 255
expire_at
string<date-time> | null

The date and time when the API key will expire. If not provided, the API key will never expire.

scope
enum<string> | null

What the key may do: read only, or read and write, on any plan. Defaults to write.

Available options:
read,
write

Response

Successful Response

A key the moment it is made: the only response that carries the secret.

Its own schema rather than a nullable field on APIKeyReadSchema, so no read route can grow a path that serves the value back by accident.

created_at
string<date-time>
required
created_by
string | null
required

The user ID of the person who made the key, or null for a key made before makers were kept. Its maker or a workspace admin can rename or delete it.

id
string<uuid>
required
key
string
required

The key's value. Shown here and nowhere else, ever: only a hash is stored. Copy it now; a lost key has to be replaced.

key_prefix
string
required

The first characters of the key's value, so it can be told apart from another in a list. The value itself is shown once, when the key is created, and is not recoverable afterwards.

name
string
required
org_id
string
required
role
enum<string>
required

Whose reach the key has. A key made by a workspace admin acts as an admin; one made by a member acts as a member, and is refused what a member is refused, such as changing the plan. When its maker stops being an admin, their keys drop to a member's reach for good.

Available options:
admin,
member
scope
enum<string>
required

What the key may do. A read key may call read endpoints only; a write key may call everything the workspace's plan allows.

Available options:
read,
write
status
enum<string>
required

Whether the key still works. A key stops for good when the person who made it leaves the workspace; a stopped key is refused, and is kept so admins can see what stopped and replace it.

Available options:
active,
stopped
updated_at
string<date-time>
required
created_by_name
string | null

For a stopped key, the name of the person who made it and left, so admins can tell whose scripts to replace; null otherwise or when it cannot be read.

expire_at
string<date-time> | null
last_used_at
string<date-time> | null

When this key last authenticated a request, to the minute.

stopped_at
string<date-time> | null

When the key stopped because its maker left the workspace; null while it works.