Mail merge

Send up to 100 personalized messages in one call, each rendered and queued for its own recipient.

A mail merge sends one message per recipient in one call. Use it for bulk or personalized mail; for a single message, use a send.

  • Up to 100 entries per call.
  • Each entry becomes its own outbox entry, addressed to its to alone and rendered with its own params (see Templates).
  • Because every recipient gets their own message, tracking numbers are per recipient.

Send a merge

curl -X POST "https://api.workwae.com/v1/accounts/$ACCOUNT_ID/mail-merges" \
  -H "Authorization: Bearer $WORKWAE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
  "template": "'"$TEMPLATE_ID"'",
  "listId": "weekly-news",
  "entries": [
    { "to": { "name": "Ada", "address": "ada@example.com" }, "params": { "firstName": "Ada" } },
    { "to": { "name": "Alan", "address": "alan@example.com" }, "params": { "firstName": "Alan" } }
  ]
}'

Request body

  • The body takes a send's fields except to, cc, bcc and render.
  • entries[].to is a single { name?, address }; entries[].params are its template values.
  • An entry may override sendAt or set its own RFC 5322 messageId.
  • listId names a suppression list: suppressed addresses are skipped and each message gets its own unsubscribe link.

Results

An entry that cannot be queued fails alone. The call returns 200 with one result per entry, in request order.

for (const result of items) {
  if (result.success) console.log(result.to.address, "queued as", result.outboxId);
  else console.warn(result.to.address, result.reason, result.error);
}

A failed entry's reason is one of the API's reasons (invalid_recipient, suppressed, template_render_failed, plan_limit_sends, ...) with the HTTP status a single send would have returned. Queued entries then follow the normal delivery events.

The merge object

The call stores the merge as an object, and its answer carries its id next to items. id is null when no entry was queued. Every entry it queued carries that id as mailMergeId (on outbox entries and in send.cancelled events), and reference is the send's reference.

{
  "id": "0198a2c4-7d51-7f0e-9b3a-5c1e8d2f4a60",
  "accountId": "6f1c2a4e-8b3d-4e5f-9a7b-1c2d3e4f5a6b",
  "reference": "weekly-news-42",
  "entryCount": 2,
  "createdAt": "2026-05-04T09:30:00.000Z",
  "counts": { "queued": 0, "sending": 0, "sent": 2, "failed": 0, "cancelled": 0 }
}
  • entryCount is the entries the call queued; refused entries are not counted.
  • counts is how many of its entries are in each outbox status now. An entry the outbox has deleted is no longer counted.
  • A merge is kept as long as any of its entries is in the outbox, so it goes with the last of them.
# One merge, with its counts
curl "https://api.workwae.com/v1/accounts/$ACCOUNT_ID/mail-merges/$MAIL_MERGE_ID" \
  -H "Authorization: Bearer $WORKWAE_API_KEY"

# The account's merges, newest first (limit, cursor)
curl "https://api.workwae.com/v1/accounts/$ACCOUNT_ID/mail-merges?limit=20" \
  -H "Authorization: Bearer $WORKWAE_API_KEY"

get and list need the read scope. An unknown merge answers 404 mail_merge_not_found.

Cancel a merge

POST .../mail-merges/{mailMergeId}/cancel cancels every entry that is still queued, in one statement, with the rules of cancelling a single send: the sealed message is dropped and the status becomes cancelled. It needs the send scope and returns { "cancelled": n }.

  • Entries being sent, sent, failed or already cancelled are left alone, so a merge that is already underway cancels only what has not started. cancelled is 0 when nothing was left; the call still succeeds.
  • Each cancelled entry emits a send.cancelled event with the merge's mailMergeId.
curl -X POST "https://api.workwae.com/v1/accounts/$ACCOUNT_ID/mail-merges/$MAIL_MERGE_ID/cancel" \
  -H "Authorization: Bearer $WORKWAE_API_KEY"

On this page