{ "meta": { "requestId": "req_2c9a0jf23l4k567" }, "error": { "detail": "The requested API key could not be found", "status": 404, "title": "Not Found", "type": "https://unkey.com/docs/api-reference/errors-v2/unkey/data/key_not_found" }}
This error occurs when you’re trying to perform an operation on a specific API key using its ID, but the key with that ID doesn’t exist in the system. This is different from the authentication error err:unkey:authentication:key_not_found, which occurs during the authentication process.Common scenarios that trigger this error:
Attempting to update, delete, or get information about a key that has been deleted
Using an incorrect or malformed key ID
Trying to access a key that exists in a different workspace
Reference to a key that hasn’t been created yet
Here’s an example of a request that would trigger this error:
Copy
Ask AI
# Attempting to get details for a non-existent keycurl -X POST https://api.unkey.com/v1/keys.getKey \ -H "Content-Type: application/json" \ -H "Authorization: Bearer unkey_YOUR_API_KEY" \ -d '{ "keyId": "key_nonexistent" }'