# Authentication

Every call carries an **API key** in the `Authorization` header:

```http
Authorization: Bearer zk_…
```

## Which key

| | Zocton API key | Entayo CRM API key |
|---|---|---|
| Looks like | `zk_…` | `entayo_…` |
| Made on | Zocton Dashboard → **API Keys** | Entayo CRM → **Settings → API Keys** |
| Works in | Every Zocton app it is given | Entayo CRM only |
| Access | Read only, or read and change | Read and change |
| Projects | Every project, or only the ones you choose | Every project |
| Revoked on | The Zocton Dashboard | Entayo CRM, or `DELETE /api-keys/{id}` |

Use a **Zocton API key** when you can — one key for all your Zocton apps, and you
can limit it. More in [API keys](https://www.zocton.com/docs/shared/api-keys).

## Make a Zocton API key

1. Open the Zocton Dashboard → **API Keys**.
2. Make a key with access to Entayo CRM — read only, or read and change — for every
   project or only chosen ones.
3. **Copy the key now.** It cannot be shown again.

Open Entayo CRM once yourself before you use the key: it acts as your own CRM
account, and is refused until that exists.

## Make an Entayo CRM API key

1. Open Entayo CRM → **Settings → API Keys**.
2. Under **Create New Key**, give it a name (where you will use it, e.g. `Zapier`)
   and press **+ Create**.
3. **Copy the key now.** Only a short prefix is kept after this; the full key
   cannot be shown again.

## What a key can do

- A key acts **as you** — the same records and the same refusals as on the
  CRM's screens. It sees only your account.
- It works in your **Default** project unless you name another — see
  [Projects](https://www.zocton.com/docs/developers/entayo-crm/projects).
- It works only in **your data centre**. A key from `eu` is refused on `apac`.
- A **read-only** Zocton key may only use `GET`. Anything else is `403`
  `insufficient_scope`.
- A Zocton key **for chosen projects** must name its project with
  `X-Entayo-Project` on every call. `GET /key-projects` lists the projects it may
  use.
- A Zocton key never reaches the **API keys** endpoints (`403`
  `forbidden_for_api_key`).

## Keep it safe

- Treat it like a password. Never put it in a web page, a public repository or
  a shared document.
- Use one key per tool, so you can revoke one without breaking the others.
- **Revoke** a key you no longer use, or one that may have leaked. It stops working
  at once.

## The address

Always call your **data centre** address:

| Data centre | API address |
|---|---|
| Asia Pacific | `https://apac.zocton.com/entayo-crm/api` |
| Europe | `https://eu.zocton.com/entayo-crm/api` |
| North America | `https://na.zocton.com/entayo-crm/api` |

Not your workspace address (`<you>.zocton.com`) — that one is for the web
pages.

## A wrong or missing key

The answer is `401` with `{"error":"Not authenticated"}`. Check the key was
copied whole, that it is not revoked, and that you are on your own data
centre.
