# unauthorized

> 401 Unauthorized. The request carried no key, or a key BlueBot doesn’t know: mistyped, revoked, or a test key sent to the live API.

| Status           | Code           | Retry?          |
| ---------------- | -------------- | --------------- |
| 401 Unauthorized | `unauthorized` | After fixing it |

## What it means

The request carried no key, or a key BlueBot doesn’t know: mistyped, revoked, or a test key sent to the live API.

## Common causes

- The `Authorization` header is missing or isn’t `Bearer <key>`.
- The key was revoked on the API keys page.
- The key has a typo; BlueBot checks each key’s checksum before looking it up.

## What to do

Send a valid key as `Authorization: Bearer <key>`.

## Can I retry it?

Only after you fix what the message names. Until then the same request gets the same answer.

## What the answer looks like

The answer, `401`:

```json
{
  "error": {
    "code": "unauthorized",
    "message": "That API key isn’t valid. Check it on the API keys page.",
    "hint": "Send a valid key as `Authorization: Bearer <key>`.",
    "doc_url": "https://usebluebot.com/docs/errors/unauthorized",
    "request_id": "req_1Hq2LxW9cVbN3mKpRtYs0a"
  }
}
```

Branch on `code`, which never changes. `message` and `hint` are written for people and may be reworded. Quote `request_id` when you write to support.

## Related

- [Errors](https://usebluebot.com/docs/errors): the envelope and every code
- [Idempotency](https://usebluebot.com/docs/concepts/idempotency): retrying without sending twice
- [Limits](https://usebluebot.com/docs/limits): every cap and what happens when you reach it
