Two kinds of key
The management API rejects proxy keys with
401 Invalid API key; the runtime rejects organization keys. Use the proxy key in your application’s base_url client and the organization key in scripts, CI and integrations that call this API.
Dashboard users authenticate with their sign-in session instead of a key. Some endpoints are only available to a signed-in user; see Human-only endpoints.
Scopes
An organization key is created with one of two scopes:
A
read key calling a mutating endpoint receives:
Human-only endpoints
These endpoints require a signed-in dashboard session and return403 for any organization key, because they manage credentials, membership or billing:
- Proxy API keys:
GET/POST /proxies/{proxy_id}/keys,DELETE /proxies/{proxy_id}/keys/{key} - Organization API keys:
GET/POST /orgs/{org_id}/keys,DELETE /orgs/{org_id}/keys/{key}(admins) - Organization and members:
GET/PATCH /orgs/{org_id},/orgs/{org_id}/users/...(writes require an admin) - Alert rule writes and notification settings:
POST/PATCH/DELETE /alert-rules,PATCH /notification-settings,POST /notification-settings/test(admins) - Hybrid deployments: everything under
/deployments(admins, exceptGET /deployments/health)
Creating an organization key
- In the dashboard, open Settings → API Keys and choose Create API key.
- Give it a label, an expiry (30, 60 or 90 days) and an access level (Read only or Read and write).
- Copy the secret. It is shown once; the list afterwards shows only the identifier (
ak_…).
POST /orgs/{org_id}/keys.
Revocation
Deleting a key in the dashboard or viaDELETE /orgs/{org_id}/keys/{key} takes effect immediately on every request. Keys revoked directly in Clerk, outside Xenovia, can remain valid for up to about 90 seconds while verification caches expire.
Proxy keys are revoked from the proxy’s API keys tab; the runtime rejects a revoked key within seconds.
Authentication failures
Handling keys safely
- Store keys in a secret manager and inject them at runtime; never commit them.
- Use separate organizations or at least separate keys per environment.
- Prefer
readkeys for reporting and dashboards; reservewritekeys for provisioning. - Rotate before the expiry date: create the replacement, deploy it, then revoke the old key.