# Authentication

> Live API keys (b55_live_), sandbox keys (b55_test_), and the rule that the sandbox only ever holds fictional people.

Source: https://docs.b55.online/authentication

Send a key on every request:

```http
Authorization: Bearer b55_live_...
```

## Live keys

| | |
|---|---|
| Prefix | `b55_live_` |
| Where you get one | Sign in to the hosted console, open **API keys**, create a key. |
| Shown | **Once**, when you create it. B55 stores only a hash, so it cannot show it again. Copy it into your secret store straight away. |
| Reach | Everything in your account: its jobs, candidates, reports and events. Never another account's. |
| Revoking | Revoke it in the console. It stops working on the next request. Creating and revoking keys needs an owner or admin. |

Keep live keys on your server. Never put one in a browser, a mobile app or a repository. If one leaks, revoke it and create a new one.

A live key sent to a server that only runs the sandbox is `401 live_keys_unavailable`. A wrong or revoked key is `401 unauthorized`. See [Errors](/errors#401).

## Sandbox keys

| | |
|---|---|
| Prefix | `b55_test_` |
| Where you get one | The console's **API keys** page, in your browser. |
| Data | Fictional only, in memory, and reset when the instance restarts. |

## The sandbox is fictional-only

The sandbox exists so you can try the whole flow without a real person in it. It holds the eight fictional developers (see [Candidates](/candidates#sandbox-candidates)) and nothing else.

- The hosted sandbox accepts only made-up email addresses at reserved test domains such as `example.com`. Anything else is `422 sandbox_fictional_only`.
- It accepts only `--demo` scans (fictional history). A real scan is `422 sandbox_demo_only`.
- A `--demo` scan sent to a real job is `422 demo_scan`.
- Test keys never reach live data, and live keys never reach sandbox data.
- There is no email, no webhook delivery to your server and no real GitHub check in the sandbox.

Put real candidates through a live job with a live key.

## Two routes take no key

The candidate calls these, never your backend: `POST /v0/jobs/{job_id}/apply` (the apply page) and `POST /v0/candidates/{candidate_id}/scan` (the CLI). In live mode the scan call carries a [candidate token](/candidates#candidate-tokens-and-the-cli-command) instead of an API key. The SDKs do not wrap either route.
