Create experiment

Create an experiment. To run this experiment, you'll need to [create an iteration](https://launchdarkly.com/docs/api/experiments/create-iteration) and then [update the experiment](https://launchdarkly.com/docs/api/experiments/patch-experiment) with the `startIteration` instruction. ### Experiment types Use the `type` field to specify the experiment type: `experiment` (default), `mab` (multi-armed bandit), or `holdout`. For multi-armed bandit experiments, set `reallocationFrequencyMillis` on the iteration to control how often traffic is reallocated across variations. ### Results analysis Use the `methodology` field to specify the results analysis approach: `bayesian` (default) or `frequentist`. Use the `dataSource` field to specify the source of metric data: `launchdarkly` (default), `snowflake`, or `databricks`. Use the `analysisConfig` field to customize analysis settings such as the Bayesian threshold, significance threshold, or multiple comparison correction method. To learn more, read [Creating experiments](https://launchdarkly.com/docs/home/experimentation/create).

Authentication

Authorizationstring
API Key authentication via header

Path parameters

projectKeystringRequiredformat: "string"
The project key
environmentKeystringRequiredformat: "string"
The environment key

Request

This endpoint expects an object.
namestringRequired
The experiment name
keystringRequired
The experiment key
iterationobjectRequired
Details on the construction of the initial iteration
descriptionstringOptional
The experiment description
maintainerIdstringOptional
The ID of the member who maintains this experiment
holdoutIdstringOptional
The ID of the holdout
tagslist of stringsOptional
Tags for the experiment
methodologyenumOptional
The results analysis approach.
analysisConfigobjectOptional
Details of the Analysis Configuration for this experiment
dataSourceenumOptional
The source of metric data in order to analyze results. Defaults to "launchdarkly" when not provided.
typeenumOptional
The type of experiment.

Response

Experiment response
keystring
The experiment key
namestring
The experiment name
_maintainerIdstring
The ID of the member who maintains this experiment.
_creationDatelong
Timestamp of when the experiment was created
environmentKeystring
_idstringOptional
The experiment ID
descriptionstringOptional
The experiment description
methodologyenumOptional
The results analysis approach.
dataSourceenumOptional
The source of metric data in order to analyze results. Defaults to "launchdarkly" when not provided.
archivedDatelongOptional
Timestamp of when the experiment was archived
tagslist of stringsOptional
Tags for the experiment
holdoutIdstringOptional
The holdout ID
currentIterationobjectOptional
Details on the current iteration
typestringOptional
The experiment type
_accessobjectOptional
Details on the allowed and denied actions for this experiment
draftIterationobjectOptional
Details on the current iteration. This iteration may be already started, or may still be a draft.
previousIterationslist of objectsOptional
Details on the previous iterations for this experiment.
analysisConfigobjectOptional
Details of the Analysis Configuration for this experiment.
mutableFieldsByStatusobjectOptional
Fields that can be changed for each iteration status.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error