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
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
nameorsecret_prefixwas used in place of itsid. - The id lost its
key_prefix while being stored.
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 theid 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
keys_read.
Related
- API keys in the console - see each key’s id, prefix and state.
- secret_in_path - a key secret was sent in the path.
- key_not_found - the id is well formed but unknown.
- Problem codes - every code, its status, and whether a retry can help.