provider Experiments POST /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}/iterations
@utdk/launchdarkly /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}/iterations
Create iteration
> **Deprecated**: This endpoint will be removed in a future version. Use the `updateExperimentFields` and `saveAndStartNewIteration` instructions on [Update experiment](https://launchdarkly.com/docs/api/experiments/patch-experiment) instead. 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).
projectKey path required
The project key
string
environmentKey path required
The environment key
string
experimentKey path required
The experiment key
string

Try it

Authentication
Configure credentials for LaunchDarkly REST API
Gateway
The gateway proxies requests and injects credentials server-side. Configure credentials above, then enter your gateway URL.

Saved automatically to browser storage.

createiteration
POST/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}/iterations
> **Deprecated**: This endpoint will be removed in a future version. Use the `updateExperimentFields` and `saveAndStartNewIteration` instructions on [Update experiment](https://launchdarkly.com/docs/api/experiments/patch-experiment) instead. 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).

Parameters

required

The project key

required

The environment key

required

The experiment key

Input

required

The expected outcome of this experiment

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.

required

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

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

required
required

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

The cadence (in milliseconds) to update the allocation.

The ID of the covariate CSV

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

Enter a gateway URL above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import launchdarkly from '@utdk/launchdarkly';

await launchdarkly.createiteration()