Misar Docs
MisarMailMisar.BlogMisarReachMisarPostMisar.DevMisar PlatformMisar IdentityMisar Posts API
Api Reference

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

GET/mail/v1/ab-tests

List 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

POST/mail/v1/ab-tests

Create an A/B test tied to an existing campaign. The campaign must be in draft status.

Request body

campaign_idstringbodyrequired

Campaign to test — must be in draft status.

variantsarraybodyrequired

2–5 variants; each overrides campaign fields.

test_size_percentnumberbodyrequired

Percentage of audience for the test (e.g. 20 = 20%).

metricstringbodyrequired

Success 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: false

Automatically send winner when test concludes.

auto_send_after_hoursnumberbodydefault: 24

Hours to wait before picking a winner.

Variant fields (each overrides the base campaign for that variant's send)

namestringbody

Display name for reporting.

subjectstringbody

Override subject line — supports merge tags.

body_htmlstringbody

Override HTML body.

body_textstringbody

Override plain text body.

from_namestringbody

Override sender display name.

Response fields

successboolean

true when the test was created.

ab_testobject

The 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

GET/mail/v1/ab-tests/:id

Get current test results per variant.

Path parameters

idstringpathrequired

ID of the A/B test.

Response fields

successboolean

true when the request succeeded.

ab_testobject

Test 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

POST/mail/v1/ab-tests/:id/winner

Manually 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

idstringpathrequired

ID of the A/B test.

Request body

variant_idstringbodyrequired

ID of the winning variant to send.

Response fields

successboolean

true when the winner was sent.

winner_variant_idstring

ID of the variant chosen as the winner.

remaining_sendsnumber

Number of recipients the winner is sent to.

campaign_idstring

Parent campaign ID.

statusstring

Campaign 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

StatusMeaning
draftCreated but not yet launched
runningTest variants are being sent and measured
concludedMeasurement period ended — awaiting winner selection
completedWinner sent to remaining audience
canceledTest stopped before completion