Get experiments

GET
/api/v2/projects/:projectKey/environments/:environmentKey/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

projectKeystringRequired

The project key

environmentKeystringRequired

The environment key

Query parameters

limitlongOptional

The maximum number of experiments to return. Defaults to 20.

offsetlongOptional

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.

filterstringOptional

A comma-separated list of filters. Each filter is of the form field:value. Supported fields are explained above.

expandstringOptional

A comma-separated list of properties that can reveal additional information in the response. Supported fields are explained above.

lifecycleStatestringOptional

A comma-separated list of experiment archived states. Supports archived, active, or both. Defaults to active experiments.

Response

Experiment collection response

itemslist of objects

An array of experiments

total_countintegerOptional

The total number of experiments in this project and environment. Does not include legacy experiments.

Errors

Built with