Skip to main content
Retrieve a paginated list of API keys for dashboard and administrative interfaces. Use this to build key management dashboards, filter keys by user with 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)
Additionally, you need read access to the API itself:
  • api.*.read_api or api.<api_id>.read_api
For decrypt functionality:
  • api.*.decrypt_key or api.<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_1234abcd
integer
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_1234abcd
string
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_1234abcd
boolean
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
This parameter comes with a performance cost and should be used sparingly.

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
Credit configuration for the key.
integer
Current number of credits available.
object
Automatic refill configuration.
integer
Number of credits added on each refill.
string
Refill frequency: daily or monthly.
integer
Day of month for monthly refills (1-31).
object
Information about the identity associated with this key.
string
The external identifier from your system.
object
Custom metadata associated with the identity.
object
Pagination information for navigating through results.
string
Token for requesting the next page. Pass this as the cursor parameter in the next request.
boolean
Whether more results are available beyond the current page.

Examples

Filter by User

Pagination

Response Examples

Basic Key List

Empty Response

With Decrypted Keys