Skip to content

Create API Key

Create a key. The response holds the only copy of it.

POST/api/v1/api-keys

Requires an API key with the admin scope.

N e Not available while acting as a client workspace. API keys are never created, listed or revoked over MCP.

A new key can only hold scopes the calling key holds, and only read, write and admin. Leave scopes out to copy the calling key's scopes. A key with only read cannot create keys at all. The call writes an audit.api_key.created entry with the key id, name, prefix and scopes, never the key.

Body Parameters#

namestringbodyrequired

A name unique in the workspace, up to 100 characters.

scopesstring[]body

Any non-empty subset of read, write, admin that the calling key also has.

Response#

Returns the key in data with a key field holding the full secret. It is shown once and cannot be retrieved again.

Errors#

StatusDescription
401Missing, invalid, revoked or expired API key
403The key lacks the admin or write scope, or its creator lacks the required role
403Asked for a scope the calling key does not hold (scope_escalation)
403Called while acting as a client workspace with X-Workspace-Id (acting_as_forbidden)
409A key with that name already exists
422Unknown scope, empty scopes, or a bad name

Rate Limit#

  • 120 requests per minute, shared by every write call in your workspace. Fixed 60-second window.
  • Every response includes X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (unix epoch seconds) and X-RateLimit-Bucket (write).
  • A 429 response includes a Retry-After header (seconds until the bucket resets).

For client-side patterns, see Rate Limiting.

Was this page helpful?
View as MarkdownLast updated November 4, 2026