# Authentication, keys and scopes

> Create a Techvia TMS API key, choose its scopes and send it in the Authorization header.

Source: https://techvia.software/docs/tms/concepts/authentication/

1. API access comes with the Pro AI plan. On any other plan Techvia switches it on per workspace; ask your account
   contact if you do not see it.
2. A workspace admin (Organization admin or Admin) opens **Settings > API keys**, names the key, picks its scopes and,
   optionally, an expiry date.
3. The full key (`tms_` followed by 43 characters) is shown **once**. Store it in your secret manager. Techvia keeps
   only a hash and cannot show it again. The key list shows its first 12 characters so you can tell keys apart.

| Scope | Allows |
|---|---|
| `loads.read` | List loads, read one load |
| `loads.write` | Create and change a load, its status, notes, stop times and assignment (carrier or own fleet) |
| `billing.read` | Adds the customer rate, final rate and other charges to load responses |
| `directory.read` | List and read customers, carriers, drivers, trucks and trailers; list dispatchers and facilities |
| `directory.write` | Create and change customers, carriers and facilities ([Create and update customers, carriers and facilities](/docs/tms/guides/directory-write/)). Reading them still needs `directory.read` |
| `loads.rates` | Set the customer rate and other charges on a load, set the carrier cost when assigning a carrier (never shown back), every quote action (create, read, set status, convert to a load; [Quotes](/docs/tms/guides/quotes/)), and see a load's rate documents (`RateCon`, `CarrierInvoice`); never invoices, settlements or payments. A load's rate, final rate and charge lines are shown to a key with `loads.rates` or `billing.read` |

A key belongs to one workspace and sees only that workspace's data. It stops working on the next request when it is
revoked or expires, when API access is switched off for the workspace, or when the admin who made it is no longer an
admin there. When API access is switched off, in a rare case a key can keep working for up to 5 minutes before it
stops; revoking the key itself always takes effect on the next request.
Carrier cost, carrier charges, margin and driver or dispatcher pay are never returned to a key (a `loads.rates` key may set
the carrier cost on `assign_load`, but never reads it).

## Send the key

Send the key in the `Authorization` header on every request:

```
Authorization: Bearer tms_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
```

Never put the key in a URL or query string. Keys work only under `/api/public/` and on the MCP endpoint `/mcp`; the
app's own API refuses them.
