FlaresendDocs
Broadcasts

Send a broadcast

Start a draft broadcast now, or schedule it for later.

POST/v1/broadcasts/{id}/sendAPI key

Moves 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:

  1. Moves scheduled broadcasts whose scheduledAt has passed to sending.
  2. Takes up to 10 sending broadcasts and, for each one, the next 100 contacts in the audience.
  3. Skips contacts that are unsubscribed or on the suppression list.
  4. Sends every other contact their own email, rendered with the per-contact variables.
  5. Marks the broadcast sent once 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_id set to the broadcast ID;
  • has the idempotency key bc:<broadcast id>:<contact id>, so a contact never gets the same broadcast twice;
  • has List-Unsubscribe and List-Unsubscribe-Post: List-Unsubscribe=One-Click headers when the mailer has a TRACKING_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

idstringpathrequired

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

StatusCodeWhen
400invalid_bodyThe body is not valid JSON, or the audience has no subscribed contacts.
400invalid_schedulescheduledAt is not a valid date, is in the past, or is more than 30 days ahead.
400too_many_recipientsThe audience has more subscribed contacts than BROADCAST_MAX_RECIPIENTS (default 500).
403broadcasts_disabledThe project doesn't have broadcasts enabled.
404broadcast_not_foundNo broadcast with that ID in this project.
409broadcast_not_draftThe broadcast was already started, sent or canceled.