All management endpoints on this page are [User] only. Organization members may list and inspect keys;
owner and billing_admin are required to create or revoke them.Endpoints
How access is resolved
Create an API key
POST /api-keys
string
required
Environment to bind the key to.
string
Human-readable key name.
string[]
Scopes to grant. If omitted or empty, the key receives the default tenant, knowledge-base, document, and RAG scopes described below.
string[]
Tenant allowlist. Every ID must belong to
environment_id. Omit or pass [] for all tenants in the environment.string[]
Knowledge-base allowlist. Every ID must belong to the environment and, when
tenant_ids is non-empty, to one of those tenants.number
Optional lifetime from 1 to 365 days. Keys without this field do not receive an API-configured expiration.
apiKey and the complete secret in rawKey.
Key prefixes
If
scopes is omitted or empty, the key receives:
admin:full is a wildcard permission scope: it satisfies every API-key scope check, but it does not make a key eligible for user-session-only endpoints or let it cross its environment boundary. It also makes tenant discovery return every tenant in the environment, regardless of tenant_ids. Prefer explicit least-privilege scopes for production integrations.List API keys
GET /api-keys
Returns key metadata, never complete secret values.
string
required
Environment whose keys to list.
Get an API key
GET /api-keys/:id
string
required
API key ID, not the secret value.
rawKey.
Revoke an API key
DELETE /api-keys/:id
string
required
API key ID to revoke.
Next steps
Authentication
Send keys safely and choose the right caller type.
Access & scopes
Build a least-privilege scope set.
Current caller
Inspect a key’s effective environment and allowlists.