Create iteration

POST
/api/v2/projects/:projectKey/environments/:environmentKey/experiments/:experimentKey/iterations

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 with the startIteration or stopIteration instruction.

To learn more, read Start experiment iterations.

Path parameters

projectKeystringRequired

The project key

environmentKeystringRequired

The environment key

experimentKeystringRequired

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.

attributeslist of stringsOptional

The attributes that this iteration’s results can be sliced by

Response

Iteration response

hypothesisstring

The expected outcome of this experiment

statusstring

The status of the iteration: not_started, running, stopped

createdAtlong

Timestamp of when the iteration was created

_idstringOptional

The iteration ID

startedAtlongOptional

Timestamp of when the iteration started

endedAtlongOptional

Timestamp of when the iteration ended

winningTreatmentIdstringOptional

The ID of the treatment chosen when the experiment stopped

winningReasonstringOptional

The reason you stopped the experiment

canReshuffleTrafficbooleanOptional

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 objectsOptional

Details on the flag used in this experiment

primaryMetricobjectOptional

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

primarySingleMetricobjectOptional

Details on the primary metric for this experiment

primaryFunnelobjectOptional

Details on the primary funnel group for this experiment

randomizationUnitstringOptional

The unit of randomization for this iteration

attributeslist of stringsOptional

The available attribute filters for this iteration

treatmentslist of objectsOptional

Details on the variations you are testing in the experiment

metricslist of objectsOptional

Details on the metrics for this experiment

layerSnapshotobjectOptional

Snapshot of the layer state on iteration stop, if part of a layer. Otherwise omitted.

secondaryMetricslist of objectsOptionalDeprecated

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

Errors

Built with