Skip to main content
malformed_key_id means a key route received a path value that is not a key id. Read this page if you read, revoke or rotate keys by id.

What happened

Routes:
  • GET /v1/keys/{key_id}
  • DELETE /v1/keys/{key_id}
  • POST /v1/keys/{key_id}/rotate
A key id is an opaque string that starts with key_, for example key_d92a9043204d41c09c78fc813d54ef06. The path value does not start with key_, so OpenType did not look anything up. Common causes:
  • The key’s name or secret_prefix was used in place of its id.
  • The id lost its key_ prefix while being stored.
A value starting with otsk_ is a key secret, and gets secret_in_path instead. A well-formed id that does not exist in your organization gets key_not_found.

How to fix

Use the id field from a key object. It is returned when you create a key, and on every key in GET /v1/keys. Store it as an opaque string and send it back unchanged.

Example

Finding a key’s id by name, then reading it. Both calls need keys_read.