Skip to main content
POST
Create an api key

Authorizations

x-api-key
string
header
required

Body

application/json

Create an api key for user_id with a scope set and an optional jq authorization condition (a templated text: inline content or a stored id, plus its render kwargs).

description
string
required
Minimum string length: 1
scopes
string[]
required
user_id
string
required
Minimum string length: 1
condition
TemplatedText · object | null

A renderable text: its source plus the parameters its render takes.

EXACTLY ONE source is set — content (the text inline) or id (the id of a stored resource holding the text); neither and both are refused at construction. kwargs are the render parameters for the TEXT and apply either way, so moving a text from inline to stored (or back) leaves its parameters untouched.

owner_user_id
string | null
policy_data
Policy Data · object | null

Response

Success.

data
ApiKeyCreateResult · object
required

A freshly minted key. api_key is the raw sk-… secret surfaced ONCE — it is never stored in plaintext and never returned again; key_fingerprint is the key's immutable per-mint identity a binding pins against.