externalId, 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 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
string
required
The API namespace whose keys you want to list. Returns all keys in this API, subject to pagination and filters.Example:
api_1234abcdinteger
default:"100"
Maximum number of keys to return per request. Balance between response size and number of pagination calls needed.Range: 1-100
string
Pagination cursor from previous response to fetch next page. Use when
hasMore: true in previous response.Example: key_1234abcdstring
Filter keys by external ID to find keys for a specific user or entity. Must exactly match the externalId set during key creation.Example:
user_1234abcdboolean
default:"false"
When 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
boolean
default:"false"
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
required
Array of API keys with complete configuration and metadata.
string
The unique identifier for this key in Unkey’s system.
string
The first few characters of the key for identification purposes (includes prefix).
string
The complete plaintext key value. Only present when
decrypt: true and key was created with recoverable: true.boolean
Whether the key is currently active.
string
Human-readable name assigned to the key.
integer
Unix timestamp in milliseconds when the key was created.
integer
Unix timestamp in milliseconds when the key expires. Omitted for permanent keys.
object
Custom metadata associated with the key.
array
List of permissions directly assigned to the key.
array
List of roles assigned to the key.
object
object