malformed_key
The credential is not a Kenso API key sent the expected way: the Authorization header does not start with Bearer, the key is in X-Api-Key, or the value is not shaped like a key.
What it means
The credential is not a Kenso API key sent the expected way: the Authorization header does not start with Bearer, the key is in X-Api-Key, or the value is not shaped like a key.
How to fix it
Send Authorization: Bearer <your API key>, with the whole key: it starts with kenso_live_, or ken_ in the older format.
Where it comes from
401 malformed_key is not tied to one endpoint. The errors guide says when the API answers it.
The error body carries this code in error.code. Branch on the code, not on message. See the errors guide.