Get API key
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 credential 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)unkey:v1:<workspace_id>:keyspaces/*/keys/*#read_key(to read keys in any keyspace)unkey:v1:<workspace_id>:keyspaces/<keyspace_id>/keys/*#read_key(to read keys in a specific keyspace)unkey:v1:<workspace_id>:keyspaces/<keyspace_id>/keys/<key_id>#read_key(to read a specific key)
Additional permission required for decrypt functionality:
api.*.decrypt_keyorapi.<api_id>.decrypt_keyunkey:v1:<workspace_id>:keyspaces/*/keys/*#decrypt_keyunkey:v1:<workspace_id>:keyspaces/<keyspace_id>/keys/*#decrypt_keyunkey:v1:<workspace_id>:keyspaces/<keyspace_id>/keys/<key_id>#decrypt_key
Authorization
Body
application/jsonSpecifies 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.
Length: 3–255Pattern: ^[a-zA-Z0-9_]+$
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.
Default: false
Responses
decrypt: true, includes plaintext key value for recoverable keys.requestId is particularly important when troubleshooting issues with the Unkey support team.Show child attributesHide child attributes
Show child attributesHide child attributes
Range: 0–9223372036854776000
Range: 0–9223372036854776000
Range: >= 0
Range: 0–9223372036854776000
Show child attributesHide child attributes
Range: 0–9223372036854776000
Show child attributesHide child attributes
Range: 1–9223372036854776000
Day of the month for monthly refills (1-31).
Only required when interval is 'monthly'.
For days beyond the month's length, refill occurs on the last day of the month.
Range: 1–31
Show child attributesHide child attributes
Show child attributesHide child attributes
Length: 8–255Pattern: ^rl_[a-zA-Z0-9_]+$
Items: max 50
Show child attributesHide child attributes
Length: 8–255Pattern: ^rl_[a-zA-Z0-9_]+$
requestId is particularly important when troubleshooting issues with the Unkey support team.Show child attributesHide child attributes
Show child attributesHide child attributes
400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), and 500 (Internal Server Error).Show child attributesHide child attributes
JSON path indicating exactly where in the request the error occurred. This helps pinpoint the problematic field or parameter. Examples include:
- 'body.name' (field in request body)
- 'body.items[3].tags' (nested array element)
- 'path.apiId' (path parameter)
- 'query.limit' (query parameter)
Use this location to identify exactly which part of your request needs correction.
requestId is particularly important when troubleshooting issues with the Unkey support team.Show child attributesHide child attributes
Show child attributesHide child attributes
400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), and 500 (Internal Server Error).requestId is particularly important when troubleshooting issues with the Unkey support team.Show child attributesHide child attributes
Show child attributesHide child attributes
400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), and 500 (Internal Server Error).requestId is particularly important when troubleshooting issues with the Unkey support team.Show child attributesHide child attributes
Show child attributesHide child attributes
400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), and 500 (Internal Server Error).requestId is particularly important when troubleshooting issues with the Unkey support team.Show child attributesHide child attributes
Show child attributesHide child attributes
400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), and 500 (Internal Server Error).requestId is particularly important when troubleshooting issues with the Unkey support team.Show child attributesHide child attributes
Show child attributesHide child attributes
400 (Bad Request), 401 (Unauthorized), 403 (Forbidden), 404 (Not Found), 409 (Conflict), and 500 (Internal Server Error).