Skip to main content
POST
Create Experiment

Authorizations

Authorization
string
header
required

An Account API key, an account access token, an account-scoped user token, or a user OAuth token. Prepend the key or token with Bearer, for example Bearer ***************************. See Auth & API keys for how to get each one.

Scopes

experiment:manage

Headers

Idempotency-Key
string

A unique key that makes this request safe to retry. See Idempotent requests.

Maximum string length: 255
Example:

"d9105228-4a08-46b1-8b91-42fed586d383"

Api-Version-Date
string

Pins the request to a dated API version.

Example:

"2026-11-25"

Body

application/json
account_id
string
required

Owning account ID. Required; ownership cannot change.

Example:

"biz_xxxxxxxxxxxxxx"

flag_key
string
required

Developer-chosen handle referenced from code, used in evaluation and results calls. Interchangeable with the returned expt_ id anywhere the API takes an experiment identifier.

Example:

"checkout_redesign_v2"

bucket_by
enum<string>

Randomization unit, and the only identity the assignment is keyed on — evaluation fails rather than falling back to another. user (default) uses subject[user_id]; account uses subject[account_id], so every user of an account gets the same arm; anonymous uses the anonymous id and survives sign-in. Fixed after creation.

Available options:
user,
account,
anonymous
Example:

"user"

control
object
decision_mode
enum<string> | null

How the experiment is decided. autopilot ends it as soon as a result is outside the margin of error, shipping the arm that won or keeping control if it lost. If its window passes with no clear result, autopilot keeps control. require_approval leaves every arm serving for the owner to end. Omit to leave it to the owner. Not accepted on feature flags.

Available options:
autopilot,
require_approval
Example:

"autopilot"

hypothesis
string | null

Required for full experiments; rejected on feature flags. Structure it as "If we [change] for [cohort], then [measurable behavior] will [increase/decrease], resulting in [business outcome], because [evidence]. Created by [name]." Evidence should be something real — a baseline number, a funnel breakdown — not a guess, and [name] is you, not something to leave blank.

Example:

"If we show before and after detailing photos to Austin drivers, then ceramic coating bookings will increase. Customers can see the finish before choosing a package. Created by Marcus Webb."

kind
enum<string>

experiment assigns its subjects to arms and takes variants. beforeafter compares a change with the period before it: it assigns nobody and needs target_stats. Defaults to experiment.

Available options:
experiment,
beforeafter
Example:

"experiment"

metadata
object

Up to 20 key-value pairs you can attach to the experiment for your own use, such as which pages it changes. Keys are at most 40 characters and values at most 500.

name
string

Human-readable display name. Defaults to flag_key when omitted.

Example:

"Ceramic Coating Photo Test"

Resource owned by the account that this experiment is bound to, such as an app or product. null when unbound. Fixed once the experiment first activates.

target_stats
object[]

The measures the experiment sets out to move, as the stats API reads them. Only an account's experiment takes them.

variants
object[]

Treatment arms to create. Users outside every arm form the implicit control group. Required unless feature_flag_only is true.

Response

experiment created

account_id
string
required

Owning account ID.

Example:

"biz_xxxxxxxxxxxxxx"

assignment_seed
string
required

Assignment hashes UTF-8 seed + subject ID with CRC32 modulo 100 and selects the stored end-exclusive range.

Example:

"checkout_redesign_v21768435200"

configuration_revision
integer
required

Revision of the serving configuration. Increments on every configuration change, so a cached definition with a lower revision is stale. Does not change the assignment seed.

Example:

1

control
object
required
flag_key
string
required

Developer-chosen handle referenced from code. Anywhere the API takes an experiment identifier, the expt_ id and the flag_key are interchangeable.

Example:

"checkout_redesign_v2"

id
string
required

Unique identifier for the experiment, prefixed expt_.

Example:

"expt_xxxxxxxxxxxxxx"

name
string
required

Human-readable display name.

Example:

"Ceramic Coating Photo Test"

Resource owned by the account that this experiment is bound to, such as an app or product. null when unbound. Fixed once the experiment first activates.

status
enum<string>
required

Lifecycle state. draft — not yet live; active — currently running; paused — traffic paused; ended — concluded.

Available options:
draft,
active,
paused,
ended
Example:

"draft"

updated_at
string<date-time> | null
required
Example:

"2026-01-01T12:00:00.000Z"

variants
object[]
required

Treatment arms. Users outside every arm's allocation form the implicit control group. Weights only ever grow and arms are never removed, so a user moves from control into a treatment at most once.

bucket_by
enum<string> | null

Randomization unit — user buckets each user independently, account buckets whole accounts (every user of an account gets the same arm). null for feature flags.

Available options:
user,
account,
anonymous
Example:

"user"

created_at
string | null

When the experiment was created, as an ISO 8601 timestamp.

Example:

"2026-01-01T12:00:00.000Z"

created_by
string | null

ID of the user who created the experiment, prefixed user_. null for experiments created before creators were recorded.

Example:

"user_xxxxxxxxxxxxxx"

decision_mode
enum<string> | null

How the experiment is decided. autopilot ends it as soon as a result is outside the margin of error, shipping the arm that won or keeping control if it lost. If its window passes with no clear result, autopilot keeps control. require_approval leaves every arm serving for the owner to end. null leaves it to the owner.

Available options:
autopilot,
require_approval
Example:

"autopilot"

ended_at
string | null

When the experiment stopped collecting data, as an ISO 8601 timestamp. null while still running.

Example:

"2026-01-01T12:00:00.000Z"

findings
string | null

What was learned and why this outcome, recorded when the experiment was ended. null until then.

Example:

"Treatment lifted conversion 8%"

hypothesis
string | null

Hypothesis for this experiment. null when none is set, and always null for feature flags.

Example:

"Showing ceramic coating photos will increase detailing bookings"

kind
enum<string>

The kind of experiment: boolean is a feature flag, experiment assigns its subjects to arms, beforeafter compares a change with the period before it.

Available options:
boolean,
experiment,
beforeafter
Example:

"experiment"

metadata
object

Key-value pairs attached when the experiment was created. Empty when none were set.

Example:
started_at
string | null

When the experiment began collecting data, as an ISO 8601 timestamp. null for drafts.

Example:

"2026-01-01T12:00:00.000Z"

target_stats
object[] | null

The measures the experiment sets out to move, as the stats API reads them. null when there are none.

Example:

null

winning_arm
string | null

The treatment that won, set when the experiment was ended. Once set, every evaluation returns this arm to every caller regardless of targeting or allocation, and no further exposures are recorded. null means control won — an ended experiment with no winning arm evaluates to control for everyone. Always null for feature flags, which simply evaluate to disabled once ended.

Example:

"treatment"