Create a key
POST/ v1/ orgs/ {org}/ keys
Needs keys.create, and every scope given. A secret key needs at least one scope; a public key has none and sends data to exactly one project. The answer holds the whole key; a secret key's is never shown again.
Path parameters
org
The organization's id (
org_…).Body
name
type
publicsecretmode
livetestscopes
project_ids
A prefixed ULID; the prefix names the kind (
prj_… a project, org_… an organization).Responses
The new key, with key set.
id
A prefixed ULID; the prefix names the kind (
prj_… a project, org_… an organization).org_id
A prefixed ULID; the prefix names the kind (
prj_… a project, org_… an organization).name
type
publicsecretmode
livetestregion
prefix
The start of the key, safe to show.
key
The whole key; always for a public key, for a secret key only in the answer to create and rotate.
scopes
Permissions of a secret key; none on a public key.
project_ids
The projects the key reaches; none means every project.
created_by_id
last_used_at
expires_at
Set on a rotated key, which works until then.
created_at
A time in UTC, ISO 8601.
updated_at
A time in UTC, ISO 8601.
Example response
1{2"id": "key_01JD8Q2M4W9XK3T7B5",3"org_id": "org_01JD8Q2M4W9XK3T7B5",4"name": "Production",5"type": "public",6"mode": "live",7"region": "us",8"prefix": "sk_live_us_ab12",9"key": "key_01JD8Q2M4W9XK3T7B5",10"scopes": [11"string"12],13"project_ids": [14"prj_01JD8Q2M4W9XK3T7B5"15],16"created_by_id": "acc_01JD8Q2M4W9XK3T7B5",17"last_used_at": "2026-11-21T09:30:00Z",18"expires_at": "2026-11-21T09:30:00Z",19"created_at": "2026-11-21T09:30:00Z",20"updated_at": "2026-11-21T09:30:00Z"21}
Errors
Every error has the same shape: error.code, a message for people and details.
| Status | Code |
|---|---|
validation_error | |
forbidden |