POST /v2/apis.listKeys
Retrieve a paginated list of API keys for dashboard and administrative interfaces. Use this to build key management dashboards, filter keys by user withexternalId, or retrieve key details for administrative purposes. Each key includes status, metadata, permissions, and usage limits.
Important: Set decrypt: true only in secure contexts to retrieve plaintext key values from recoverable keys.
Required Permissions
Your root key must have one of the following permissions for basic key listing:api.*.read_key(to read keys from any API)api.<api_id>.read_key(to read keys from a specific API)
api.*.read_apiorapi.<api_id>.read_api
api.*.decrypt_keyorapi.<api_id>.decrypt_key
Request
The API namespace whose keys you want to list. Returns all keys in this API, subject to pagination and filters.Example:
api_1234abcdMaximum number of keys to return per request. Balance between response size and number of pagination calls needed.
- Minimum: 1
- Maximum: 100
Pagination cursor from previous response to fetch next page. Use when
hasMore: true in previous response.Example: key_1234abcdFilter keys by external ID to find keys for a specific user or entity. Must exactly match the externalId set during key creation.Example:
user_1234abcdWhen true, attempts to include the plaintext key value in the response.SECURITY WARNING:
- This requires special permissions on the calling root key
- Only works for keys created with ‘recoverable: true’
- Exposes sensitive key material in the response
- Should only be used in secure administrative contexts
- Never enable this in user-facing applications
EXPERIMENTAL: Skip the cache and fetch the keys directly from the database. This ensures you see the most recent state, including keys created moments ago.Use this when:
- You’ve just created a key and need to display it immediately
- You need absolute certainty about the current key state
- You’re debugging cache consistency issues
Response
Array of API keys with complete configuration and metadata. Each key object includes:
keyId- Unique key identifierstart- Key prefix (first few characters)enabled- Whether the key is activename- Human-readable key namecreatedAt- Creation timestampexpires- Expiration timestamp (if set)meta- Custom metadata objectpermissions- Array of permission stringsroles- Array of role namescredits- Credits configuration and remaining balanceidentity- Associated identity informationplaintext- Plaintext key value (only when decrypt=true and key is recoverable)
Pagination metadata for fetching additional results.
cursor- Token for requesting the next pagehasMore- Whether more results are available
Example
cURL
Response
Error Codes
400- Bad request (invalid parameters)401- Unauthorized (missing or invalid root key)403- Forbidden (insufficient permissions)404- Not found (API does not exist)429- Too many requests (rate limit exceeded)500- Internal server error