api-keys

Create Api Key

Create an API key. Org admins/owners: unchanged. A plain MEMBER may now mint their OWN key (task 1851) — strictly self-scoped: never a scope beyond their access, and never org-wide.

post/v1/orgs/{org_id}/api-keys

Request

  • Base URL: https://api.sonenta.dev
  • URL: https://api.sonenta.dev/v1/orgs/{org_id}/api-keys
  • Auth: none declared

Path parameters

org_idstring required

Request body

namestring required
scopesstring[]
projectsstring[]

Project UUIDs this key may act on. Empty (default) = ORG-WIDE (every project in the org).

version_uuidstring nullable

Optional: scope the key to a single project version. null (default) means all-versions. Requires exactly one entry in projects.

env_type'prod' | 'dev'

prod keys are not IP/origin gated (CDN-served reads only). dev keys can hit the runtime translation endpoint and MUST carry at least one * or specific entry in ip_allowlist OR origin_allowlist; empty + dev = key is unusable by design.

ip_allowliststring[]

CIDR or exact IPs (e.g. 1.2.3.4, 10.0.0.0/8, *). Enforced ONLY for env_type='dev' on the runtime endpoint.

origin_allowliststring[]

Exact origin URLs (e.g. http://localhost:5173, https://app.sonenta.com, *). Enforced for env_type='dev' on the runtime endpoint.

expires_atstring date-time nullable

Response

Successful Response

uuidstring required
prefixstring required
last4string required
namestring required
scopesstring[] required
projectsstring[]
org_wideboolean
version_uuidstring nullable
env_type'prod' | 'dev'
ip_allowliststring[]
origin_allowliststring[]
created_by_uuidstring nullable required
created_atstring date-time required
expires_atstring date-time nullable required
revoked_atstring date-time nullable required
last_used_atstring date-time nullable required
secretstring required
tokenstring required

Changes

No recorded changes to this operation across all 1 revision of this API.