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

Update an Experiment

Update an experiment by ID.

Path Params
int64
required

The Experiment ID of the Experiment you want to change

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. resume resumes the experiment from a paused status without publishing any new changes. Status will be running. unarchive unarchives an archived experiment. Status will be paused.

Allowed:
Body Params

A string in JSON format that includes all the fields you'd like to change for an Experiment except when action=unarchive then set the payload as an empty JSON object ie. {}

string

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

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.

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 idz for this Experiment within the Project. Only applicable for Full Stack and Mobile projects.

metrics
array of objects

An ordered list of metrics to track for the Experiment

metrics
string

Name of the Experiment

page_ids
array of int64s

A list of Page IDs used in the Experiment. Only url_targeting or page_ids can be used when updating an experiment, but not both.

page_ids
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.

url_targeting
object
variations
array of objects

List of IDs of all variations in the Experiment

variations
whitelist
array of objects

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

whitelist
Responses

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