---
title: "Patch experiment"
method: PATCH
path: "/api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}"
tags: ["Experiments"]
---

# Patch experiment

`PATCH /api/v2/projects/{projectKey}/environments/{environmentKey}/experiments/{experimentKey}`

Update an experiment. Updating an experiment uses the semantic patch format.

To make a semantic patch request, you must append `domain-model=launchdarkly.semanticpatch` to your `Content-Type` header. To learn more, read [Updates using semantic patch](https://launchdarkly.com/docs/api#updates-using-semantic-patch).

### Instructions

Semantic patch requests support the following `kind` instructions for updating experiments.

#### updateName

Updates the experiment name.

##### Parameters

- `value`: The new name.

Here's an example:

```json
{
  "instructions": [{
    "kind": "updateName",
    "value": "Example updated experiment name"
  }]
}
```

#### updateDescription

Updates the experiment description.

##### Parameters

- `value`: The new description.

Here's an example:

```json
{
  "instructions": [{
    "kind": "updateDescription",
    "value": "Example updated description"
  }]
}
```

#### startIteration

Starts a new iteration for this experiment. You must [create a new iteration](https://launchdarkly.com/docs/api/experiments/create-iteration) before calling this instruction.

An iteration may not be started until it meets the following criteria:

* Its associated flag is toggled on and is not archived
* Its `randomizationUnit` is set
* At least one of its `treatments` has a non-zero `allocationPercent`

##### Parameters

- `changeJustification`: The reason for starting a new iteration. Required when you call `startIteration` on an already running experiment, otherwise optional.

Here's an example:

```json
{
  "instructions": [{
    "kind": "startIteration",
    "changeJustification": "It's time to start a new iteration"
  }]
}
```

#### stopIteration

Stops the current iteration for this experiment.

##### Parameters

- `winningTreatmentId`: The ID of the winning treatment. Treatment IDs are returned as part of the [Get experiment](https://launchdarkly.com/docs/api/experiments/get-experiment) response. They are the `_id` of each element in the `treatments` array.
- `winningReason`: The reason for the winner

Here's an example:

```json
{
  "instructions": [{
    "kind": "stopIteration",
    "winningTreatmentId": "3a548ec2-72ac-4e59-8518-5c24f5609ccf",
    "winningReason": "Example reason to stop the iteration"
  }]
}
```

#### archiveExperiment

Archives this experiment. Archived experiments are hidden by default in the LaunchDarkly user interface. You cannot start new iterations for archived experiments.

Here's an example:

```json
{
  "instructions": [{ "kind": "archiveExperiment" }]
}
```

#### restoreExperiment

Restores an archived experiment. After restoring an experiment, you can start new iterations for it again.

Here's an example:

```json
{
  "instructions": [{ "kind": "restoreExperiment" }]
}
```

## Path parameters

- `projectKey` string, string, required — The project key
- `environmentKey` string, string, required — The environment key
- `experimentKey` string, string, required — The experiment key

## Request body

- ExperimentPatchInput
  - `comment` string — Optional comment describing the update
  - `instructions` Instruction[], required

## Response `200`

Experiment response

- Experiment
  - `_id` string — The experiment ID
  - `key` string, required — The experiment key
  - `name` string, required — The experiment name
  - `description` string — The experiment description
  - `_maintainerId` string, required — The ID of the member who maintains this experiment.
  - `_creationDate` integer, required
  - `environmentKey` string, required
  - `archivedDate` integer
  - `tags` string[] — Tags for the experiment
  - `_links` object, required — The location and content type of related resources
  - `holdoutId` string — The holdout ID
  - `currentIteration` IterationRep
    - `_id` string — The iteration ID
    - `hypothesis` string, required — The expected outcome of this experiment
    - `status` 'not_started' | 'running' | 'stopped', required — The status of the iteration: <code>not_started</code>, <code>running</code>, <code>stopped</code>
    - `createdAt` integer, required
    - `startedAt` integer
    - `endedAt` integer
    - `winningTreatmentId` string — The ID of the treatment chosen when the experiment stopped
    - `winningReason` string — The reason you stopped the experiment
    - `canReshuffleTraffic` boolean — 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).
    - `flags` object — Details on the flag used in this experiment
    - `reallocationFrequencyMillis` integer — The cadence (in milliseconds) to update the allocation. Only present for multi-armed bandits.
    - `version` integer — The current version that the iteration is on
    - `primaryMetric` DependentMetricOrMetricGroupRep
      - `key` string, required — A unique key to reference the metric or metric group
      - `_versionId` string, required — The version ID of the metric or metric group
      - `name` string, required — A human-friendly name for the metric or metric group
      - `kind` 'pageview' | 'click' | 'custom' | 'funnel' | 'standard' | 'guardrail', required — If this is a metric, then it represents the kind of event the metric tracks. If this is a metric group, then it represents the group type
      - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
      - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
      - `_links` object, required — The location and content type of related resources
      - `isGroup` boolean, required — Whether this is a metric group or a metric
      - `metrics` MetricInGroupRep[] — An ordered list of the metrics in this metric group
        - `key` string, required — The metric key
        - `_versionId` string — The version ID of the metric
        - `name` string, required — The metric name
        - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
        - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
        - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
        - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
        - `_links` object, required — The location and content type of related resources
        - `nameInGroup` string — Name of the metric when used within the associated metric group. Can be different from the original name of the metric. Required if and only if the metric group is a <code>funnel</code>.
        - `randomizationUnits` string[] — The randomization units for the metric
    - `primarySingleMetric` MetricV2Rep
      - `key` string, required — The metric key
      - `_versionId` string — The version ID of the metric
      - `name` string, required — The metric name
      - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
      - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
      - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
      - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
      - `_links` object, required — The location and content type of related resources
    - `primaryFunnel` DependentMetricGroupRepWithMetrics
      - `key` string, required — A unique key to reference the metric group
      - `name` string, required — A human-friendly name for the metric group
      - `kind` 'funnel' | 'standard' | 'guardrail', required — The type of the metric group
      - `_links` object, required — The location and content type of related resources
      - `metrics` MetricInGroupRep[] — The metrics in the metric group
        - `key` string, required — The metric key
        - `_versionId` string — The version ID of the metric
        - `name` string, required — The metric name
        - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
        - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
        - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
        - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
        - `_links` object, required — The location and content type of related resources
        - `nameInGroup` string — Name of the metric when used within the associated metric group. Can be different from the original name of the metric. Required if and only if the metric group is a <code>funnel</code>.
        - `randomizationUnits` string[] — The randomization units for the metric
    - `randomizationUnit` string — The unit of randomization for this iteration
    - `attributes` string[] — The available attribute filters for this iteration
    - `treatments` TreatmentRep[] — Details on the variations you are testing in the experiment
      - `_id` string — The treatment ID. This is the variation ID from the flag.
      - `name` string, required — The treatment name. This is the variation name from the flag.
      - `allocationPercent` string, required — The percentage of traffic allocated to this treatment during the iteration
      - `baseline` boolean — Whether this treatment is the baseline to compare other treatments against
      - `parameters` ParameterRep[] — Details on the flag and variation used for this treatment
        - `variationId` string
        - `flagKey` string
    - `secondaryMetrics` MetricV2Rep[] — Deprecated, use <code>metrics</code> instead. Details on the secondary metrics for this experiment.
      - `key` string, required — The metric key
      - `_versionId` string — The version ID of the metric
      - `name` string, required — The metric name
      - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
      - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
      - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
      - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
      - `_links` object, required — The location and content type of related resources
    - `metrics` DependentMetricOrMetricGroupRep[] — Details on the metrics for this experiment
      - `key` string, required — A unique key to reference the metric or metric group
      - `_versionId` string, required — The version ID of the metric or metric group
      - `name` string, required — A human-friendly name for the metric or metric group
      - `kind` 'pageview' | 'click' | 'custom' | 'funnel' | 'standard' | 'guardrail', required — If this is a metric, then it represents the kind of event the metric tracks. If this is a metric group, then it represents the group type
      - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
      - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
      - `_links` object, required — The location and content type of related resources
      - `isGroup` boolean, required — Whether this is a metric group or a metric
      - `metrics` MetricInGroupRep[] — An ordered list of the metrics in this metric group
        - `key` string, required — The metric key
        - `_versionId` string — The version ID of the metric
        - `name` string, required — The metric name
        - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
        - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
        - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
        - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
        - `_links` object, required — The location and content type of related resources
        - `nameInGroup` string — Name of the metric when used within the associated metric group. Can be different from the original name of the metric. Required if and only if the metric group is a <code>funnel</code>.
        - `randomizationUnits` string[] — The randomization units for the metric
    - `layerSnapshot` LayerSnapshotRep
      - `key` string, required — Key of the layer the experiment was part of
      - `name` string, required — Layer name at the time this experiment iteration was stopped
      - `reservationPercent` integer, required — Percent of layer traffic that was reserved in the layer for this experiment iteration
      - `otherReservationPercent` integer, required — Percent of layer traffic that was reserved for other experiments in the same environment, when this experiment iteration was stopped
  - `draftIteration` IterationRep
    - `_id` string — The iteration ID
    - `hypothesis` string, required — The expected outcome of this experiment
    - `status` 'not_started' | 'running' | 'stopped', required — The status of the iteration: <code>not_started</code>, <code>running</code>, <code>stopped</code>
    - `createdAt` integer, required
    - `startedAt` integer
    - `endedAt` integer
    - `winningTreatmentId` string — The ID of the treatment chosen when the experiment stopped
    - `winningReason` string — The reason you stopped the experiment
    - `canReshuffleTraffic` boolean — 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).
    - `flags` object — Details on the flag used in this experiment
    - `reallocationFrequencyMillis` integer — The cadence (in milliseconds) to update the allocation. Only present for multi-armed bandits.
    - `version` integer — The current version that the iteration is on
    - `primaryMetric` DependentMetricOrMetricGroupRep
      - `key` string, required — A unique key to reference the metric or metric group
      - `_versionId` string, required — The version ID of the metric or metric group
      - `name` string, required — A human-friendly name for the metric or metric group
      - `kind` 'pageview' | 'click' | 'custom' | 'funnel' | 'standard' | 'guardrail', required — If this is a metric, then it represents the kind of event the metric tracks. If this is a metric group, then it represents the group type
      - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
      - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
      - `_links` object, required — The location and content type of related resources
      - `isGroup` boolean, required — Whether this is a metric group or a metric
      - `metrics` MetricInGroupRep[] — An ordered list of the metrics in this metric group
        - `key` string, required — The metric key
        - `_versionId` string — The version ID of the metric
        - `name` string, required — The metric name
        - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
        - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
        - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
        - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
        - `_links` object, required — The location and content type of related resources
        - `nameInGroup` string — Name of the metric when used within the associated metric group. Can be different from the original name of the metric. Required if and only if the metric group is a <code>funnel</code>.
        - `randomizationUnits` string[] — The randomization units for the metric
    - `primarySingleMetric` MetricV2Rep
      - `key` string, required — The metric key
      - `_versionId` string — The version ID of the metric
      - `name` string, required — The metric name
      - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
      - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
      - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
      - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
      - `_links` object, required — The location and content type of related resources
    - `primaryFunnel` DependentMetricGroupRepWithMetrics
      - `key` string, required — A unique key to reference the metric group
      - `name` string, required — A human-friendly name for the metric group
      - `kind` 'funnel' | 'standard' | 'guardrail', required — The type of the metric group
      - `_links` object, required — The location and content type of related resources
      - `metrics` MetricInGroupRep[] — The metrics in the metric group
        - `key` string, required — The metric key
        - `_versionId` string — The version ID of the metric
        - `name` string, required — The metric name
        - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
        - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
        - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
        - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
        - `_links` object, required — The location and content type of related resources
        - `nameInGroup` string — Name of the metric when used within the associated metric group. Can be different from the original name of the metric. Required if and only if the metric group is a <code>funnel</code>.
        - `randomizationUnits` string[] — The randomization units for the metric
    - `randomizationUnit` string — The unit of randomization for this iteration
    - `attributes` string[] — The available attribute filters for this iteration
    - `treatments` TreatmentRep[] — Details on the variations you are testing in the experiment
      - `_id` string — The treatment ID. This is the variation ID from the flag.
      - `name` string, required — The treatment name. This is the variation name from the flag.
      - `allocationPercent` string, required — The percentage of traffic allocated to this treatment during the iteration
      - `baseline` boolean — Whether this treatment is the baseline to compare other treatments against
      - `parameters` ParameterRep[] — Details on the flag and variation used for this treatment
        - `variationId` string
        - `flagKey` string
    - `secondaryMetrics` MetricV2Rep[] — Deprecated, use <code>metrics</code> instead. Details on the secondary metrics for this experiment.
      - `key` string, required — The metric key
      - `_versionId` string — The version ID of the metric
      - `name` string, required — The metric name
      - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
      - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
      - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
      - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
      - `_links` object, required — The location and content type of related resources
    - `metrics` DependentMetricOrMetricGroupRep[] — Details on the metrics for this experiment
      - `key` string, required — A unique key to reference the metric or metric group
      - `_versionId` string, required — The version ID of the metric or metric group
      - `name` string, required — A human-friendly name for the metric or metric group
      - `kind` 'pageview' | 'click' | 'custom' | 'funnel' | 'standard' | 'guardrail', required — If this is a metric, then it represents the kind of event the metric tracks. If this is a metric group, then it represents the group type
      - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
      - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
      - `_links` object, required — The location and content type of related resources
      - `isGroup` boolean, required — Whether this is a metric group or a metric
      - `metrics` MetricInGroupRep[] — An ordered list of the metrics in this metric group
        - `key` string, required — The metric key
        - `_versionId` string — The version ID of the metric
        - `name` string, required — The metric name
        - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
        - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
        - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
        - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
        - `_links` object, required — The location and content type of related resources
        - `nameInGroup` string — Name of the metric when used within the associated metric group. Can be different from the original name of the metric. Required if and only if the metric group is a <code>funnel</code>.
        - `randomizationUnits` string[] — The randomization units for the metric
    - `layerSnapshot` LayerSnapshotRep
      - `key` string, required — Key of the layer the experiment was part of
      - `name` string, required — Layer name at the time this experiment iteration was stopped
      - `reservationPercent` integer, required — Percent of layer traffic that was reserved in the layer for this experiment iteration
      - `otherReservationPercent` integer, required — Percent of layer traffic that was reserved for other experiments in the same environment, when this experiment iteration was stopped
  - `previousIterations` IterationRep[] — Details on the previous iterations for this experiment.
    - `_id` string — The iteration ID
    - `hypothesis` string, required — The expected outcome of this experiment
    - `status` 'not_started' | 'running' | 'stopped', required — The status of the iteration: <code>not_started</code>, <code>running</code>, <code>stopped</code>
    - `createdAt` integer, required
    - `startedAt` integer
    - `endedAt` integer
    - `winningTreatmentId` string — The ID of the treatment chosen when the experiment stopped
    - `winningReason` string — The reason you stopped the experiment
    - `canReshuffleTraffic` boolean — 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).
    - `flags` object — Details on the flag used in this experiment
    - `reallocationFrequencyMillis` integer — The cadence (in milliseconds) to update the allocation. Only present for multi-armed bandits.
    - `version` integer — The current version that the iteration is on
    - `primaryMetric` DependentMetricOrMetricGroupRep
      - `key` string, required — A unique key to reference the metric or metric group
      - `_versionId` string, required — The version ID of the metric or metric group
      - `name` string, required — A human-friendly name for the metric or metric group
      - `kind` 'pageview' | 'click' | 'custom' | 'funnel' | 'standard' | 'guardrail', required — If this is a metric, then it represents the kind of event the metric tracks. If this is a metric group, then it represents the group type
      - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
      - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
      - `_links` object, required — The location and content type of related resources
      - `isGroup` boolean, required — Whether this is a metric group or a metric
      - `metrics` MetricInGroupRep[] — An ordered list of the metrics in this metric group
        - `key` string, required — The metric key
        - `_versionId` string — The version ID of the metric
        - `name` string, required — The metric name
        - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
        - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
        - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
        - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
        - `_links` object, required — The location and content type of related resources
        - `nameInGroup` string — Name of the metric when used within the associated metric group. Can be different from the original name of the metric. Required if and only if the metric group is a <code>funnel</code>.
        - `randomizationUnits` string[] — The randomization units for the metric
    - `primarySingleMetric` MetricV2Rep
      - `key` string, required — The metric key
      - `_versionId` string — The version ID of the metric
      - `name` string, required — The metric name
      - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
      - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
      - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
      - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
      - `_links` object, required — The location and content type of related resources
    - `primaryFunnel` DependentMetricGroupRepWithMetrics
      - `key` string, required — A unique key to reference the metric group
      - `name` string, required — A human-friendly name for the metric group
      - `kind` 'funnel' | 'standard' | 'guardrail', required — The type of the metric group
      - `_links` object, required — The location and content type of related resources
      - `metrics` MetricInGroupRep[] — The metrics in the metric group
        - `key` string, required — The metric key
        - `_versionId` string — The version ID of the metric
        - `name` string, required — The metric name
        - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
        - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
        - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
        - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
        - `_links` object, required — The location and content type of related resources
        - `nameInGroup` string — Name of the metric when used within the associated metric group. Can be different from the original name of the metric. Required if and only if the metric group is a <code>funnel</code>.
        - `randomizationUnits` string[] — The randomization units for the metric
    - `randomizationUnit` string — The unit of randomization for this iteration
    - `attributes` string[] — The available attribute filters for this iteration
    - `treatments` TreatmentRep[] — Details on the variations you are testing in the experiment
      - `_id` string — The treatment ID. This is the variation ID from the flag.
      - `name` string, required — The treatment name. This is the variation name from the flag.
      - `allocationPercent` string, required — The percentage of traffic allocated to this treatment during the iteration
      - `baseline` boolean — Whether this treatment is the baseline to compare other treatments against
      - `parameters` ParameterRep[] — Details on the flag and variation used for this treatment
        - `variationId` string
        - `flagKey` string
    - `secondaryMetrics` MetricV2Rep[] — Deprecated, use <code>metrics</code> instead. Details on the secondary metrics for this experiment.
      - `key` string, required — The metric key
      - `_versionId` string — The version ID of the metric
      - `name` string, required — The metric name
      - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
      - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
      - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
      - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
      - `_links` object, required — The location and content type of related resources
    - `metrics` DependentMetricOrMetricGroupRep[] — Details on the metrics for this experiment
      - `key` string, required — A unique key to reference the metric or metric group
      - `_versionId` string, required — The version ID of the metric or metric group
      - `name` string, required — A human-friendly name for the metric or metric group
      - `kind` 'pageview' | 'click' | 'custom' | 'funnel' | 'standard' | 'guardrail', required — If this is a metric, then it represents the kind of event the metric tracks. If this is a metric group, then it represents the group type
      - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
      - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
      - `_links` object, required — The location and content type of related resources
      - `isGroup` boolean, required — Whether this is a metric group or a metric
      - `metrics` MetricInGroupRep[] — An ordered list of the metrics in this metric group
        - `key` string, required — The metric key
        - `_versionId` string — The version ID of the metric
        - `name` string, required — The metric name
        - `kind` 'pageview' | 'click' | 'custom', required — The kind of event the metric tracks
        - `isNumeric` boolean — For custom metrics, whether to track numeric changes in value against a baseline (<code>true</code>) or to track a conversion when an end user takes an action (<code>false</code>).
        - `unitAggregationType` 'sum' | 'average' — The type of unit aggregation to use for the metric
        - `eventKey` string — The event key sent with the metric. Only relevant for custom metrics.
        - `_links` object, required — The location and content type of related resources
        - `nameInGroup` string — Name of the metric when used within the associated metric group. Can be different from the original name of the metric. Required if and only if the metric group is a <code>funnel</code>.
        - `randomizationUnits` string[] — The randomization units for the metric
    - `layerSnapshot` LayerSnapshotRep
      - `key` string, required — Key of the layer the experiment was part of
      - `name` string, required — Layer name at the time this experiment iteration was stopped
      - `reservationPercent` integer, required — Percent of layer traffic that was reserved in the layer for this experiment iteration
      - `otherReservationPercent` integer, required — Percent of layer traffic that was reserved for other experiments in the same environment, when this experiment iteration was stopped

