v4

latestOpenAPI 3.0.02026-08-04109113304.5 KB
Experiments

List Experiments

Get a list of all the Experiments by Project or Campaign. Either the <code>project_id</code> or <code>campaign_id</code> query parameter is required.

get/experiments

Query parameters

per_pageinteger

Optional pagination argument that specifies the maximum number of objects to return per request

pageinteger

Optional pagination argument that specifies the page to return. If you have 140 objects and you choose to return 100 objects per page you will be able to access the last 40 objects on page 2. The default value is 1.

project_idinteger

The Project ID of the Project you would like to list all Experiments for. You have to either use this argument or the campaign_id argument

campaign_idinteger

The Campaign ID of the Campaign you would like to list all Experiments for. You have to either use this argument or the project_id argument

Response

Return all Experiments

allocation_policystring

Traffic allocation policy across variations in this experiment

audience_conditionsstring

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

campaign_idinteger

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

createdstring date-time

The time when the Experiment was initially created

custom_field_valuesobject

Map of custom field api_name to value for the Experiment's parent Campaign. Keys correspond to the api_name of a custom field definition for the Project, and values are typed according to that definition's field_type. Returns an empty object when no values are set. May be set when creating an Experiment; on projects with required custom fields these values are mandatory.

descriptionstring

The description or hypothesis for an Experiment

earlieststring date-time

The first time the Experiment was activated

environmentsobject

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

feature_idinteger

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

feature_keystring

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.

feature_namestring

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

holdbackinteger

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.

idinteger

The unique identifier for the Experiment

is_classicboolean

Whether or not the Experiment is a classic Experiment. If true, the Experiment is read-only

keystring

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

last_modifiedstring date-time

The last time the Experiment was modified

lateststring date-time

The last time the Experiment was paused (not present if the Experiment is still running). For campaign experiences, this field represents the last time the Campaign was paused.

multivariate_traffic_policy'full_factorial'

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.

namestring

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

page_idsinteger[]

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

project_idinteger required

The Project the Experiment is in

results_tokenstring

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

status'running' | 'paused' | 'archived' | 'campaign_paused' | 'concluded' | 'not_started'

Current state of the Experiment.<br> In Full Stack, this is the Experiment's state in the primary (production) environment.

traffic_allocationinteger

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.

type'a/b' | 'feature' | 'multivariate' | 'personalization' | 'multiarmed_bandit'

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

Example response

[
  {
    "audience_conditions": "[\"and\", {\"audience_id\": 7000}, {\"audience_id\":7001}]",
    "campaign_id": 2000,
    "changes": [
      {
        "dependencies": [
          "993fd09c-b64a-4c13-95a9-13b3ed2c454e",
          "95cf0144-fb63-431d-829b-193fe55ada18"
        ],
        "name": "Setting button text",
        "selector": "head",
        "value": "window.someGlobalFunction();"
      }
    ],
    "feature_id": 1000,
    "feature_name": "This is the user search feature",
    "holdback": 5000,
    "id": 3000,
    "key": "home_page_experiment",
    "name": "Blue Button Experiment",
    "project_id": 1000,
    "schedule": {
      "start_time": "2019-02-20T15:00",
      "stop_time": "2019-02-20T18:00",
      "time_zone": "America/New_York"
    },
    "traffic_allocation": 5000,
    "url_targeting": {
      "activation_code": "function callbackFn(activate, options) { activate(); }",
      "activation_type": "callback",
      "conditions": "[\"and\", {\"type\": \"url\", \"match_type\": \"substring\", \"value\": \"optimize\"}]",
      "edit_url": "https://www.optimizely.com",
      "key": "home_page",
      "page_id": 6700
    },
    "variations": [
      {
        "actions": [
          {
            "changes": [
              {
                "attributes": {
                  "class": "intro",
                  "href": "example.com",
                  "html": "New Title",
                  "src": "song.mp3",
                  "style": "background-color:blue;",
                  "text": "Some nice message"
                },
                "dependencies": [
                  "ad1f6acb-78f2-4653-b955-913abd777e16",
                  "ad20a6dd-2083-4964-8ed2-f0dc7baef687"
                ],
                "destination": "https://app.optimizely.com/",
                "destination_function": "https://app.optimizely.com/",
                "name": "Setting button text",
                "operator": "after",
                "selector": "a[href*=\"optimizely\"]",
                "value": "window.someGlobalFunction();"
              }
            ]
          }
        ],
        "key": "blue_button_variation",
        "name": "Blue Button"
      }
    ],
    "whitelist": [
      {
        "user_id": "user_1",
        "variation_id": 12345
      }
    ]
  }
]