Retrieve detailed key information for dashboard interfaces and administrative purposes.
Use this to build key management dashboards showing users their key details, status, permissions, and usage data. You can identify keys by keyId or the actual key string.
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 information:
api.*.read_key (to read keys from any API)api.<api_id>.read_key (to read keys from a specific API)Additional 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:
Specifies which key to retrieve using the database identifier returned from keys.createKey.
Do not confuse this with the actual API key string that users include in requests.
Key data includes metadata, permissions, usage statistics, and configuration but never the plaintext key value unless decrypt=true.
Find this ID in creation responses, key listings, dashboard, or verification responses.
3 - 255"key_1234abcd"
Controls whether to include the plaintext key value in the response for recovery purposes.
Only works for keys created with recoverable=true and requires the decrypt_key permission.
Returned keys must be handled securely, never logged, cached, or stored insecurely.
Use only for legitimate recovery scenarios like user password resets or emergency access. Most applications should keep this false to maintain security best practices and avoid accidental key exposure. Decryption requests are audited and may trigger security alerts in enterprise environments.
Successfully retrieved key information. When decrypt: true, includes plaintext key value for recoverable keys.