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)
api.*.decrypt_keyorapi.<api_id>.decrypt_key
Request
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.Pattern: ^[a-zA-Z0-9_]+$Example: key_1234abcdControls 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.Response
The unique identifier for this key in Unkey’s system.
The prefix of the key for visual identification.
Whether the key is currently active.
Human-readable name for the key.
The full plaintext key value (only when
decrypt=true and key is recoverable).Unix timestamp in milliseconds when the key was created.
Unix timestamp in milliseconds when the key expires (if set).
Custom metadata attached to the key.
Array of permission strings assigned to the key.
Array of role names assigned to the key.
Array of rate limit configurations attached to the key.
Identity information if the key is associated with an identity.