Docs / Errors

INVALID_API_KEY

401Invalid API key

Why it happens

The call carried no key, or a key we do not accept: malformed, unknown, or revoked. A revoked key is refused everywhere within a minute.

What to do

  • Send the key as Authorization: Bearer <key>, with the Bearer prefix and nothing around the key.
  • Check that the key is still active in the console. If it was revoked, create a new one.
  • A copied key can lose a character: create a new key rather than retype it, since a secret is shown only once.

Example response

http
HTTP/1.1 401
{
  "type": "https://hub.masjidbox.com/docs/errors/INVALID_API_KEY",
  "title": "Invalid API key",
  "status": 401,
  "detail": "The API key is missing, malformed, unknown or revoked.",
  "instance": "/v1/masjids/msj_abc123defg",
  "code": "INVALID_API_KEY",
  "requestId": "req_8f14e45fceea167a5a36dedd4bea2543"
}