Send a broadcast
Start a draft broadcast now, or schedule it for later.
/v1/broadcasts/{id}/sendAPI keyMoves a draft broadcast to sending, or to scheduled when you pass scheduledAt. The response comes back straight away; the emails go out in the background.
How sending works
The mailer's cron runs every 5 minutes. On each run it:
- Moves
scheduledbroadcasts whosescheduledAthas passed tosending. - Takes up to 10
sendingbroadcasts and, for each one, the next 100 contacts in the audience. - Skips contacts that are unsubscribed or on the suppression list.
- Sends every other contact their own email, rendered with the per-contact variables.
- Marks the broadcast
sentonce a run finds fewer than 100 contacts left.
So a broadcast to 500 contacts takes about five cron runs, around 25 minutes. The first emails go out on the next run after this call, up to 5 minutes later.
Each email:
- goes through the same path as Send an email, so it counts toward the project's rate limit and daily limit;
- has the tag
broadcast_idset to the broadcast ID; - has the idempotency key
bc:<broadcast id>:<contact id>, so a contact never gets the same broadcast twice; - has
List-UnsubscribeandList-Unsubscribe-Post: List-Unsubscribe=One-Clickheaders when the mailer has aTRACKING_SECRET. See Unsubscribe.
If a send hits a rate limit, the run stops there and the next run picks up from the same contact. Any other error on one contact is logged and that contact is skipped.
Always live
Broadcasts always send real email, even when you call this endpoint with an fs_test_ key. Test keys only change what POST /v1/emails does.
Path parameters
The broadcast ID.
Body parameters
The body is optional.
An ISO 8601 date-time with a time zone offset, in the future and at most 30 days ahead. The broadcast starts on the first cron run at or after this time.
Response
The broadcast with counts, as in Retrieve a broadcast. status is sending or scheduled. total is the number of subscribed contacts in the audience right now; suppressed contacts are still in this number and are skipped later.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_body | The body is not valid JSON, or the audience has no subscribed contacts. |
| 400 | invalid_schedule | scheduledAt is not a valid date, is in the past, or is more than 30 days ahead. |
| 400 | too_many_recipients | The audience has more subscribed contacts than BROADCAST_MAX_RECIPIENTS (default 500). |
| 403 | broadcasts_disabled | The project doesn't have broadcasts enabled. |
| 404 | broadcast_not_found | No broadcast with that ID in this project. |
| 409 | broadcast_not_draft | The broadcast was already started, sent or canceled. |