Skip to content

A/B tests (management API)

View as Markdown

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.

MethodPathWhat it doesPermission
GET/v1/manage/ab-testsList A/B testsRead
POST/v1/manage/ab-testsCreate an A/B testRead and write
GET/v1/manage/ab-tests/{test}Get an A/B testRead
PATCH/v1/manage/ab-tests/{test}Change an A/B test’s splitRead and write
DELETE/v1/manage/ab-tests/{test}Delete an A/B testRead and write
GET/v1/manage/ab-tests/{test}/resultsAn A/B test’s resultsRead
POST/v1/manage/ab-tests/{test}/pausePause an A/B testRead and write
POST/v1/manage/ab-tests/{test}/resumeResume an A/B testRead and write
POST/v1/manage/ab-tests/{test}/winnerPick an A/B test’s winnerRead and write
POST/v1/manage/ab-tests/{test}/restoreRestore a deleted A/B testRead and write
GET/v1/manage/ab-tests

Permission: 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:

ParameterTypeRequiredDescription
limitintegerNoHow many to return, 1 to 100 (default 50).
cursorstringNoFrom 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:

FieldTypeDescription
idstringThe test’s id. Any endpoint taking {test} also takes its name.
namestring
typelanding_page, banner, message, bio_page
goalstring
goal_event_namestring or null
statusactive, paused, completed
route_idstring or null
winner_variant_idstring or null
completed_atstring or null
variantsarray of object
variants[].idstring
variants[].namestring
variants[].weightnumber
variants[].is_controlboolean
variants[].showsstring or nullThe name of the page, banner or message it shows.
createdstring
updated_atstring
POST/v1/manage/ab-tests

Permission: 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:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: check and preview the change without making it (the same as dry_run in the body).

Request body (JSON):

FieldTypeRequiredDescription
namestringYesA name for your team, such as “Spring page: photo or video”.
typestringYesWhat 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.
goalstringNoWhat 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_namestring or nullNo
route_idstring or nullNoLanding page tests: the route (id, prefix or name) whose visitors are split.
variantsarray of objectYesThe versions, at least two; the first is the control.
variants[].namestringNoDefault “Variant A”, “Variant B”…
variants[].weightinteger or stringYesIts share of visitors, a whole number; all versions add up to 100.
variants[].landing_page_idstring or nullNoLanding page tests: the page this version shows (id or name). Empty: the route’s own page.
variants[].urlstring or nullNoLanding page tests: this version’s web fallback (where people without the app go). Empty: the route’s.
variants[].banner_idstring or nullNoBanner tests: the banner this version shows (id or title).
variants[].message_idstring or nullNoMessage tests: the in-app message this version shows (id or name).
variants[].bio_page_idstring or nullNoBio 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.

FieldTypeDescription
idstringThe test’s id. Any endpoint taking {test} also takes its name.
namestring
typelanding_page, banner, message, bio_page
goalstring
goal_event_namestring or null
statusactive, paused, completed
route_idstring or null
winner_variant_idstring or null
completed_atstring or null
variantsarray of object
variants[].idstring
variants[].namestring
variants[].weightnumber
variants[].is_controlboolean
variants[].showsstring or nullThe name of the page, banner or message it shows.
createdstring
updated_atstring
GET/v1/manage/ab-tests/{test}

Permission: Read.

One test: its type, goal, status, route and versions (what each shows and its share).

Path parameters:

ParameterDescription
testThe A/B test: its id or name. URL-encode a name.

Response 200: the result in data.

FieldTypeDescription
idstringThe test’s id. Any endpoint taking {test} also takes its name.
namestring
typelanding_page, banner, message, bio_page
goalstring
goal_event_namestring or null
statusactive, paused, completed
route_idstring or null
winner_variant_idstring or null
completed_atstring or null
variantsarray of object
variants[].idstring
variants[].namestring
variants[].weightnumber
variants[].is_controlboolean
variants[].showsstring or nullThe name of the page, banner or message it shows.
createdstring
updated_atstring
PATCH/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:

ParameterDescription
testThe A/B test: its id or name. URL-encode a name.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: check and preview the change without making it (the same as dry_run in the body).

Request body (JSON):

FieldTypeRequiredDescription
variantsarray of objectYesVersions to rename or re-weight; ones left out keep theirs. The weights of all versions must still add up to 100.
variants[].idstringYesThe version: its id or name (get_ab_test lists them).
variants[].namestringNo
variants[].weightinteger or stringNo
expected_updated_atstringNoThe 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.

