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 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)Additionally, you need read access to the API itself:
api.*.read_api or api.<api_id>.read_apiAdditional permission required for decrypt functionality:
api.*.decrypt_key or api.<api_id>.decrypt_keyUnkey uses API keys (root keys) for authentication. These keys authorize access to management operations in the API. To authenticate, include your root key in the Authorization header of each request:
Authorization: Bearer unkey_123Root keys have specific permissions attached to them, controlling what operations they can perform. Key permissions follow a hierarchical structure with patterns like resource.resource_id.action (e.g., apis.*.create_key, apis.*.read_api).
Security best practices:
The API namespace whose keys you want to list. Returns all keys in this API, subject to pagination and filters.
1"api_1234abcd"
Maximum number of keys to return per request. Balance between response size and number of pagination calls needed.
1 <= x <= 100Pagination cursor from previous response to fetch next page.
Use when hasMore: true in previous response.
"key_1234abcd"
Filter keys by external ID to find keys for a specific user or entity. Must exactly match the externalId set during key creation.
1"user_1234abcd"
When true, attempts to include the plaintext key value in the response. SECURITY WARNING:
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:
This parameter comes with a performance cost and should be used sparingly.
Successfully retrieved paginated keys. Use the pagination cursor for additional results when hasMore: true.
Metadata object included in every API response. This provides context about the request and is essential for debugging, audit trails, and support inquiries. The requestId is particularly important when troubleshooting issues with the Unkey support team.
Array of API keys with complete configuration and metadata.
100Pagination metadata for list endpoints. Provides information necessary to traverse through large result sets efficiently using cursor-based pagination.