A/B Testing
Run split tests on email campaigns to find the best subject, content, or sender
A/B tests let you send different variants of a campaign to a subset of your audience and automatically promote the winning variant to the remainder. You choose the test metric, sample size, and duration.
Auth scope: send or send:marketing
List A/B tests
/mail/v1/ab-testsList all A/B tests for the authenticated account.
curl "https://api.misar.io/mail/v1/ab-tests?page=1&limit=20" \
-H "Authorization: Bearer msk_YOUR_API_KEY"{
"success": true,
"ab_tests": [
{
"id": "abt_abc123",
"campaign_id": "camp_xyz789",
"status": "running",
"metric": "open_rate",
"test_size_percent":20,
"variant_count": 2,
"winner_id": null,
"created_at": "2026-04-01T08:00:00Z"
}
],
"total": 4
}Create an A/B test
/mail/v1/ab-testsCreate an A/B test tied to an existing campaign. The campaign must be in draft status.
Request body
campaign_idstringbodyrequiredCampaign to test — must be in draft status.
variantsarraybodyrequired2–5 variants; each overrides campaign fields.
test_size_percentnumberbodyrequiredPercentage of audience for the test (e.g. 20 = 20%).
metricstringbodyrequiredSuccess metric — open_rate (highest unique open rate wins), click_rate (highest unique click rate wins), or reply_rate (most direct replies wins).
auto_send_winnerbooleanbodydefault: falseAutomatically send winner when test concludes.
auto_send_after_hoursnumberbodydefault: 24Hours to wait before picking a winner.
Variant fields (each overrides the base campaign for that variant's send)
namestringbodyDisplay name for reporting.
subjectstringbodyOverride subject line — supports merge tags.
body_htmlstringbodyOverride HTML body.
body_textstringbodyOverride plain text body.
from_namestringbodyOverride sender display name.
Response fields
successbooleantrue when the test was created.
ab_testobjectThe created test, including id, status, and variants (each with id, name, send_count).
curl -X POST https://api.misar.io/mail/v1/ab-tests \
-H "Authorization: Bearer msk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"campaign_id": "camp_xyz789",
"test_size_percent": 20,
"metric": "open_rate",
"auto_send_winner": true,
"auto_send_after_hours": 4,
"variants": [
{
"name": "Variant A",
"subject": "Your exclusive offer inside"
},
{
"name": "Variant B",
"subject": "{{first_name}}, we have something special for you"
}
]
}'{
"success": true,
"ab_test": {
"id": "abt_abc123",
"status": "draft",
"variants": [
{ "id": "var_1", "name": "Variant A", "send_count": 0 },
{ "id": "var_2", "name": "Variant B", "send_count": 0 }
]
}
}Get test details and results
/mail/v1/ab-tests/:idGet current test results per variant.
Path parameters
idstringpathrequiredID of the A/B test.
Response fields
successbooleantrue when the request succeeded.
ab_testobjectTest details including id, status, metric, winner_id, concludes_at, and per-variant stats (send_count, opens, clicks, open_rate, click_rate).
curl https://api.misar.io/mail/v1/ab-tests/abt_abc123 \
-H "Authorization: Bearer msk_YOUR_API_KEY"{
"success": true,
"ab_test": {
"id": "abt_abc123",
"status": "running",
"metric": "open_rate",
"variants": [
{
"id": "var_1",
"name": "Variant A",
"send_count": 500,
"opens": 180,
"clicks": 45,
"open_rate": 0.360,
"click_rate": 0.090
},
{
"id": "var_2",
"name": "Variant B",
"send_count": 500,
"opens": 215,
"clicks": 62,
"open_rate": 0.430,
"click_rate": 0.124
}
],
"winner_id": null,
"concludes_at":"2026-04-06T12:00:00Z"
}
}Pick and send the winning variant
/mail/v1/ab-tests/:id/winnerManually pick the winning variant and send it to the remainder of the audience. Call this before auto_send_after_hours to override the automatic selection.
Path parameters
idstringpathrequiredID of the A/B test.
Request body
variant_idstringbodyrequiredID of the winning variant to send.
Response fields
successbooleantrue when the winner was sent.
winner_variant_idstringID of the variant chosen as the winner.
remaining_sendsnumberNumber of recipients the winner is sent to.
campaign_idstringParent campaign ID.
statusstringCampaign send status.
curl -X POST https://api.misar.io/mail/v1/ab-tests/abt_abc123/winner \
-H "Authorization: Bearer msk_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "variant_id": "var_2" }'{
"success": true,
"winner_variant_id":"var_2",
"remaining_sends": 4000,
"campaign_id": "camp_xyz789",
"status": "sending"
}Once a winner is sent, the A/B test status changes to completed. The winning variant's stats are merged into the parent campaign's analytics.
A/B Test Status Values
| Status | Meaning |
|---|---|
draft | Created but not yet launched |
running | Test variants are being sent and measured |
concluded | Measurement period ended — awaiting winner selection |
completed | Winner sent to remaining audience |
canceled | Test stopped before completion |