Skip to main content

API Keys Management

Manage your API keys with an API key. These endpoints act on the keys you created, and the calling key needs full access, keys:read to list or keys:write to change, or the legacy manage scope.

Endpoints

List API Keys

Retrieve all API keys you created.
Headers:
Response (200 OK)
grants is what the key reaches, by scope, whichever way its permissions name it; a single-action scope is always write. An export key and an enrolled device’s credential list none. requests_this_month counts against monthly_request_cap, and is 0 for a key with no cap.
key is always null here. The full key is returned once, by Create, and cannot be retrieved afterwards: PromptGuard stores only a one-way digest of it. If you lose a key, create a new one and delete the old one.

Create API Key

Request Body
Response (200 OK)
The key field is only returned once, in this response. Store it securely — you won’t be able to see it again.

No permissions

A key created here with permissions omitted or empty has full access today. That is deprecated: from 2027-02-06, it gets scan + proxy, the scopes application traffic needs, as a key created in the dashboard does. Until then, each such response carries a Deprecation: true header, a Sunset header with that date and a Link header to this section. Keys created before the date keep the access they have. To keep creating full-access keys after the date, send "permissions": ["*"]. To get the new behaviour now, send "permissions": ["scan:write", "proxy:write"].

Scopes

A key with scopes reaches only the endpoints its scopes cover, and is refused any other with 403 scope_denied. A scope is a resource group and a level, <group>:<level>, and the same one covers an endpoint under /api/v1/proxy where it is also served there. scan, proxy and red_team have one action each, so :read and :write reach the same endpoints. For the others, read reaches the endpoints that read and write those that change too: A key created in the dashboard gets scan:write and proxy:write unless you choose otherwise. Other groups exist for other credentials, and a key cannot hold them: events and audit on /api/v1 read the whole organization, which only an export key does, and integrations, team and billing_org have no /api/v1 endpoint. Creating a key with one is refused with 422, as is a misspelt group or level. A key with scopes can create only keys whose scopes it already covers: a keys:write key can create a keys:read key, but not a policies:read key or one with no scopes. Organization-wide export keys are created in the dashboard, not here.

Legacy scopes

Keys created before resource groups carry these scopes, and keep exactly the access they had. Each covers several groups: A key with no scopes, or with both read and write, has full access. write alone covers proxy and manage. A key may carry legacy scopes and groups together; it reaches what either covers.

Monthly request cap

A key can carry a cap on the requests it makes each calendar month (UTC), beside your plan’s quota. Past it, the key is refused with 429 api_key_request_cap_exceeded until the first of next month, and resets_at says when; your other keys are still served. Set it when you create the key, here or in the dashboard. Rotating a key keeps its cap, and the new key counts from zero. Key limits by plan. The cap counts the keys in the organization that owns the key’s project: At the cap, create returns 403 with a message such as API key limit reached. Free plan allows 1 API key(s). Upgrade to Developer for unlimited API keys.

Delete API Key

Permanently delete an API key. This immediately revokes access.
Response (204 No Content), with an empty body.

Toggle API Key Status

Enable or disable an API key without deleting it.
Response (200 OK)
Use toggle instead of delete when you want to temporarily disable a key (e.g., during incident response) without losing the key configuration. A disabled key is refused with 401 disabled_api_key.

Code Examples

Error Responses

Best Practices

  1. Name keys descriptively — Use names like “Production Backend” or “Staging Cron Job” so you can identify them later
  2. One key per service — Don’t share keys between applications
  3. Rotate every 90 days — Create new key → update apps → delete old key
  4. Use toggle for incidents — Disable a compromised key immediately without losing the configuration
  5. Monitor last_used_at — Delete keys that haven’t been used in a while
Last modified on November 5, 2026