Skip to main contentSkip to Content
A/B Tests

A/B Tests

A/B testing lets you compare message variants to optimize engagement.

List A/B Tests

GET /api/workspaces/{workspaceId}/abtests

Returns all A/B tests across campaigns.

Auth: Session required

Response:

[ { "id": "ab_abc123", "name": "Subject Line Test", "campaignId": "cmp_1", "winnerMetric": "OPEN_RATE", "testEndAt": "2026-02-01T00:00:00.000Z", "campaign": { "id": "cmp_1", "name": "Welcome Series" }, "variants": [ { "id": "var_1", "name": "Friendly", "weight": 50, "config": { "subject": "Hey there!" } }, { "id": "var_2", "name": "Professional", "weight": 50, "config": { "subject": "Welcome aboard" } } ] } ]

Create A/B Test

POST /api/workspaces/{workspaceId}/abtests

Auth: Session required

Request Body:

{ "campaignId": "cmp_abc123", "name": "Subject Line Test", "winnerMetric": "OPEN_RATE", "testEndAt": "2026-02-01T00:00:00.000Z", "variants": [ { "name": "Friendly", "weight": 50, "config": { "subject": "Hey there!" } }, { "name": "Professional", "weight": 50, "config": { "subject": "Welcome aboard" } } ] }
FieldTypeRequiredDescription
campaignIdstringYesCampaign to test
namestringYesTest name
winnerMetricstringYesOPEN_RATE, CLICK_RATE, CONVERSION, REVENUE
testEndAtstringNoWhen the test ends and winner is selected
variantsarrayYes2–5 variants, weights must total 100

Variant Structure

FieldTypeRequiredDescription
namestringYesVariant name
weightnumberYesTraffic percentage (all must sum to 100)
configobjectYesVariant-specific configuration

What You Can Test

DimensionConfig KeyExample
Subject linessubjectDifferent email subjects
Message bodybodyDifferent content/layouts
Send timesendAtMorning vs. evening
ChannelchannelEmail vs. push vs. Telegram
TemplatetemplateIdDifferent templates

Winner Selection

The winner is automatically selected based on the chosen metric after testEndAt:

  • OPEN_RATE — Highest open rate wins
  • CLICK_RATE — Highest click-through rate wins
  • CONVERSION — Highest conversion event count wins
  • REVENUE — Highest attributed revenue wins (if revenue events are tracked)
Last updated on