Documentation
Audiences and Broadcasts
Import contacts, dispatch mass campaigns and respect RFC 8058 unsubscribe requirements.
1. Create an audience
An audience is a segmented contact collection. Create with POST /v1/product/audiences passing name and optional description.
create-audience.ts
2. Add contacts
Use POST /v1/product/audiences/:id/contacts to insert contacts individually. For bulk imports, make calls in chunks respecting the rate limit.
bulk-import.ts
3. Create a broadcast
Broadcasts are one-shot campaigns. Create with POST /v1/product/broadcasts passing audienceId, fromEmail, subject and templateId (or own html).
create-broadcast.ts
4. Schedule or fire
Use scheduledAt to schedule. Otherwise, just call POST /v1/product/broadcasts/:id/send to start sending immediately.
send-broadcast.ts
RFC 8058 headers
CoffeeMail automatically injects the List-Unsubscribe and List-Unsubscribe-Post: List-Unsubscribe=One-Click headers on every broadcast. You don't need to do anything.
Automatic suppression
Addresses marked as spam (email.complained) or that click the unsubscribe link are added to your organization's global suppression list.