The availability of features may depend on your plan type. Contact your Customer Success Manager if you have any questions.
Dev guideRecipesAPI ReferenceChangelog
Dev guideAPI ReferenceRecipesChangelogUser GuideGitHubDev CommunityOptimizely AcademySubmit a ticketLog In
API Reference

Create an Experiment

Create an Experiment in a Project

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
string
enum

Action to change the state of the experiment. publish saves and stages your experiment. If you have not started your experiment or the experiment is paused, your changes will not be visible to visitors when you publish. start makes your experiment live to all visitors who are in your targeted audience and changes the status to running. pause stops the experiment and changes the status to paused. No new visitors will see a paused experiment until you restart it. See Differences among publish, start, and pause for details.

Allowed:
Body Params

A string in JSON format that includes all the fields to create an Experiment

string
Defaults to everyone

The audiences that should see this experiment. To target everyone, use the string "everyone" or omit this field. Multiple audiences can be combined with "and" or "or" using the same structure as audience conditions

int64

For Personalization experiences, this ID corresponds to the parent Campaign. For standalone experiments this campaign_id does not correspond to a campaign object.

changes
array of objects

Custom CSS or JavaScript that will run before all variations in the Experiment (for Experiments in Web Projects only)

changes
string

The description or hypothesis for an Experiment

environments
object

String identifier for the Experiment's status in each Environment based on the environment key.

int64

The ID of a Feature to attach to the Experiment. This turns an Experiment into a Feature Test.

string

The key for the Feature attached to the Experiment. Applies to Feature Tests only. Valid keys contain alphanumeric characters, hyphens, and underscores, and are limited to 64 characters.

string

The feature flag name to display in the Optimizely app. Whitespaces and other non-alphanumeric characters allowed. Defaults to feature key if left empty.

integer
0 to 10000

Percent of traffic to exclude from the experiment, measured in basis points. 100 basis points = 1% traffic. For example, a value of 9900 would mean that 1% of visitors will be eligible for the experiment. This is only applicable for Web.

string
length ≤ 64

Unique string identifier for this Experiment within the Project. Only applicable for Full Stack and Mobile projects.

metrics
array of objects
Defaults to

An ordered list of metrics to track for the Experiment. Required for Web, Full Stack, and Mobile Experimentation. Not applicable for Web Personalization Experiences.

metrics
string
enum

For Experiments of type multivariate, this specifies how the weights and statuses of combinations will be decided. In full_factorial mode, | combination weights are read-only, and are generated by multiplying together weights of section variations.

Allowed:
string

Name of the Experiment. Required for Web Experimentation. Optional for Web Personalization experiences and Full Stack experiments. Not applicable for Mobile Experiments.

page_ids
array of int64s

A list of Page IDs used in the Experiment. url_targeting or page_ids, but not both.

page_ids
int64
required

The Project the Experiment is in

string

temporary token based on experiment id, used to access data platform services from other parts of the product

schedule
object
integer
0 to 10000

Percent of traffic allocated for the experiment, measured in basis points. 100 basis points = 1% traffic. For example, a value of 5500 would mean that 55% of visitors will be eligible for the experiment. This is only applicable for Full Stack.

string
enum
Defaults to a/b

Indicates whether this is an a/b, multivariate, feature, or multiarmed_bandit test or an experience within a personalization campaign. Note that the default for this field is a/b. If another test type is desired, populate this field with the appropriate string (from one of the possible values).

Allowed:
url_targeting
object
variations
array of objects

A list of variations that each define an experience to show in the context of the Experiment for the purpose of comparison against each other

variations
whitelist
array of objects

A list containing the user IDs and variations of users who have been whitelisted

whitelist
Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json