# Broadcasts

A broadcast is one email to the people on your [lists](https://docs.groundmail.dev/contacts#lists): a product update, a changelog, a newsletter. It goes out on the newsletter stream, on IPs shared with product mail and separate from your sign-in codes and receipts, so a big send never slows them down or hurts their delivery. Each contact gets it once, however many of its lists they're on, and anyone who unsubscribed, bounced or complained is left out.

In the dashboard: **Broadcasts**.

Base URL: `https://api.groundmail.dev`

Auth:

```http
Authorization: Bearer gm_...
```

Listing and reading broadcasts needs the `broadcasts:read` scope. Creating, editing, testing, sending, scheduling, pausing and cancelling needs `broadcasts:write`, which includes `broadcasts:read` and can read contacts and lists too.

---

## Before your first broadcast

- **Newsletter sending approved** for your workspace. Opt-in newsletter email is accepted only for workspaces we approve; to ask, email support@groundmail.dev. Until then, sending answers `403` [`newsletter_not_enabled`](https://docs.groundmail.dev/errors#newsletter_not_enabled). You can build lists and drafts in the meantime.
- **A verified domain** to send from. The shared sandbox address can't send broadcasts.
- **Your mailing address** in your [brand](https://docs.groundmail.dev/brand). Marketing email must show where you are; it's added at the bottom of each broadcast that doesn't show it already.
- **A list of contacts** who agreed to hear from you. See [Contacts and lists](https://docs.groundmail.dev/contacts).

Cold email and mail to bought or scraped lists are never allowed.

## Create, check and send

```ts
const draft = await groundmail.broadcasts.create({
  name: 'December update',
  lists: ['newsletter'],
  from: 'Acme <news@mail.acme.dev>',
  subject: "What's new in December, {{contact.first_name}}",
  html: '<p>Hi {{contact.first_name}}, here is what shipped.</p><p><a href="{{unsubscribe_url}}">Unsubscribe</a></p>',
})

const audience = await groundmail.broadcasts.audience(draft.id) // { recipients: 1840, left_out: 23, ... }
await groundmail.broadcasts.test(draft.id, ['you@acme.dev'])
await groundmail.broadcasts.send(draft.id) // or { scheduled_at: '2026-12-02T09:00:00Z' }
```

```bash
groundmail broadcasts create --name "December update" --lists newsletter \
  --from "Acme <news@mail.acme.dev>" --subject "What's new in December" --html-file december.html
groundmail broadcasts audience <id>
groundmail broadcasts test <id> --to you@acme.dev
groundmail broadcasts send <id> --yes
```

A draft can be saved half-written: only `name` is required, and everything else is checked when you send it.

| Field | |
|---|---|
| `name` | Required. Only you see it. |
| `lists` | List keys or ids, up to 20. |
| `from` | `Name <address>` on a verified domain. |
| `reply_to` | Optional. |
| `template` | A [template](https://docs.groundmail.dev/templates)'s id or alias. Its published version is used, frozen when sending starts, so publishing a new version later doesn't change a running broadcast. |
| `subject` | Required without a template. With one, it overrides the template's subject. |
| `html`, `text` | The body, when you don't use a template. Use one or both, up to 1,000,000 characters each. A request can be up to 16 MB; a larger one gets `413 validation_error`. |
| `preheader` | Preview text shown after the subject in the inbox. |

Use either `template` or `html`/`text`, not both. `PATCH /broadcasts/{id}` changes a draft (only the fields you send; `null` clears one), and `DELETE /broadcasts/{id}` deletes it. Once a broadcast has been sent or scheduled it can't be changed or deleted, only cancelled.

### Merge fields

Each recipient gets their own copy, with merge fields filled from their contact:

| Merge field | |
|---|---|
| `{{contact.first_name}}`, `{{contact.last_name}}` | Their names, or empty. |
| `{{contact.email}}` | Their address. |
| `{{contact.external_id}}` | Your id for them. |
| `{{contact.attributes.plan}}` | Any attribute. |
| `{{unsubscribe_url}}` | Their own one-click unsubscribe link. |

Values are HTML-escaped in the HTML. Every broadcast carries one-click unsubscribe headers, and an unsubscribe link is added if the body doesn't have `{{unsubscribe_url}}`.

### Preview and audience

Neither sends anything:

- `POST /broadcasts/{id}/preview` with `{ "email": "ada@example.com" }` renders the broadcast as that contact (or, without `email`, the newest contact on its lists): subject, HTML and text as they'd get them, with the mailing address added. The unsubscribe link points to `#`.
- `GET /broadcasts/{id}/audience` says how many people it would reach now (`recipients`), how many on its lists are left out (`left_out`), and whether sending now would be refused (`over_first_limit`) or wait for review (`needs_approval`).

`POST /broadcasts/{id}/test` sends it to up to 5 addresses, with `[Test]` before the subject. An address that's a contact gets its own merge fields; anyone else gets empty ones. Each address counts toward your account's send rate, the same as one email, and one broadcast can send at most 20 test emails an hour. Over either, the call answers `429` `rate_limited` with `Retry-After` and sends nothing. A test API key counts the same way. With a test API key (`gm_test_…`), each of those emails is recorded and nothing is delivered. A key limited to certain domains can only test from one of those domains.

## Sending

`POST /broadcasts/{id}/send` with no body sends now; `{ "scheduled_at": "2026-12-02T09:00:00Z" }` sends at that time, up to 30 days ahead. It answers `202`, and the broadcast's `status` says what happened:

| `status` | |
|---|---|
| `scheduled` | Waiting for `scheduled_at`. |
| `awaiting_approval` | Waiting for a quick review by our team (see below). |
| `sending` | Going out. |
| `paused` | Paused by you, or by itself (see below). |
| `sent` | Done. |
| `cancelled`, `failed` | Stopped; `failure_message` says why when it failed. |

Who it goes to is fixed when sending starts: everyone on its lists at that moment, once each, minus anyone unsubscribed, bounced or complained. Someone who unsubscribes while it's sending is skipped. A key limited to certain domains can only send from one of those; any other `from` is `403` `domain_not_allowed`, and that limit is kept for every recipient.

A broadcast started with a test API key (`gm_test_…`) follows the same path, and every recipient is a test email: it is stored with `test: true` and nothing is delivered. The broadcast's `test` field is `true`. It does not count toward the 1,000 first-broadcast limit or the 5,000-a-day review, and finishing it does not lift those limits for a later send with a live key. A test API key can't resume a live broadcast (`403` `forbidden`), since that would deliver real email. In the dashboard, switch to **Test** to see it; Live shows live broadcasts.

It goes out over the next hours as your daily newsletter limit allows, and carries on by itself the next day when it reaches the limit. While it waits, `hold` says why and `resume_at` says when it carries on. `hold.reason` `broadcasts_disabled` means sending is temporarily stopped: the broadcast stays `sending`, nothing more goes out, and it carries on by itself. `hold.reason` `content_review` means the content is under review: the broadcast stays `sending`, nothing is counted as sent, and it does not carry on by itself. Nothing more goes out until the review finishes. If the review says no, the broadcast fails and `failure_message` says so. `hold.reason` `mail_server_unavailable` means the mail server isn't taking email: no recipient is failed for it, and the broadcast tries again every few minutes on its own. Pause and cancel still work then.

When one recipient's send fails in a way worth retrying, that recipient waits before it's tried again, longer each time (1, 5, 15, then 60 minutes), and the rest keep going. It's failed only after 5 attempts, about an hour and a half after the first. `recipients` counts move as it sends:

```json
{
  "broadcast": {
    "id": "b7f2…",
    "status": "sending",
    "started_at": "2026-12-01T10:00:00.000Z",
    "hold": { "reason": "daily_ramp_limit", "message": "…", "resume_at": "2026-12-02T00:00:00.000Z" },
    "recipients": { "total": 1840, "sent": 1200, "skipped": 3, "failed": 1, "remaining": 636 }
  }
}
```

`GET /broadcasts/{id}/recipients?status=failed` lists recipients by status: `sent` (with the email's id, to look it up with [`GET /emails/{id}`](https://docs.groundmail.dev/emails)), `skipped` (with a `reason`, such as `suppressed`), `failed`, or `pending`.

### Limits

- **Your first broadcasts are small.** Until one has been delivered to at least 300 people, those results are at least a day old, and it stayed under the complaint and bounce limits, your broadcasts reach at most 1,000 people in all, counted together rather than one day at a time. A send to one address does not lift that. Sending one that would go over answers `409`.
- **Big ones get a quick review.** Above 5,000 people a day, counting your other broadcasts of the last day, a broadcast waits as `awaiting_approval` until our team approves it, usually within a working day. You can cancel it meanwhile.
- **It pauses itself if people object.** A broadcast pauses if complaints pass 0.3% or bounces pass 5%. One paused for bounces can be resumed once; one paused for complaints can't be resumed. Cancel it, remove the people who complained, and send a new one. If most of one domain's emails bounce, it stops sending to that domain and lists it in `cut_domains`.

### Pause, resume and cancel

```bash
POST /broadcasts/{id}/pause     # scheduled or sending; nothing more goes out
POST /broadcasts/{id}/resume    # carries on where it stopped. A key limited to other domains gets 403 domain_not_allowed, and resuming does not drop a limit the broadcast already has.
POST /broadcasts/{id}/cancel    # for good; emails already sent stay sent
```

## Errors

| Status | Code | When |
|---|---|---|
| `400` | `validation_error` | A field is invalid, the content isn't complete when sending, or `scheduled_at` is in the past or more than 30 days ahead. |
| `403` | `newsletter_not_enabled` | Your workspace isn't approved for newsletter sending yet. |
| `403` | `forbidden` | `from` isn't on a verified domain, or a test API key tried to resume a live broadcast. |
| `403` | `domain_not_allowed` | The API key is limited to other domains than the one in `from`. Checked when you create a broadcast, change a draft's `from`, send a test, send, and resume. The key's domains stay with the broadcast, and resuming does not drop a limit it already has. |
| `404` | `not_found` | No broadcast, list or template with that id in this workspace. |
| `409` | `conflict` | It isn't a draft any more, your brand has no mailing address, it's over the first-broadcast limit, or it can't be paused or resumed in its state. |
| `429` | `rate_limited` | A test would take the account over its send rate, or this broadcast over 20 test emails an hour. Nothing was sent. Wait for `Retry-After`. |

## In the CLI and MCP

The CLI has `groundmail broadcasts list`, `create`, `get`, `update`, `delete`, `audience`, `preview`, `test`, `send`, `pause`, `resume`, `cancel` and `recipients`. Sending and cancelling ask for `--yes`.

The [MCP server](https://docs.groundmail.dev/ai/mcp) has the same as tools, from `create_broadcast` to `send_broadcast`. Your assistant shows you the audience and offers a test before it sends.
