Create iteration

Deprecated
Create an experiment iteration. Experiment iterations let you record experiments in individual blocks of time. Initially, iterations are created with a status of `not_started` and appear in the `draftIteration` field of an experiment. To start or stop an iteration, [update the experiment](https://launchdarkly.com/docs/api/experiments/patch-experiment) with the `startIteration` or `stopIteration` instruction. To learn more, read [Start experiment iterations](https://launchdarkly.com/docs/home/experimentation/create#start-an-experiment-iteration).

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequiredformat: "string"
The project key
environmentKeystringRequiredformat: "string"
The environment key
experimentKeystringRequiredformat: "string"
The experiment key

Request

This endpoint expects an object.
hypothesisstringRequired
The expected outcome of this experiment
metricslist of objectsRequired
Details on the metrics for this experiment
treatmentslist of objectsRequired
Details on the variations you are testing in the experiment. You establish these variations in feature flags, and then reuse them in experiments.
flagsmap from strings to objectsRequired
Details on the feature flag and targeting rules for this iteration
canReshuffleTrafficbooleanOptional

Whether to allow the experiment to reassign traffic to different variations when you increase or decrease the traffic in your experiment audience (true) or keep all traffic assigned to its initial variation (false). Defaults to true.

primarySingleMetricKeystringOptional

The key of the primary metric for this experiment. Either primarySingleMetricKey or primaryFunnelKey must be present.

primaryFunnelKeystringOptional

The key of the primary funnel group for this experiment. Either primarySingleMetricKey or primaryFunnelKey must be present.

randomizationUnitstringOptional
The unit of randomization for this iteration. Defaults to user.
reallocationFrequencyMillisintegerOptional

The cadence (in milliseconds) to update the allocation.

covariateIdstringOptional
The ID of the covariate CSV
attributeslist of stringsOptional
The attributes that this iteration's results can be sliced by

Response

Iteration response
hypothesisstring
The expected outcome of this experiment
statusenum

The status of the iteration: not_started, running, stopped

Allowed values:
createdAtlong
Timestamp of when the iteration was created
_idstring
The iteration ID
startedAtlong
Timestamp of when the iteration started
endedAtlong
Timestamp of when the iteration ended
winningTreatmentIdstring
The ID of the treatment chosen when the experiment stopped
winningReasonstring
The reason you stopped the experiment
canReshuffleTrafficboolean

Whether the experiment may reassign traffic to different variations when the experiment audience changes (true) or must keep all traffic assigned to its initial variation (false).

flagsmap from strings to objects
Details on the flag used in this experiment
reallocationFrequencyMillisinteger

The cadence (in milliseconds) to update the allocation. Only present for multi-armed bandits.

versioninteger
The current version that the iteration is on
primaryMetricobject

Deprecated, use primarySingleMetric and primaryFunnel instead. Details on the primary metric for this experiment.

primarySingleMetricobject
Details on the primary metric for this experiment
primaryFunnelobject
Details on the primary funnel group for this experiment
randomizationUnitstring
The unit of randomization for this iteration
attributeslist of strings
The available attribute filters for this iteration
treatmentslist of objects
Details on the variations you are testing in the experiment
metricslist of objects
Details on the metrics for this experiment
layerSnapshotobject
Snapshot of the layer state on iteration stop, if part of a layer. Otherwise omitted.
covariateInfoobject
Details of the covariate file for stratified sampling
secondaryMetricslist of objectsDeprecated

Deprecated, use metrics instead. Details on the secondary metrics for this experiment.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error