# Authentication

Send your API key in the standard `Authorization` header:

```
Authorization: Bearer <your key>
```

We chose `Authorization: Bearer` because it is the Zuplo default and the convention HTTP clients, proxies and secret scanners already understand. The key is never forwarded to GoSmarter's backend.

## Accounts and keys

Each key belongs to one **API account**. The account, not the key, decides whether you are in `live` or `mock` mode, and the service checks that against its own records on every call.

| | Live | Mock |
|---|---|---|
| Account id prefix | `gsm-live-` | `gsm-mock-` |
| Real extraction | Yes | No: canned scenarios |
| Use for | Production | Integration, CI, demos |

A live key can never be used for a mock account, or the other way round. A key whose account name and mode disagree is rejected with `403`.

## Getting and rotating keys

GoSmarter provisions your account and links it to your organization in the developer portal. We invite your first administrator; from there your administrators invite colleagues. Once signed in, the **Your profile** and **Team members** links in the menu open the account pages where you manage your own sign-in and where administrators invite or remove colleagues.

- **Sign in** to the portal and open **API Keys** (settings). Only people in your organization can see your account.
- **Everyone in your organization** can view the key values, create keys (up to 5), delete a key (use this to revoke at once) and **Roll**. Only administrators can invite or remove people, in your profile menu under **Team members**.
- **Roll** creates one new key (shown to you straight away) and gives every existing key a **24-hour grace period**, then it stops working. Switch your systems to the new key within that time. To revoke a key immediately instead, delete it.
- If you leave the organization you lose access to the page. Keys you created keep working until they are deleted or rolled: another member of your organization should do that.

If a key leaks, delete it or tell us and we revoke it. After a portal update your browser may keep an old copy of the page: hard-refresh if the key page looks wrong.

:::info

Keys use Zuplo's `zpka_` format, which lets GitHub secret scanning detect leaked keys. The `gsm-live-` / `gsm-mock-` prefix identifies the *account*, not the key string.

:::

## Safe handling

- Keep keys in a secret store; call the API from your server only.
- Use a separate key per environment.
- Never log the `Authorization` header.
