Get experiments
Get details about all experiments in an environment.
Filtering experiments
LaunchDarkly supports the filter query param for filtering, with the following fields:
- flagKey filters for only experiments that use the flag with the given key.
- metricKey filters for only experiments that use the metric with the given key.
- status filters for only experiments with an iteration with the given status. An iteration can have the status not_started, running or stopped.
For example, filter=flagKey:my-flag,status:running,metricKey:page-load-ms filters for experiments for the given flag key and the given metric key which have a currently running iteration.
Expanding the experiments response
LaunchDarkly supports four fields for expanding the "Get experiments" response. By default, these fields are not included in the response.
To expand the response, append the expand query parameter and add a comma-separated list with any of the following fields:
- previousIterations includes all iterations prior to the current iteration. By default only the current iteration is included in the response.
- draftIteration includes the iteration which has not been started yet, if any.
- secondaryMetrics includes secondary metrics. By default only the primary metric is included in the response.
- treatments includes all treatment and parameter details. By default treatment data is not included in the response.
For example, expand=draftIteration,treatments includes the draftIteration and treatments fields in the response. If fields that you request with the expand query parameter are empty, they are not included in the response.
Path parameters
The project key
The project key
The environment key
The environment key
Query parameters
The maximum number of experiments to return. Defaults to 20.
The maximum number of experiments to return. Defaults to 20.
Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query limit.
Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query limit.
A comma-separated list of filters. Each filter is of the form field:value. Supported fields are explained above.
A comma-separated list of filters. Each filter is of the form field:value. Supported fields are explained above.
A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.
A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.
A comma-separated list of experiment archived states. Supports archived, active, or both. Defaults to active experiments.
A comma-separated list of experiment archived states. Supports archived, active, or both. Defaults to active experiments.
Response
Experiment collection response
Example response
{
"items": [
{
"_id": "12ab3c45de678910fgh12345",
"key": "experiment-key-123abc",
"name": "Example experiment",
"description": "An example experiment, used in testing",
"_maintainerId": "12ab3c45de678910fgh12345",
"tags": [
"experiment",
"feature"
],
"_links": {
"parent": {
"href": "/api/v2/projects/my-project/environments/my-environment",
"type": "application/json"
},
"self": {
"href": "/api/v2/projects/my-project/environments/my-environment/experiments/my-experiment",
"type": "application/json"
}
},
"holdoutId": "f3b74309-d581-44e1-8a2b-bb2933b4fe40",
"currentIteration": {
"_id": "12ab3c45de678910fgh12345",
"hypothesis": "The new button placement will increase conversion",
"status": "running",
"winningTreatmentId": "122c9f3e-da26-4321-ba68-e0fc02eced58",
"winningReason": "We ran this iteration for two weeks and the winning variation was clear",
"canReshuffleTraffic": true,
"reallocationFrequencyMillis": 3600000,
"primaryMetric": {
"key": "metric-key-123abc",
"name": "My metric",
"kind": "custom",
"isNumeric": true,
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"metrics": [
{
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"nameInGroup": "Step 1",
"randomizationUnits": [
"user"
]
}
]
},
"primarySingleMetric": {
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
}
},
"primaryFunnel": {
"key": "metric-group-key-123abc",
"name": "My metric group",
"kind": "funnel",
"_links": {
"parent": {
"href": "/api/v2/projects/my-project",
"type": "application/json"
},
"self": {
"href": "/api/v2/projects/my-project/metric-groups/my-metric-group",
"type": "application/json"
}
},
"metrics": [
{
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"nameInGroup": "Step 1",
"randomizationUnits": [
"user"
]
}
]
},
"randomizationUnit": "user",
"treatments": [
{
"_id": "122c9f3e-da26-4321-ba68-e0fc02eced58",
"name": "Treatment 1",
"allocationPercent": "10",
"baseline": true
}
],
"secondaryMetrics": [
{
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
}
}
],
"metrics": [
{
"key": "metric-key-123abc",
"name": "My metric",
"kind": "custom",
"isNumeric": true,
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"metrics": [
{
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"nameInGroup": "Step 1",
"randomizationUnits": [
"user"
]
}
]
}
],
"layerSnapshot": {
"key": "checkout-flow",
"name": "Checkout Flow",
"reservationPercent": 10,
"otherReservationPercent": 70
}
},
"draftIteration": {
"_id": "12ab3c45de678910fgh12345",
"hypothesis": "The new button placement will increase conversion",
"status": "running",
"winningTreatmentId": "122c9f3e-da26-4321-ba68-e0fc02eced58",
"winningReason": "We ran this iteration for two weeks and the winning variation was clear",
"canReshuffleTraffic": true,
"reallocationFrequencyMillis": 3600000,
"primaryMetric": {
"key": "metric-key-123abc",
"name": "My metric",
"kind": "custom",
"isNumeric": true,
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"metrics": [
{
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"nameInGroup": "Step 1",
"randomizationUnits": [
"user"
]
}
]
},
"primarySingleMetric": {
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
}
},
"primaryFunnel": {
"key": "metric-group-key-123abc",
"name": "My metric group",
"kind": "funnel",
"_links": {
"parent": {
"href": "/api/v2/projects/my-project",
"type": "application/json"
},
"self": {
"href": "/api/v2/projects/my-project/metric-groups/my-metric-group",
"type": "application/json"
}
},
"metrics": [
{
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"nameInGroup": "Step 1",
"randomizationUnits": [
"user"
]
}
]
},
"randomizationUnit": "user",
"treatments": [
{
"_id": "122c9f3e-da26-4321-ba68-e0fc02eced58",
"name": "Treatment 1",
"allocationPercent": "10",
"baseline": true
}
],
"secondaryMetrics": [
{
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
}
}
],
"metrics": [
{
"key": "metric-key-123abc",
"name": "My metric",
"kind": "custom",
"isNumeric": true,
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"metrics": [
{
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"nameInGroup": "Step 1",
"randomizationUnits": [
"user"
]
}
]
}
],
"layerSnapshot": {
"key": "checkout-flow",
"name": "Checkout Flow",
"reservationPercent": 10,
"otherReservationPercent": 70
}
},
"previousIterations": [
{
"_id": "12ab3c45de678910fgh12345",
"hypothesis": "The new button placement will increase conversion",
"status": "running",
"winningTreatmentId": "122c9f3e-da26-4321-ba68-e0fc02eced58",
"winningReason": "We ran this iteration for two weeks and the winning variation was clear",
"canReshuffleTraffic": true,
"reallocationFrequencyMillis": 3600000,
"primaryMetric": {
"key": "metric-key-123abc",
"name": "My metric",
"kind": "custom",
"isNumeric": true,
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"metrics": [
{
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"nameInGroup": "Step 1",
"randomizationUnits": [
"user"
]
}
]
},
"primarySingleMetric": {
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
}
},
"primaryFunnel": {
"key": "metric-group-key-123abc",
"name": "My metric group",
"kind": "funnel",
"_links": {
"parent": {
"href": "/api/v2/projects/my-project",
"type": "application/json"
},
"self": {
"href": "/api/v2/projects/my-project/metric-groups/my-metric-group",
"type": "application/json"
}
},
"metrics": [
{
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"nameInGroup": "Step 1",
"randomizationUnits": [
"user"
]
}
]
},
"randomizationUnit": "user",
"treatments": [
{
"_id": "122c9f3e-da26-4321-ba68-e0fc02eced58",
"name": "Treatment 1",
"allocationPercent": "10",
"baseline": true
}
],
"secondaryMetrics": [
{
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
}
}
],
"metrics": [
{
"key": "metric-key-123abc",
"name": "My metric",
"kind": "custom",
"isNumeric": true,
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"metrics": [
{
"key": "metric-key-123abc",
"_versionId": "version-id-123abc",
"name": "Example metric",
"kind": "custom",
"isNumeric": true,
"unitAggregationType": "sum",
"eventKey": "event-key-123abc",
"_links": {
"self": {
"href": "/api/v2/metrics/my-project/my-metric",
"type": "application/json"
}
},
"nameInGroup": "Step 1",
"randomizationUnits": [
"user"
]
}
]
}
],
"layerSnapshot": {
"key": "checkout-flow",
"name": "Checkout Flow",
"reservationPercent": 10,
"otherReservationPercent": 70
}
}
]
}
]
}