Skip to main content
key_not_found means the key id is well formed, but no key with that id exists in the organization of your credential. Read this page if reading, revoking or rotating a key by id fails with a 404.

What happened

Routes:
  • GET /v1/keys/{key_id}
  • DELETE /v1/keys/{key_id}
  • POST /v1/keys/{key_id}/rotate
Keys belong to one organization, and every lookup is limited to the organization of the credential. A key id from another organization is reported as not found. Common causes:
  • The calling key belongs to a different organization than the key you are looking for.
  • The id was mistyped or truncated.
Revoked keys are not removed. They stay listed with state: "revoked", so revoking a key does not cause this error. Revoking a key that is already revoked returns 200 with the original revoked_at. A path value that does not start with key_ is refused earlier with malformed_key_id, and a value starting with otsk_ with secret_in_path.

How to fix

  1. List the keys the credential can see with GET /v1/keys and pick the id from there.
  2. Use a credential from the organization that owns the key.
  3. Store key ids as opaque strings and send them back unchanged.

Example

Listing keys to find the right id. The call needs keys_read. Secrets are never returned here.