err:unkey:authentication:malformedAuthorization header but couldn’t read a credential from it. The header must be Bearer, one space, and the token. You get HTTP 400.
Example response
Likely causes
- The
Bearerprefix is missing, or you used a different scheme such asBasic. - The token after the prefix is empty.
- Whitespace, a newline, or quotes got in when the key was copied, or a client library added its own scheme.
- A dashboard session token has expired or doesn’t validate. The message is
Invalid bearer token.
How to fix
- Send the header as
Authorization: Bearer unkey_xxx, with one space and no quotes. - Check for stray whitespace or a newline, and for a client library that adds its own scheme.
- If you’re using a dashboard session token, sign in again.
Related errors
err:unkey:application:invalid_input: the header is missing entirely.err:unkey:authentication:missing: the endpoint doesn’t accept the kind of credential you sent.err:unkey:authentication:key_not_found: the token is readable but isn’t a valid root key.