# Errors

A failed call answers with a status code and a JSON body:

```json
{ "error": "entity_ids must be a non-empty array" }
```

Some carry a `code` too:

| `code` | Means |
|---|---|
| `bad_project` | `X-Entayo-Project` is not a project id. |
| `project_not_found` | That project is not one of yours. |
| `project_required` | A Zocton key made for chosen projects must name one with `X-Entayo-Project`. |
| `project_not_allowed` | The Zocton key was not given this project. |
| `insufficient_scope` | A read-only Zocton key tried to change something. |
| `forbidden_for_api_key` | Zocton keys never reach this endpoint (API keys). |
| `team_forbidden` | Your team access does not allow it. |

| Status | Means | Do |
|---|---|---|
| `200` / `201` | Done. `201` = something was created. | — |
| `400` | Something in the request is missing or wrong. | Read `error`, fix the request. |
| `401` | No key, a wrong key or a revoked key. | Check the key and the data centre. |
| `403` | Not allowed for this account or this key. | Read `code`. |
| `404` | Not found **in this project** — or `X-Entayo-Project` is not yours. | Check the id and the project. |
| `409` | Clashes with what is there — a name already taken, a campaign already sent. | Change the name, or leave it. |
| `410` | Not done here any more — senders are managed on the Zocton Dashboard. | Use the Dashboard. |
| `500` | Our fault. | Try again; tell us if it keeps happening. |

## Good to know

- **Ids** are positive whole numbers. A person or company has a **master id**
  (`id`) and a **record id** (`entity_id`) — the reference says which one each
  endpoint takes.
- **Deletes cannot be undone.** Deleting a record also deletes its activity
  and tasks.
- **Big jobs:** keep pages to `limit=1000` or less, and send imports in chunks
  of a few hundred rows.
