Campaigns

Send one-off marketing campaigns (Resend broadcasts) to lists and segments through Amazon SES, schedule, pause, resume or cancel them, and track per-recipient delivery stats.

A campaign is a one-off send to an audience: newsletters, launches, announcements. Resend calls them broadcasts, and /broadcasts works on Stamp0 with Resend's request and response shapes (see Resend aliases).

Create a campaign

curl https://api.stamp0.com/campaigns \
  -H "Authorization: Bearer $STAMP0_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "October update",
    "from": "Acme <news@acme.co>",
    "subject": "What shipped in October",
    "preheader": "Templates, sequences and a new dashboard",
    "template_id": "tpl_…",
    "list_ids": ["lst_…"],
    "segment_id": "seg_…",
    "preference_list_id": "lst_…"
  }'

Content is either a template_id (its latest published version is pinned when sending starts) or inline html/text with merge tags, not both. The template's from, subject and preheader are used where the campaign does not set its own.

Audience is everyone subscribed to any of list_ids (up to 50), plus everyone matching segment_id, each contact once. Then Stamp0 removes:

  • contacts who unsubscribed from all marketing email;
  • contacts who opted out of any of the campaign's lists;
  • addresses on the SES suppression list of the sending account;
  • with preference_list_id (a public list), contacts who opted out of it; and if that list is opt_in, contacts who never subscribed to it.

preference_list_id is the "topic" of the campaign: its unsubscribe link then opts the recipient out of that list only, and they keep getting your other email. Without it, the link unsubscribes them from all marketing email of the project.

Drafts can be changed with PATCH and deleted; POST /campaigns/:id/duplicate copies one into a new draft.

Test

POST /campaigns/:id/test sends the rendered campaign to up to 5 addresses as transactional email, with merge tags filled from contact when you pass one. The unsubscribe link in a test is a placeholder.

Send or schedule

curl -X POST https://api.stamp0.com/campaigns/cmp_…/send \
  -H "Authorization: Bearer $STAMP0_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "scheduled_at": "tomorrow at 9am" }'

Without scheduled_at it sends now. scheduled_at takes ISO 8601 with an offset or natural language (read in UTC), up to 30 days ahead. Sending needs a from on a verified domain of the project, a subject, content, an audience, a connected AWS account and the project's physical address.

When sending starts, Stamp0 snapshots the audience into the campaign's recipients, then sends at your SES account's rate, keeping headroom for transactional email: bulk sending leaves 10% of the SES daily quota free, and 20% of the per-second rate when the account allows 5 or more emails a second. Each recipient is checked again right before their email goes out, so someone who unsubscribes mid-send is skipped. Nobody is sent twice, even after a restart.

StatusMeaning
draftEditable
scheduledWaiting for scheduled_at
sendingRecipients are being sent
pausedStopped by you, or by Stamp0 with a reason in last_error
sentEvery recipient was handled
canceledStopped for good
  • POST /campaigns/:id/pause stops after the email in flight; /resume continues where it stopped.
  • POST /campaigns/:id/cancel stops a scheduled, sending or paused campaign for good.
  • If something blocks sending, the campaign pauses with last_error: physical_address_missing, domain_not_verified, domain_sending_disabled, connection_not_ready, segment_invalid, content_missing, marketing_send_quota_exceeded or provider_not_configured. Fix it and resume.

Results

GET /campaigns/:id carries stats: recipients, sent, delivered, opened, clicked, bounced, complained, unsubscribed, failed and skipped, rolled up from SES events every few minutes. Opens and clicks are unique per recipient and need tracking on for the sending domain.

GET /campaigns/:id/recipients lists the snapshot with each recipient's status (pending, queued, sent, delivered, bounced, complained, failed or skipped), skip_reason (unsubscribed, list_opted_out, suppressed, invalid_email, consent_pending for a form signup that is not confirmed yet, email_changed when the contact's address changed after the audience was resolved) and email_id. Each sent recipient is a normal email: its events appear in the activity log and reach your webhooks.

Reference: Campaigns, Broadcasts.

On this page