Skip to content
Kaizena FlowDocs
Search

Search the docs

A/B tests

The store's A/B tests (D148), each as its page reads it: worked out by the store, read-only.

OperationMethod and pathScope
List A/B testsGET /experimentsreports:read
Get an A/B testGET /experiments/{id}reports:read

List A/B tests

GET https://kaizenaflow.com/api/admin/v1/experiments

The store's A/B tests, newest first, each as its page reads it: the stage, how far along, the next step and, once it has an answer, each version against the original. Worked out by the store; nothing is written.

  • Operation: experiments.list

  • Scope: reports:read

  • Answers: 200, the answer under data.

Answer

FieldTypeDescription
datalist of objects
data[].idstring (uuid)
data[].namestring
data[].statusone of draft, scheduled, running, stopped, applied, discarded
data[].stageone of draft, scheduled, learning, answer, broken, applied, discardedAs the test's page shows it: a running test is learning until it has an answer, or broken when the visitors are not divided as planned.
data[].nextone of start, wait, use, keep_original, start_again, doneThe one next step the page offers.
data[].beststring or nullFor next = use: the version to use.
data[].goalone of orders, revenue, cart, checkout, click, form, signup, pagesignup: a sign-up to Kaizena Flow, a goal only Kaizena Flow's own store has. page: going on to a chosen page of the store.
data[].targetobject
data[].target.kindone of page, layout, header, footer, role
data[].target.titlestring
data[].target.slugstring
data[].target.partstring or null
data[].versionslist of objects
data[].versions[].keystringa is the original.
data[].versions[].namestring
data[].versions[].sharenumber
data[].progressobject
data[].progress.daysinteger
data[].progress.min_daysinteger
data[].progress.visitorsintegerVisitors of the version with the fewest.
data[].progress.min_visitorsinteger
data[].progress.sharenumberHow far along, 0 to 1: the lesser of days and visitors.
data[].progress.reachedboolean
data[].progress.ready_aroundstring or nullThe day (YYYY-MM-DD) it is likely ready at today's pace; null when reached or nothing to go on.
data[].comparisonslist of objectsOnly once the test has an answer: empty while it is too early, so no one reads a peek as a result.
data[].comparisons[].keystring
data[].comparisons[].originalnumberThe original's rate (a share) or revenue per visitor (minor units).
data[].comparisons[].versionnumber
data[].comparisons[].relativenumber or nullThe change as a share of the original.
data[].comparisons[].lownumber or nullThe likely range's low end, at the verdict's level.
data[].comparisons[].highnumber or null
data[].comparisons[].sideone of better, worse, unsureWhere the range lies: wholly above no change, wholly below, or across it.
data[].impactobject or nullIf everyone saw the better version: how many more visitors a week would do the thing, with its likely range.
data[].impact.keystring
data[].impact.per_weekinteger
data[].impact.lowinteger
data[].impact.highinteger
data[].learningstring or nullWhat the owner wrote the test taught.
data[].started_atstring (date-time) or null
data[].stopped_atstring (date-time) or null
data[].answered_atstring (date-time) or null
data[].applied_versionstring or null
data[].created_atstring (date-time)

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl 'https://kaizenaflow.com/api/admin/v1/experiments' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/experiments", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/experiments",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Get an A/B test

GET https://kaizenaflow.com/api/admin/v1/experiments/{id}

One A/B test as its page reads it.

  • Operation: experiments.get

  • Scope: reports:read

  • Answers: 200, the answer under data.

Path parameters

NameTypeRequiredDescription
idstring (uuid)yesThe thing's id in this store.

Answer

FieldTypeDescription
dataobject
data.idstring (uuid)
data.namestring
data.statusone of draft, scheduled, running, stopped, applied, discarded
data.stageone of draft, scheduled, learning, answer, broken, applied, discardedAs the test's page shows it: a running test is learning until it has an answer, or broken when the visitors are not divided as planned.
data.nextone of start, wait, use, keep_original, start_again, doneThe one next step the page offers.
data.beststring or nullFor next = use: the version to use.
data.goalone of orders, revenue, cart, checkout, click, form, signup, pagesignup: a sign-up to Kaizena Flow, a goal only Kaizena Flow's own store has. page: going on to a chosen page of the store.
data.targetobject
data.target.kindone of page, layout, header, footer, role
data.target.titlestring
data.target.slugstring
data.target.partstring or null
data.versionslist of objects
data.versions[].keystringa is the original.
data.versions[].namestring
data.versions[].sharenumber
data.progressobject
data.progress.daysinteger
data.progress.min_daysinteger
data.progress.visitorsintegerVisitors of the version with the fewest.
data.progress.min_visitorsinteger
data.progress.sharenumberHow far along, 0 to 1: the lesser of days and visitors.
data.progress.reachedboolean
data.progress.ready_aroundstring or nullThe day (YYYY-MM-DD) it is likely ready at today's pace; null when reached or nothing to go on.
data.comparisonslist of objectsOnly once the test has an answer: empty while it is too early, so no one reads a peek as a result.
data.comparisons[].keystring
data.comparisons[].originalnumberThe original's rate (a share) or revenue per visitor (minor units).
data.comparisons[].versionnumber
data.comparisons[].relativenumber or nullThe change as a share of the original.
data.comparisons[].lownumber or nullThe likely range's low end, at the verdict's level.
data.comparisons[].highnumber or null
data.comparisons[].sideone of better, worse, unsureWhere the range lies: wholly above no change, wholly below, or across it.
data.impactobject or nullIf everyone saw the better version: how many more visitors a week would do the thing, with its likely range.
data.impact.keystring
data.impact.per_weekinteger
data.impact.lowinteger
data.impact.highinteger
data.learningstring or nullWhat the owner wrote the test taught.
data.started_atstring (date-time) or null
data.stopped_atstring (date-time) or null
data.answered_atstring (date-time) or null
data.applied_versionstring or null
data.created_atstring (date-time)

Errors

StatusCodeWhen
401unauthorizedNo valid token in Authorization: Bearer kf_…, or one that was revoked.
403forbiddenThe token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which.
404not_foundNo such route, or nothing with that id in the token's store (another store's ids are simply not found).
429rate_limitedMore calls than the budget allows; Retry-After says how many seconds to wait.
500failedSomething went wrong on our side; nothing more was done. It is safe to try again.

Example request

curl

curl 'https://kaizenaflow.com/api/admin/v1/experiments/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f' \
  -H "Authorization: Bearer $KAIZENA_TOKEN"

JavaScript

const response = await fetch("https://kaizenaflow.com/api/admin/v1/experiments/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f", {
  headers: {
    Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
  },
});
const answer = await response.json();

Python

import json
import os
import urllib.request

request = urllib.request.Request(
    "https://kaizenaflow.com/api/admin/v1/experiments/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f",
    headers={
        "Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
    },
)
with urllib.request.urlopen(request) as response:
    answer = json.load(response)

Made from the API contract, version 1.57This page as Markdown

Was this page helpful?