Skip to main content
POST
Create Key

Authorizations

Authorization
string
header
required

Primary scheme: Authorization: Key <key_id>:<secret>.

Body

application/json
name
string | null
scopes
enum<string>[] | null

Least-privilege grants carried by v3 API keys.

Stored as text[] on api_keys; NULL scopes means full access (legacy keys). Scopes are stored as text so new least-privilege surfaces can be introduced without a database-enum migration.

Available options:
jobs:read,
jobs:write,
models:read,
files:write,
webhooks:manage,
log_drains:manage,
usage:read,
keys:manage
kind
enum<string>
default:personal

Personal keys die with the member; service keys belong to the workspace.

Available options:
personal,
service
workspace_id
string | null
expires_at
string<date-time> | null

Response

Successful Response

key_id
string
required
credential
string
required
kind
enum<string>
required

Personal keys die with the member; service keys belong to the workspace.

Available options:
personal,
service
name
string | null
scopes
string[] | null
workspace_id
string | null
expires_at
string<date-time> | null
created_at
string<date-time> | null