A/B tests (management API)
A/B tests between landing pages on a route, or between banners, in-app messages or bio pages. The results are the dashboard’s own, with sample sizes, confidence and a verdict. A/B tests are on paid plans. For what each setting does, see the user guide.
Every path also works under /v1/manage/appspaces/{appspace}, which you need when an OAuth token reaches more than one Appspace. See the management API overview for signing in, errors, dry runs and paging.
| Method | Path | What it does | Permission |
|---|---|---|---|
GET | /v1/manage/ab-tests | List A/B tests | Read |
POST | /v1/manage/ab-tests | Create an A/B test | Read and write |
GET | /v1/manage/ab-tests/{test} | Get an A/B test | Read |
PATCH | /v1/manage/ab-tests/{test} | Change an A/B test’s split | Read and write |
DELETE | /v1/manage/ab-tests/{test} | Delete an A/B test | Read and write |
GET | /v1/manage/ab-tests/{test}/results | An A/B test’s results | Read |
POST | /v1/manage/ab-tests/{test}/pause | Pause an A/B test | Read and write |
POST | /v1/manage/ab-tests/{test}/resume | Resume an A/B test | Read and write |
POST | /v1/manage/ab-tests/{test}/winner | Pick an A/B test’s winner | Read and write |
POST | /v1/manage/ab-tests/{test}/restore | Restore a deleted A/B test | Read and write |
List A/B tests
Section titled “List A/B tests”/v1/manage/ab-testsPermission: Read.
The Appspace’s A/B tests, oldest first, paged with cursor: each with its versions, split and status. Results: GET /ab-tests/{test}/results.
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | No | How many to return, 1 to 100 (default 50). |
cursor | string | No | From the previous page’s next_cursor, to get the page after it. |
Response 200: a page of results in data, and next_cursor for the next page (see Paging). Each item:
| Field | Type | Description |
|---|---|---|
id | string | The test’s id. Any endpoint taking {test} also takes its name. |
name | string | |
type | landing_page, banner, message, bio_page | |
goal | string | |
goal_event_name | string or null | |
status | active, paused, completed | |
route_id | string or null | |
winner_variant_id | string or null | |
completed_at | string or null | |
variants | array of object | |
variants[].id | string | |
variants[].name | string | |
variants[].weight | number | |
variants[].is_control | boolean | |
variants[].shows | string or null | The name of the page, banner or message it shows. |
created | string | |
updated_at | string |
Create an A/B test
Section titled “Create an A/B test”/v1/manage/ab-testsPermission: Read and write. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
A name, a type, and two or more versions adding up to 100 (the first is the control). A landing page test splits a route’s visitors between landing pages (or fallbacks); a banner, message or bio page test between banners, in-app messages or bio pages, each this Appspace’s own. It starts at once. A paid plan. Send Idempotency-Key so a retry never makes two. With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Request body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | A name for your team, such as “Spring page: photo or video”. |
type | string | Yes | What is tested: landing_page, banner, message, bio_page. landing_page: visitors to a route see one of several landing pages (or fallbacks); banner, message, bio_page: one of several banners, in-app messages or bio pages. |
goal | string | No | What wins: clicks (default: taps through to the store for a landing page; taps on a banner, message or bio page link), installs (landing page tests), custom_event (with goal_event_name; landing page tests can’t split these by version). |
goal_event_name | string or null | No | |
route_id | string or null | No | Landing page tests: the route (id, prefix or name) whose visitors are split. |
variants | array of object | Yes | The versions, at least two; the first is the control. |
variants[].name | string | No | Default “Variant A”, “Variant B”… |
variants[].weight | integer or string | Yes | Its share of visitors, a whole number; all versions add up to 100. |
variants[].landing_page_id | string or null | No | Landing page tests: the page this version shows (id or name). Empty: the route’s own page. |
variants[].url | string or null | No | Landing page tests: this version’s web fallback (where people without the app go). Empty: the route’s. |
variants[].banner_id | string or null | No | Banner tests: the banner this version shows (id or title). |
variants[].message_id | string or null | No | Message tests: the in-app message this version shows (id or name). |
variants[].bio_page_id | string or null | No | Bio page tests: the bio page this version shows (id or slug). |
Response 201: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
id | string | The test’s id. Any endpoint taking {test} also takes its name. |
name | string | |
type | landing_page, banner, message, bio_page | |
goal | string | |
goal_event_name | string or null | |
status | active, paused, completed | |
route_id | string or null | |
winner_variant_id | string or null | |
completed_at | string or null | |
variants | array of object | |
variants[].id | string | |
variants[].name | string | |
variants[].weight | number | |
variants[].is_control | boolean | |
variants[].shows | string or null | The name of the page, banner or message it shows. |
created | string | |
updated_at | string |
Get an A/B test
Section titled “Get an A/B test”/v1/manage/ab-tests/{test}Permission: Read.
One test: its type, goal, status, route and versions (what each shows and its share).
Path parameters:
| Parameter | Description |
|---|---|
test | The A/B test: its id or name. URL-encode a name. |
Response 200: the result in data.
| Field | Type | Description |
|---|---|---|
id | string | The test’s id. Any endpoint taking {test} also takes its name. |
name | string | |
type | landing_page, banner, message, bio_page | |
goal | string | |
goal_event_name | string or null | |
status | active, paused, completed | |
route_id | string or null | |
winner_variant_id | string or null | |
completed_at | string or null | |
variants | array of object | |
variants[].id | string | |
variants[].name | string | |
variants[].weight | number | |
variants[].is_control | boolean | |
variants[].shows | string or null | The name of the page, banner or message it shows. |
created | string | |
updated_at | string |
Change an A/B test’s split
Section titled “Change an A/B test’s split”/v1/manage/ab-tests/{test}Permission: Read and write. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Rename or re-weight versions; the weights of all versions must still add up to 100. A completed test can’t change (409). With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
test | The A/B test: its id or name. URL-encode a name. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Request body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
variants | array of object | Yes | Versions to rename or re-weight; ones left out keep theirs. The weights of all versions must still add up to 100. |
variants[].id | string | Yes | The version: its id or name (get_ab_test lists them). |
variants[].name | string | No | |
variants[].weight | integer or string | No | |
expected_updated_at | string | No | The updated_at you read. If the thing has changed since, nothing is saved and the answer is 412 precondition_failed: read it again and retry. |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
id | string | The test’s id. Any endpoint taking {test} also takes its name. |
name | string | |
type | landing_page, banner, message, bio_page | |
goal | string | |
goal_event_name | string or null | |
status | active, paused, completed | |
route_id | string or null | |
winner_variant_id | string or null | |
completed_at | string or null | |
variants | array of object | |
variants[].id | string | |
variants[].name | string | |
variants[].weight | number | |
variants[].is_control | boolean | |
variants[].shows | string or null | The name of the page, banner or message it shows. |
created | string | |
updated_at | string |
Delete an A/B test
Section titled “Delete an A/B test”/v1/manage/ab-tests/{test}Permission: Read and write. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Visitors stop being split at once. It goes to the trash with its versions for 30 days; its results stay in analytics. With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
test | The A/B test: its id or name. URL-encode a name. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
deleted | true | |
id | string | |
name | string | |
trash_id | string | |
restorable_until | string |
An A/B test’s results
Section titled “An A/B test’s results”/v1/manage/ab-tests/{test}/resultsPermission: Read.
The dashboard’s own results, over the test’s life: each version’s visitors (sample size) and conversions, its rate against the control with the confidence, and a verdict (winner, control_wins, no_difference, too_early, no_data, not_measurable). A difference counts at 95% confidence.
Path parameters:
| Parameter | Description |
|---|---|
test | The A/B test: its id or name. URL-encode a name. |
Response 200: the result in data.
| Field | Type | Description |
|---|---|---|
verdict | winner, control_wins, no_difference, too_early, no_data, not_measurable | |
leader | object or null | |
leader.id | string | |
leader.name | string | |
leader.lift | number or null | |
leader.confidence | number or null | |
threshold | number | The confidence a difference needs to count (0.95). |
measure | object | |
measure.exposure_label | string | |
measure.conversion_label | string | |
measure.note | string or null | |
variants | array of object | |
variants[].id | string | |
variants[].name | string | |
variants[].is_control | boolean | |
variants[].weight | number | |
variants[].exposures | number | |
variants[].conversions | number or null | |
variants[].comparison | any or null | |
start | string | |
end | string | |
summary | string |
Pause an A/B test
Section titled “Pause an A/B test”/v1/manage/ab-tests/{test}/pausePermission: Read and write. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Stops splitting visitors: everyone sees the control. Only an active test. With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
test | The A/B test: its id or name. URL-encode a name. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
id | string | The test’s id. Any endpoint taking {test} also takes its name. |
name | string | |
type | landing_page, banner, message, bio_page | |
goal | string | |
goal_event_name | string or null | |
status | active, paused, completed | |
route_id | string or null | |
winner_variant_id | string or null | |
completed_at | string or null | |
variants | array of object | |
variants[].id | string | |
variants[].name | string | |
variants[].weight | number | |
variants[].is_control | boolean | |
variants[].shows | string or null | The name of the page, banner or message it shows. |
created | string | |
updated_at | string |
Resume an A/B test
Section titled “Resume an A/B test”/v1/manage/ab-tests/{test}/resumePermission: Read and write. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Splits visitors again. Only a paused test. With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
test | The A/B test: its id or name. URL-encode a name. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
id | string | The test’s id. Any endpoint taking {test} also takes its name. |
name | string | |
type | landing_page, banner, message, bio_page | |
goal | string | |
goal_event_name | string or null | |
status | active, paused, completed | |
route_id | string or null | |
winner_variant_id | string or null | |
completed_at | string or null | |
variants | array of object | |
variants[].id | string | |
variants[].name | string | |
variants[].weight | number | |
variants[].is_control | boolean | |
variants[].shows | string or null | The name of the page, banner or message it shows. |
created | string | |
updated_at | string |
Pick an A/B test’s winner
Section titled “Pick an A/B test’s winner”/v1/manage/ab-tests/{test}/winnerPermission: Read and write. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Ends the test with this version as the winner (only an active test). A landing page test’s route takes the winner’s landing page and web fallback. Read the results first. With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
test | The A/B test: its id or name. URL-encode a name. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Request body (JSON):
| Field | Type | Required | Description |
|---|---|---|---|
variant | string | Yes | The winning version: its id or name. |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
id | string | The test’s id. Any endpoint taking {test} also takes its name. |
name | string | |
type | landing_page, banner, message, bio_page | |
goal | string | |
goal_event_name | string or null | |
status | active, paused, completed | |
route_id | string or null | |
winner_variant_id | string or null | |
completed_at | string or null | |
variants | array of object | |
variants[].id | string | |
variants[].name | string | |
variants[].weight | number | |
variants[].is_control | boolean | |
variants[].shows | string or null | The name of the page, banner or message it shows. |
created | string | |
updated_at | string |
Restore a deleted A/B test
Section titled “Restore a deleted A/B test”/v1/manage/ab-tests/{test}/restorePermission: Read and write. Changes something: takes dry_run and Idempotency-Key, and needs the Standard plan or above.
Brings back a test deleted in the last 30 days, with the same id and versions. Refused (409) when its route is gone: restore the route instead, which brings its test back. With dry_run, nothing changes: the answer is { dry_run: true, before, after, changes, warnings }.
Path parameters:
| Parameter | Description |
|---|---|
test | The A/B test: its id or name. URL-encode a name. |
Query parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
dry_run | true, false | No | true: check and preview the change without making it (the same as dry_run in the body). |
Response 200: the result in data, with warnings. With dry_run, a preview instead.
| Field | Type | Description |
|---|---|---|
id | string | The test’s id. Any endpoint taking {test} also takes its name. |
name | string | |
type | landing_page, banner, message, bio_page | |
goal | string | |
goal_event_name | string or null | |
status | active, paused, completed | |
route_id | string or null | |
winner_variant_id | string or null | |
completed_at | string or null | |
variants | array of object | |
variants[].id | string | |
variants[].name | string | |
variants[].weight | number | |
variants[].is_control | boolean | |
variants[].shows | string or null | The name of the page, banner or message it shows. |
created | string | |
updated_at | string |