Subject A/B testing
Test 2 to 4 subjects on a sample, then send the winner to everyone else.
An issue can carry 2 to 4 subjects, each with its own preheader if you want. A random sample of the audience receives the variants in equal parts; after a wait, the variant that did best goes to the rest. Pro plan or higher.
curl -X PATCH https://api.smartletter.ai/newsletters/$ID -H "Authorization: Bearer $SMARTLETTER_API_KEY" -H "Content-Type: application/json" \
-d '{"ab_test":{"variants":[{"subject":"3 AI tools you missed"}],"sample_pct":20,"metric":"opens","wait_hours":4,"winner_mode":"auto"}}'| Field | Meaning | Default |
|---|---|---|
variants | Alternative subjects B, C, D (1 to 3), each { subject, preheader? }. Variant A is the issue's own subject and preheader. | — |
sample_pct | Share of the audience in the sample (10–50). | 20 |
metric | opens (unique opens) or clicks (unique clicks). | opens |
wait_hours | Hours between the end of the sample and the choice (1–48). | 4 |
winner_mode | auto picks the best rate; manual waits for POST /newsletters/{id}/ab-winner. | auto |
How the send runs
- Sample: only contacts of the sample, drawn at random from the whole list (not the most engaged first), at most
sample_pctof the planned send. Variants are dealt in shuffled blocks, so they stay balanced (gap of 1 at most) across the engagement scale. A contact never gets two variants. - The safety steps of every send still apply inside the sample: warm-up pacing, the small first batch for never-emailed contacts (3 h check), automatic pauses.
- Wait: nobody new receives the issue for
wait_hours. - Choice: best rate on the sample wins; a tie goes to A. In
manualmode the send waits for your choice, and picks automatically 24 h after the wait if you do not choose. You can also choose early, during the sample or the wait. - Rest: everyone left receives the winner (also with
audience_limitand send-more). The public archive shows the winning subject.
Opens are inflated by Apple Mail Privacy Protection (it loads every email), which blurs the gap between subjects. Prefer clicks when your issue has a clear link to click, and a larger sample.
The sample needs at least 100 recipients per variant: send and schedule refuse a smaller one (422). The pre-send review checks every variant's subject and personalization tags; the test email (POST /newsletters/{id}/test) sends one email per variant.
Results
GET /newsletters/{id}/report returns ab_test: the phase, each variant's subject and totals, and the sample comparison — open and click rates, a 95 % interval, the leader and whether the gap is significant (two-proportion test, p < 0.05). The winner is picked even when the gap is not significant. Webhook email events carry variant.