# Quick start

> Source: https://developers.anymail.watch/quick-start/

After this page you have a working token and a successful call to the API. You need an anymail workspace and access to its settings.

## 1. Generate a token

1. In the app, open **Settings**, then **Integrations**, then the **API keys** tab.
2. In the **API tokens** section, type a name that says what the token is for, for example `Zapier`.
3. Pick the **Access**: **Read only** for a first look, **Read & write** to create and change data.
4. Select **Generate token**.
5. Copy the token. It starts with `sgn_` and the app shows it once. anymail stores only a hash of it.

If you lose a token, revoke it in the same list and generate a new one.

## 2. Store the token

Keep the token in an environment variable so it stays out of your shell history and your code.

```bash
export ANYMAIL_TOKEN="sgn_…"
```

## 3. Make the first call

List the campaigns in the workspace.

```bash
curl "https://app.anymail.watch/api/v1/campaigns?limit=2" \
  -H "Authorization: Bearer $ANYMAIL_TOKEN"
```

The response is `200` with a JSON body.

```json
{
  "data": [
    {
      "id": "3f2b1c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
      "name": "Q3 outbound",
      "status": "active",
      "display_status": "running",
      "pause_reason": null,
      "campaign_type": "outbound",
      "folder": { "id": "8d1c0e2a-7b3f-4c5d-9e6a-1f2b3c4d5e6f", "name": "Sales" },
      "steps": 4,
      "progress": { "planned": 400, "done": 312, "enrolled": 100, "finished": 61, "pct": 78 },
      "created_at": "2026-08-10T09:00:00.000+00:00",
      "started_at": "2026-08-11T07:30:00.000+00:00",
      "archived_at": null
    }
  ],
  "next_cursor": null
}
```

`next_cursor` is `null` when there is no further page.

## 4. Create a prospect

```bash
curl -X POST "https://app.anymail.watch/api/v1/prospects" \
  -H "Authorization: Bearer $ANYMAIL_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"email":"ada@example.com","first_name":"Ada","company_name":"Example Ltd"}'
```

The response is `201`.

```json
{
  "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
  "email": "ada@example.com",
  "company_id": "1b4e28ba-2fa1-11d2-883f-0016d3cca427"
}
```

## If the call fails

| Status | Meaning |
|---|---|
| `401` | The header is missing or the token is invalid or revoked. See [Authentication](/authentication/). |
| `400` | A parameter or the body is invalid. The `error` field names the field. See [Errors](/errors/). |
| `429` | You sent more than 60 requests in a minute. Wait for `Retry-After` seconds. See [Rate limits](/rate-limits/). |

## Related

- [Authentication](/authentication/)
- [Prospects](/prospects/)
- [Idempotency keys](/idempotency-keys/)