## Other responses

- `400` — Invalid request
- `401` — Invalid access token
- `403` — Forbidden
- `404` — Invalid resource identifier
- `409` — Conflict
- `429` — Rate limited

## Changes

- **2026-02-28** `69c5c9aafe78` — 9 warning, 28 info
  - added the new `not_started` enum value to the `currentIteration/status` response property for the response status `200`
  - added the new `not_started` enum value to the `draftIteration/status` response property for the response status `200`
  - added the new `not_started` enum value to the `previousIterations/items/status` response property for the response status `200`
  - added the new `running` enum value to the `currentIteration/status` response property for the response status `200`
  - …33 more
- **2025-07-08** `b2724c5174d1` — 9 warning
  - added the new `guardrail` enum value to the `currentIteration/metrics/items/kind` response property for the response status `200`
  - added the new `guardrail` enum value to the `currentIteration/primaryFunnel/kind` response property for the response status `200`
  - added the new `guardrail` enum value to the `currentIteration/primaryMetric/kind` response property for the response status `200`
  - added the new `guardrail` enum value to the `draftIteration/metrics/items/kind` response property for the response status `200`
  - …5 more

[Change history](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/changes/api/v2/projects/:projectKey/environments/:environmentKey/experiments/:experimentKey/patch.md)

---

[API](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api.md) · [All operations](https://skmtc.dev/launchdarkly/apis/launchdarkly-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/launchdarkly/launchdarkly-rest-api/revisions/69c5c9aafe78/schema)
