The
api_keys client methods are currently in ALPHA. The API may change without notice. A one-time warning is emitted on first use.Key Capabilities
- List API keys with optional filtering by type or status
- Create user keys (account-scoped) or service keys (space-scoped)
- Delete keys immediately and permanently
- Refresh (rotate) a key while preserving its name and scope
List API Keys
List API keys for the authenticated user. Optionally filter bykey_type ("user" or "service") and status ("active" or "deleted"). When status is omitted, only active keys are returned.
Create an API Key
Two key types are supported via separate methods:- User key (
create) — authenticates as the creating user with their full permissions. - Service key (
create_service_key) — scoped to a specific space, backed by a bot user with configurable roles.
User Key
Service Key
When no roles are specified, the server applies defaults (space_role="member", org_role="read-only", account_role="member"). All role assignments must be at or below the caller’s own privilege level.
Delete an API Key
Delete a key by ID. The key is deactivated immediately and permanently.Refresh an API Key
Revoke an existing key and issue a replacement with the same name, description, type, and scope. A new raw key value is returned. Usegrace_period_seconds to keep the old key valid briefly while your services rotate to the new key.