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
string
required
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_1234abcdboolean
default:"false"
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.Response
string
required
The unique identifier for this key in Unkey’s system.
string
The prefix of the key for visual identification.
boolean
Whether the key is currently active.
string
Human-readable name for the key.
string
The full plaintext key value (only when
decrypt=true and key is recoverable).integer
Unix timestamp in milliseconds when the key was created.
integer
Unix timestamp in milliseconds when the key expires (if set).
object
Custom metadata attached to the key.
array
Array of permission strings assigned to the key.
array
Array of role names assigned to the key.
object
array
Array of rate limit configurations attached to the key.
object
Identity information if the key is associated with an identity.