FieldTypeDescription
idstringThe test’s id. Any endpoint taking {test} also takes its name.
namestring
typelanding_page, banner, message, bio_page
goalstring
goal_event_namestring or null
statusactive, paused, completed
route_idstring or null
winner_variant_idstring or null
completed_atstring or null
variantsarray of object
variants[].idstring
variants[].namestring
variants[].weightnumber
variants[].is_controlboolean
variants[].showsstring or nullThe name of the page, banner or message it shows.
createdstring
updated_atstring
DELETE/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:

ParameterDescription
testThe A/B test: its id or name. URL-encode a name.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: 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.

FieldTypeDescription
deletedtrue
idstring
namestring
trash_idstring
restorable_untilstring
GET/v1/manage/ab-tests/{test}/results

Permission: 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:

ParameterDescription
testThe A/B test: its id or name. URL-encode a name.

Response 200: the result in data.

FieldTypeDescription
verdictwinner, control_wins, no_difference, too_early, no_data, not_measurable
leaderobject or null
leader.idstring
leader.namestring
leader.liftnumber or null
leader.confidencenumber or null
thresholdnumberThe confidence a difference needs to count (0.95).
measureobject
measure.exposure_labelstring
measure.conversion_labelstring
measure.notestring or null
variantsarray of object
variants[].idstring
variants[].namestring
variants[].is_controlboolean
variants[].weightnumber
variants[].exposuresnumber
variants[].conversionsnumber or null
variants[].comparisonany or null
startstring
endstring
summarystring
POST/v1/manage/ab-tests/{test}/pause

Permission: 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:

ParameterDescription
testThe A/B test: its id or name. URL-encode a name.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: 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.

FieldTypeDescription
idstringThe test’s id. Any endpoint taking {test} also takes its name.
namestring
typelanding_page, banner, message, bio_page
goalstring
goal_event_namestring or null
statusactive, paused, completed
route_idstring or null
winner_variant_idstring or null
completed_atstring or null
variantsarray of object
variants[].idstring
variants[].namestring
variants[].weightnumber
variants[].is_controlboolean
variants[].showsstring or nullThe name of the page, banner or message it shows.
createdstring
updated_atstring
POST/v1/manage/ab-tests/{test}/resume

Permission: 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:

ParameterDescription
testThe A/B test: its id or name. URL-encode a name.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: 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.

FieldTypeDescription
idstringThe test’s id. Any endpoint taking {test} also takes its name.
namestring
typelanding_page, banner, message, bio_page
goalstring
goal_event_namestring or null
statusactive, paused, completed
route_idstring or null
winner_variant_idstring or null
completed_atstring or null
variantsarray of object
variants[].idstring
variants[].namestring
variants[].weightnumber
variants[].is_controlboolean
variants[].showsstring or nullThe name of the page, banner or message it shows.
createdstring
updated_atstring
POST/v1/manage/ab-tests/{test}/winner

Permission: 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:

ParameterDescription
testThe A/B test: its id or name. URL-encode a name.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: check and preview the change without making it (the same as dry_run in the body).

Request body (JSON):

FieldTypeRequiredDescription
variantstringYesThe winning version: its id or name.

Response 200: the result in data, with warnings. With dry_run, a preview instead.

FieldTypeDescription
idstringThe test’s id. Any endpoint taking {test} also takes its name.
namestring
typelanding_page, banner, message, bio_page
goalstring
goal_event_namestring or null
statusactive, paused, completed
route_idstring or null
winner_variant_idstring or null
completed_atstring or null
variantsarray of object
variants[].idstring
variants[].namestring
variants[].weightnumber
variants[].is_controlboolean
variants[].showsstring or nullThe name of the page, banner or message it shows.
createdstring
updated_atstring
POST/v1/manage/ab-tests/{test}/restore

Permission: 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:

ParameterDescription
testThe A/B test: its id or name. URL-encode a name.

Query parameters:

ParameterTypeRequiredDescription
dry_runtrue, falseNotrue: 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.

FieldTypeDescription
idstringThe test’s id. Any endpoint taking {test} also takes its name.
namestring
typelanding_page, banner, message, bio_page
goalstring
goal_event_namestring or null
statusactive, paused, completed
route_idstring or null
winner_variant_idstring or null
completed_atstring or null
variantsarray of object
variants[].idstring
variants[].namestring
variants[].weightnumber
variants[].is_controlboolean
variants[].showsstring or nullThe name of the page, banner or message it shows.
createdstring
updated_atstring
Was this page helpful?