These routes complement contacts and broadcasts. Like them, they require a full_access key (except API signups, open to sending_access keys and to the browser): an application key manages the newsletter of its domains (add ?domain= if it covers several). Newsletters belong to the domain: a personal key gets 401 restricted_api_key. An object outside this scope responds 404.
| Resource | For |
|---|---|
/newsletter/settings, /newsletter/overview | settings and overview |
/forms, /forms/{id}/signups, /forms/{id}/preview, /forms/{id}/rotate-key, /newsletter/default-form | signup forms, default signup page |
/newsletter/subscribe, /newsletter/unsubscribe, /newsletter/subscriptions/{email}, /newsletter/public/{public_key}/… | subscribing and unsubscribing from your application: signup form, unsubscribing |
/newsletter/preferences-page/preview, preferences_page in the settings | default preferences page |
/broadcasts/{id}/schedule, send-now, /broadcasts/scheduled, /broadcasts/{id}/check | broadcast scheduling |
/segments with filter, /segments/preview | dynamic segments |
/broadcasts/{id}/links, domains, timeline, export | detailed statistics |
ab of a broadcast, /broadcasts/{id}/ab/winner | A/B testing |
/newsletter-templates | templates |
/automations, /automations/{id}/runs, /events | automations |
/contacts/cleanup | inactive contact cleanup |
Settings
GET and PATCH /api/v1/newsletter/settings: the sender, the reply-to address and the postal address of the scope. null clears a field.
{
"object": "newsletter_settings",
"domain": "example.com",
"from": "Acme <news@example.com>",
"reply_to": "contact@example.com",
"postal_address": "Acme\n12 Lilac Street\nSpringfield",
"missing": [],
"updated_at": "2026-11-12T09:00:00Z"
}fromfollows the rules of a broadcast: an address of the domain.postal_address: at most 300 characters and 5 lines. The law requires it in commercial emails in many countries:POST /broadcasts/{id}/sendrequires it (422 validation_error, message starting withpostal_address, otherwise).missinglists what is missing to send (from,postal_address).- A broadcast created without
fromorreply_totakes those of the settings: through the API,fromcan therefore be omitted.
Variables available in addition to those of broadcasts:
| Variable | Value |
|---|---|
{{ postal_address }} (or {{{VOAARO_POSTAL_ADDRESS}}}) | the postal address; in HTML, each line breaks. Missing from the content, it is added to the footer |
{{ preferences_url }} (or {{{VOAARO_PREFERENCES_URL}}}) | the contact's preferences page: their name, their topics, unsubscribing |
{{ view_url }} (or {{{VOAARO_VIEW_URL}}}) | the broadcast in the browser, as the contact received it, without pixel or tracked link |
preferences_page customizes the default preferences page (title, text, colors, image, language).
PATCH with { "archive": true } opens the scope's public archive: archive_url lists the sent broadcasts marked archived: true (a field that can be changed even after sending), shown without contact data. { "archive": false } closes it.
Overview
GET /api/v1/newsletter/overview?days=30 (1 to 366 days) gives, for the period:
contacts:total,subscribed,unsubscribed,new,lost,growth,segments,topics;series: one point per UTC day (day,new,unsubscribed,subscribersat the end of the day);campaigns: number of broadcasts, recipients, delivered, opened, clicked, bounces, complaints, unsubscribes, and the rates in percent (nullwithout a denominator; opens and clicks on the broadcasts whose key has tracking enabled);recentandscheduled: the last 5 broadcasts sent and the next 5 scheduled.
Signup forms
A form gives a hosted page (url, https://mail.example.com/n/<id>) and an embed code (embed_html) for your site. It puts signups into segments and offers them topics.
| Method | Path | Response |
|---|---|---|
POST | /api/v1/forms | 201 { object: "form", id, url } |
GET | /api/v1/forms | list, status filter (without embed_html) |
GET, PATCH | /api/v1/forms/{id} | the full form, with counts and embed_html |
DELETE | /api/v1/forms/{id} | { object: "form", id, deleted: true }; the contacts stay |
GET | /api/v1/forms/{id}/signups | signups, status filter (pending, confirmed), 50 per page without limit |
curl https://mail.example.com/api/v1/forms \
-H "Authorization: Bearer $VOAARO_API_KEY" -H "Content-Type: application/json" \
-d '{
"name": "Website newsletter",
"segment_ids": ["…"],
"fields": [{"key": "first_name", "label": "First name", "required": true}],
"title": "The Acme newsletter",
"consent_text": "I agree to receive the Acme newsletter.",
"language": "en"
}'| Field | Rule |
|---|---|
name | required, 100 characters |
status | active (default) or disabled |
double_opt_in | true by default: the subscriber confirms through a link received by email |
segment_ids, topic_ids | segments to put signups into; topics offered as checkboxes |
fields | at most 10, { key, label, required }; key: first_name, last_name or a declared property |
title, description, button_label, success_message | page texts (150, 1,000, 50 and 500 characters) |
consent_text | when filled, it adds a required checkbox (1,000 characters) |
redirect_url | page of your site to return to after signing up (?status=pending or subscribed) |
language | fr, en, es, it, ru, zh-CN, de: language of the page and of the confirmation email |
accent_color, background_color | #rrggbb (background: #f6f6f7 by default) |
image_url | header image: https:// or a base64-embedded image (PNG, JPEG, GIF, WebP, 200 KB), never SVG |
allowed_origins, require_challenge | allowed origins and proof of work of the browser API |
is_default, public_key | read only: the domain's default form, public key mlk_pub_… (POST /api/v1/forms/{id}/rotate-key changes it) |
50 forms per scope. Double opt-in requires a sender in the settings (422 otherwise): it sends the confirmation email, valid for 7 days.
- Anti-bot: proof of work computed by the browser, invisible honeypot field, 20 signups per hour per IP address; at most one confirmation email per address per 24 hours across all the domain's forms, and 3 at most across the whole instance (beyond that, same response, no email).
- On confirmation (or right away without double opt-in): the contact is created or updated, resubscribed if they had unsubscribed (it is an explicit request), put into the segments, subscribed to the checked topics. The consent (text, date, IP address, browser) is kept on the signup and on the contact.
- A signup:
{ id, email, status: "pending" | "confirmed" | "expired", contact_id, created_at, confirmed_at, consent, data }. - Webhooks:
form.submittedandform.confirmed, and the subscription webhookscontact.subscribed,contact.confirmed. - Default form, preview (
POST /api/v1/forms/{id}/preview): default signup page. Your own form, from your server or the browser: Your own signup form.
Dynamic segments
A segment holds either a list of members, or conditions (filter), evaluated on each read and frozen when a broadcast starts. POST /api/v1/segments with { name, filter }; PATCH changes the filter of a dynamic segment (a list does not become dynamic: 409). Adding or removing a contact by hand from a dynamic segment also responds 409.
{
"match": "all",
"conditions": [
{ "field": "email", "op": "ends_with", "value": "@example.com" },
{ "field": "property", "key": "age", "op": "gt", "value": 30 },
{ "field": "topic", "topic_id": "…", "op": "subscribed" },
{ "field": "opened", "op": "any", "days": 30 },
{ "field": "inactive", "days": 90 }
]
}field | op and values |
|---|---|
email | contains, not_contains, equals, ends_with; value (case-insensitive) |
first_name, last_name | equals, contains (value), is_set, is_not_set |
property | key (declared property); equals, not_equals, contains, gt, lt (number property), is_set, is_not_set |
topic | topic_id; subscribed, not_subscribed |
segment | segment_id (a list); in, not_in |
created_at | within_days, older_than_days; days (1 to 3,650) |
opened, clicked | any, none; optional days and broadcast_id |
inactive | days: signed up more than N days ago, no open or click for N days |
form | form_id: signed up through this form |
unsubscribed | boolean value |
match: all (every condition) or any (at least one); 1 to 20 conditions. A malformed condition responds 422, message filter : condition <n> : …. POST /api/v1/segments/preview with { filter } counts the targeted contacts and shows 10 of them, without creating anything.
Detailed statistics
Every open and every click of a broadcast message (tracking enabled on the key) is kept on the recipient and per link: these figures survive the log purge (30 days). A click also counts as an open (images blocked).
| Route | Response |
|---|---|
GET /api/v1/broadcasts/{id}/links | { url, clicks, unique_clicks } per link, from most to least clicked |
GET /api/v1/broadcasts/{id}/domains | results per recipient domain (the 50 largest): recipients, delivered, opened, clicked, bounced, complained, unsubscribed |
GET /api/v1/broadcasts/{id}/timeline?hours=48 | first opens and first clicks per hour since the start (1 to 720 hours) |
GET /api/v1/broadcasts/{id}/export | UTF-8 CSV with one row per recipient: status, dates, number of opens and clicks, unsubscribe |
A/B testing
The ab field of a broadcast (at creation, or through PATCH while it is a draft or scheduled; null removes it) tries up to three versions on a sample, then sends the best one to the others:
{
"variants": [{ "subject": "Subject B" }],
"sample_pct": 20,
"metric": "opened",
"wait_minutes": 240
}- The broadcast itself is variant
a;variantsadds one or two, each changing at least the subject, the sender, the preview (preview_text) or the content (html,text). sample_pct: 5 to 50% of the recipients (20 by default), drawn at random; the others wait (stats.held).- After
wait_minutes(1 to 10,080, 240 by default), the variant with the bestmetricrate (openedorclicked, on delivered messages) goes to the others; on a tie,a. POST /api/v1/broadcasts/{id}/ab/winnerwith{ "variant": "b" }chooses without waiting (409if the test has not started or the winner is already chosen).- When read,
abalso carrieswinner,decided_at,decided_by(autoormanual) andresultsper variant.
Templates
/api/v1/newsletter-templates keeps ready-to-use contents: POST with { name, subject?, preview_text?, html?, text? }, or { broadcast_id, name? } to save a broadcast as a template; GET, PATCH, DELETE on /{id}. 100 templates per scope.
POST /api/v1/broadcasts accepts template_id: the template's subject, preview, HTML and text fill the fields you do not give.
Automations
An automation sends a sequence of emails to each contact who meets a starting condition: welcome, follow-up, signup anniversary…
curl https://mail.example.com/api/v1/automations \
-H "Authorization: Bearer $VOAARO_API_KEY" -H "Content-Type: application/json" \
-d '{
"name": "Welcome",
"status": "active",
"trigger": {"type": "contact.created"},
"steps": [
{"type": "email", "subject": "Welcome {{{contact.first_name|}}}", "html": "<p>Thanks for signing up.</p>"},
{"type": "wait", "minutes": 1440},
{"type": "condition", "filter": {"match": "all", "conditions": [{"field": "opened", "op": "none"}]}},
{"type": "email", "subject": "Did you miss it?", "text": "…"}
]
}'Trigger (trigger.type) | Starts when |
|---|---|
contact.created | a contact is created (not unsubscribed) |
segment.added | a contact enters the segment segment_id (a list) |
topic.subscribed | a contact subscribes to the topic topic_id |
form.confirmed | a signup to the form form_id is confirmed |
event | your application sends the event named event (see below) |
- Steps (at most 20):
email(subject,htmland ortext, optionalfrom: the settings' sender otherwise; same variables as a broadcast, footer with postal address and unsubscribe);wait(minutes, up to one year);condition(filterof a dynamic segment: when false, the run stops). - Statuses:
draft,active,paused. Activating requires the postal address, a sender and a domain ready for bulk sending (like a broadcast). Triggers count from the first activation; a pause keeps the waiting runs. - A contact goes through an automation only once. If they unsubscribe, their run stops before the next email; an address on the suppression list skips the email.
- 50 automations per scope.
GET /api/v1/automations/{id}/runs(statusfilter:active,done,stopped; 100 per page withoutlimit) shows each run, its step and its log. - The emails go through the sending API's queue, with the
automation_idandsteptags; webhooks:automation.*and the usualemail.*.
Sending an event
POST /api/v1/events with { "email" or "contact_id", "name", "data"? } starts the automations whose trigger is { "type": "event", "event": "<name>" }. name: 1 to 64 characters (letters, digits, _ . : -); data: an object of at most 16 KiB. Response 202 { object: "event", id, contact_id, name }.
curl https://mail.example.com/api/v1/events \
-H "Authorization: Bearer $VOAARO_API_KEY" -H "Content-Type: application/json" \
-d '{"email": "ada@example.org", "name": "order.paid", "data": {"amount": 42}}'Inactive contact cleanup
Writing to addresses that no longer open anything hurts deliverability. POST /api/v1/contacts/cleanup targets subscribed contacts, signed up more than days days ago, who received a tracked broadcast during that period without opening it or clicking:
| Field | Rule |
|---|---|
days | 30 to 3,650 |
action | unsubscribe (default) or delete |
dry_run | true by default: counts without changing anything |
Response: { object: "contact_cleanup", days, action, dry_run, count, sample } (10 addresses as examples). Run a simulation first, then run again with "dry_run": false. Without open tracking, inactivity cannot be measured: no contact is targeted.