Me Send DocsDashboard

Contacts, broadcasts, templates and automations

The audience features are short summaries here. Every call, field and response is in the API reference. All of them need a full-access key.

Contacts, segments, topics and properties

Each contact change fires a contact.* webhook. Every list endpoint pages with limit (1 to 100, default 20), after and before.

Templates

A template is HTML with {{{VARIABLE}}} placeholders. {{{VARIABLE|fallback}}} gives a default. Values are escaped in the HTML part. Create one, edit it, then publish it: a send always uses the latest published version, and POST /templates/:id/publish makes a new version. POST /templates/:id/duplicate copies one.

Send with a template by naming it instead of giving html or text:

await resend.emails.send({
  from: 'Acme <hello@yourdomain.com>',
  to: ['ann@example.com'],
  template: { id: 'welcome', variables: { NAME: 'Ann' } },
});

id is the template's id or alias. Your own from, subject and reply_to win over the template's. A variable with no fallback that you leave out answers 422 validation_error; sending html or text together with template does too.

Broadcasts

A broadcast sends one email to every contact of a segment, optionally limited to a topic.

  1. POST /broadcasts with segment_id, from, subject, and html or text. Add "send": true to send at once, and scheduled_at with it to send later.
  2. Or leave it a draft, edit it with PATCH /broadcasts/:id, then POST /broadcasts/:id/send (with an optional scheduled_at).
  3. POST /broadcasts/:id/cancel stops a queued or scheduled one. GET /broadcasts/:id/recipients and GET /broadcasts/:id/clicked-links report on it.

Contacts who unsubscribed or opted out of the topic are skipped, and so are suppressed addresses. Put {{{RESEND_UNSUBSCRIBE_URL}}} in your HTML or text where each contact's unsubscribe link belongs ({{{EMAIL}}}, {{{FIRST_NAME}}} and {{{LAST_NAME}}} work too); every message also carries the List-Unsubscribe headers. A broadcast can only leave from a domain the operator has enabled for broadcasts, so newsletter complaints stay away from your transactional domain. Sending goes out in batches of 20 contacts and respects your caps: when a cap is hit the batch waits.

Automations

An automation is a graph of steps that starts when you send an event. POST /events defines an event name (with an optional typed schema), and POST /events/send records one for a contact, which starts every enabled automation that listens for it.

A graph has exactly one trigger step, up to 50 steps in all, and no loops. Step types are trigger, delay, send_email, wait_for_event, condition, contact_update, contact_delete and add_to_segment, joined by connections (default, condition_met, condition_not_met, event_received, timeout). POST /automations/:id/stop stops new runs (a run under way finishes), GET /automations/:id/runs lists its runs, and POST /automations/:id/runs/:run_id/cancel cancels a run. An email step is sent once per run even if the step is retried.