---
title: "Read an Experiment"
method: GET
path: "/experiments/{experiment_id}"
tags: ["Experiments"]
---

# Read an Experiment

`GET /experiments/{experiment_id}`

Get metadata for a single Experiment

## Path parameters

- `experiment_id` integer, required

## Response `200`

Return Experiment info

- Experiment
  - `allocation_policy` string — Traffic allocation policy across variations in this experiment
  - `audience_conditions` string — 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_id` integer — For Personalization experiences, this ID corresponds to the parent Campaign. For standalone experiments this campaign_id does not correspond to a campaign object.
  - `changes` SharedCodeChange[] — Custom CSS or JavaScript that will run before all variations in the Experiment (for Experiments in Web Projects only)
    - `async` boolean — Indicates whether or not to execute the change asyncronously. If true, src will be returned in the response. Otherwise, it will be not included.
    - `dependencies` string[] — A list of dependent change IDs that must happen before this change
    - `id` string, uuid — The ID of the change
    - `name` string — Name of the change
    - `selector` string — CSS selector to determine where changes are applied. Required for changes of type 'custom_css'.
    - `src` string — The path to the change payload on the CDN. Only present if 'async' is True.
    - `type` 'custom_code' | 'custom_css', required — The type of this change.
    - `value` string, required — The value for the change can be JavaScript or CSS as a string.
  - `created` string, date-time — The time when the Experiment was initially created
  - `custom_field_values` object — 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.
  - `description` string — The description or hypothesis for an Experiment
  - `earliest` string, date-time — The first time the Experiment was activated
  - `environments` object — String identifier for the Experiment's status in each Environment based on the environment key.
  - `feature_id` integer — The ID of a Feature to attach to the Experiment. This turns an Experiment into a Feature Test.
  - `feature_key` 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.
  - `feature_name` 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.
  - `holdback` integer — 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.
  - `id` integer — The unique identifier for the Experiment
  - `is_classic` boolean — Whether or not the Experiment is a classic Experiment. If true, the Experiment is read-only
  - `key` string — Unique string identifier for this Experiment within the Project. Only applicable for Full Stack and Mobile projects.
  - `last_modified` string, date-time — The last time the Experiment was modified
  - `latest` string, 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.
  - `metrics` Metric[] — An ordered list of metrics to track for the Experiment. Required for Web, Full Stack, and Mobile Experimentation. Not applicable for Web Personalization Experiences.
    - `aggregator` 'unique' | 'count' | 'sum' | 'bounce' | 'exit' | 'ratio' — The aggregation function for the numerator of the metric. 'unique' measures the number of unique visitors/sessions that include the specified Event. 'count' measures the total number of occurrences of Event for the scope (visitor/session). 'sum' is the sum of the 'field' value
    - `display_title` string — Display title for the metric
    - `event_id` integer, nullable — The ID for the Event to select data from. Omitted for global metrics that are not relative to a specific Event, i.e. "overall revenue"
    - `event_properties` MetricEventProperties — The conditions used to filter the metric on specific event property values.
      - `filter` MetricFilter — The set of event property conditions a conversion must match to be counted toward the metric.
        - `combine_operator` 'and' | 'or' — Determines whether all conditions (and) or any condition (or) must be met.
        - `conditions` MetricFilterCondition[]
          - `name` string — The name of the event property to match to.
          - `operator` 'equal_to' | 'not_equal_to' | 'greater_than' | 'greater_than_or_equal_to' | 'less_than' | 'less_than_or_equal_to' | 'contains' | 'does_not_contain' — The type of match to be performed. equal_to and not_equal_to are available for all property types. greater_than, greater_than_or_equal_to, less_than, and less_than_or_equal_to are only available for properties with type number. contains and does_not_contain are only available for properties with type string.
          - `type` 'boolean' | 'number' | 'string' — The data type of the event property.
          - `value` string — The value the conversion's property should match, according to the operator.
    - `field` 'revenue' | 'value' — The field to aggregate for the numerator of the metric. Required when 'aggregator' = 'sum', otherwise omitted
    - `metrics` CompoundSubMetric[] — A list of all metrics that will be used in the calculation of a ratio metric.
      - `aggregator` 'unique' | 'count' | 'sum' — The aggregation function for the numerator of the metric. 'unique' measures the number of unique visitors/sessions that include the specified Event. 'count' measures the total number of occurrences of Event for the scope (visitor/session). 'sum' is the sum of the 'field' value.
      - `event_id` integer, nullable — The ID for the Event to select data from.
      - `event_type` 'custom' | 'click' | 'pageview' — The type of this Event.
      - `field` 'revenue' | 'value', nullable — The field to aggregate for the numerator of the metric. Required when 'aggregator' = 'sum', otherwise omitted.
      - `scope` 'session' | 'visitor' | 'event' — Specifies how Events should be grouped. Can also be thought of as the denominator of the metric. 'session' divides by the number of sessions. "Influenced sessions", or sessions that do not contain a decision Event but carry a decision from a previous session are not included in counts for numerator or denominator. 'visitor' divides by the number of visitors. 'event' divides by the total occurrences (impressions) of the specified Event.
    - `scope` 'session' | 'visitor' | 'event' — Specifies how Events should be grouped together. Can also be thought of as the denonimator of the metric. 'session' divides by the number of sessions. "Influenced sessions", or sessions that do not contain a decision Event but carry a decision from a previous session are not included in counts for numerator or denominator. 'visitor' divides by the number of visitors. 'event' divides by the total occurrences (impressions) of the specified Event
    - `time_window` string — The maximum amount of time a numerator event can differ from a denominator event in order to be included in a ratio metric. This can be an integer, or an integer followed by a letter denoting the unit of time (d = days, h = hours, m = minutes). If no unit of time is supplied, hours is assumed. If no value is supplied, a time window of 48 hours is assumed.
    - `winning_direction` 'increasing' | 'decreasing' — The winning direction of this metric
  - `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.
  - `name` 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` integer[] — A list of Page IDs used in the Experiment. `url_targeting` or `page_ids`, but not both.
  - `project_id` integer, required — The Project the Experiment is in
  - `results_token` string — temporary token based on experiment id, used to access data platform services from other parts of the product
  - `schedule` Schedule
    - `start_time` string — The start time for the Experiment, in date-time or date format (as defined by ISO 8601), and rounded to the nearest minute. If only date is supplied without time, the start time defaults to 00:00 on the specified start date.
    - `stop_time` string — The stop time for the Experiment, in date-time or full-date format (as defined by ISO 8601), and rounded to the nearest minute. If only date is supplied without time, the stop time defaults to 00:00 on the specified stop date.
    - `time_zone` string — The time zone to use for Experiment start and stop times with respect to an IANA time zone (ex. "America/New_York"). The time zones expressed by GMT (e.g. "GMT-08:00") are no longer supported.
  - `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_allocation` integer — 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).
  - `url_targeting` URLTargeting
    - `activation_code` string — Stringified Javascript function that determines when the Page is activated. Only required when activation_type is 'polling' or 'callback'.
    - `activation_type` 'immediate' | 'manual' | 'polling' | 'callback' | 'dom_changed' | 'url_changed' — How this page is activated. See the full documentation on the Page object.
    - `conditions` string — Conditions to activate the experiment; our knowledge base article on Activation Types is the best guide for how to set up this data.
    - `edit_url` string, required — URL to load in the editor for this page
    - `key` string — Unique string identifier for this Page within the Project
    - `page_id` integer — The unique identifier of the Page that represents the experiment or campaign's URL Targeting.
  - `variations` Variation[] — 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
    - `actions` Action[] — A collection of changes to run for each page in an experiment. Only applicable to Optimizely X Web.
      - `changes` Change[] — The list of changes to apply to the Page. If 'dependencies' is supplied in a Change within 'changes', each ID in 'dependencies' must also be in 'changes'.
        - `allow_additional_redirect` boolean — Whether or not to allow additional redirects after redirecting to destination. Required for changes of type 'redirect'
        - `async` boolean — Indicates whether or not to execute the change asyncronously. If true, src will be returned in the response. Otherwise, it will be not included.
        - `attributes` ChangeAttribute
          - `class` string — Name of the class to set the element(s) matched by a selector to
          - `hide` boolean — Whether or not to hide the element(s) matched by a selector
          - `href` string — Value of href attribute to add to element(s) matched by a selector
          - `html` string — Value of HTML attribute to add to element(s) matched by a selector
          - `remove` boolean — Whether or not to remove the element(s) matched by a selector
          - `src` string — Value of src attribute to add to element(s) matched by a selector
          - `style` string — Value of style attribute to add to element(s) matched by a selector
          - `text` string — Value of text attribute to add to the element(s) matched by a selector
        - `config` object — Configuration properties for the extension
        - `css` CSSAttribute
          - `background-color` string
          - `background-image` string
          - `border-color` string
          - `border-style` string
          - `border-width` string
          - `color` string
          - `font-family` string
          - `font-size` string
          - `font-weight` string
          - `height` string
          - `position` string
          - `width` string
        - `dependencies` string[] — A list of dependent change IDs that must happen before this change
        - `destination` string — URL to redirect to. Required for changes of type 'redirect'. `destination` and `destination_function` cannot be used at the same time
        - `destination_function` string — A function string to redirect to. Required for changes of type 'redirect'. `destination` and `destination_function` cannot be used at the same time
        - `extension_id` string — ID of the extension to insert. Required for changes of type 'extension'
        - `id` string, uuid — The ID of the change
        - `name` string — Name of the change
        - `operator` string — Where to instert HTML or image for types 'insert_html' and 'insert_image' with respect to the element(s) matched by 'selector'
        - `preserve_parameters` boolean — Whether or not to preserve parameters from original request when redirecting to new destination URL. Required for changes of type 'redirect'. For redirects using `destination_function`, `preserve_parameters` must be false.
        - `rearrange` object — A directive to place the DOM element(s) matched by 'selector' to the position of the element matched by 'insertSelector', with the relation specified by 'operator'. The supplied example moves element matched by 'selector' above the element of class .greyBox
        - `selector` string — CSS selector to determine where changes are applied. Required for changes of type 'attribute', 'insert_html', and 'insert_image'
        - `src` string — The path to the change payload on the CDN. Only present if 'async' is True.
        - `type` 'attribute' | 'custom_code' | 'custom_css' | 'extension' | 'insert_html' | 'insert_image' | 'redirect', required — The type of this change. - Changes of type 'attribute' have required fields 'selector' and 'attributes' - Changes of type 'custom_code' have required field 'value' - Changes of type 'custom_css' have required field 'value' - Changes of type 'extension' have required field 'extension_id' - Changes of type 'insert_html' have required field 'selector' - Changes of type 'insert_image' have required field 'selector' - Changes of type 'redirect' have required fields 'destination', 'preserve_parameters', and 'allow_additional_redirect'
        - `value` string — The value for the change can be custom Javascript or CSS as a string. Required for changes of type 'custom_css' and 'custom_code'
      - `page_id` integer, required — The ID of the Page to apply changes to
      - `share_link` string, url — The share link for the provided Variation and Page combination
    - `archived` boolean — Whether the variation is archived
    - `description` string — A description of the variation.
    - `feature_enabled` boolean — For Feature Tests, indicates if the feature should be enabled for the variation
    - `key` string — Unique string identifier for this variation within the Experiment. Only applicable for Full Stack and Mobile projects.
    - `name` string — The name of the variation. Required for Web Experiments and Personalization experiences. Not required for Full Stack Experiments.
    - `status` 'active' | 'paused' | 'archived' — Current status of the variation
    - `variable_values` object — For Feature Tests, the variable values for the variation represented as a map of Variable keys to their values.
    - `variation_id` integer — The unique identifier for the variation
    - `weight` integer, required — The percentage of your visitors that should see this variation, measured in basis points. 100 basis points = 1% traffic. Variation weights must add up to 10000.
  - `whitelist` object[] — A list containing the user IDs and variations of users who have been whitelisted
    - `user_id` string, required — The ID of the user being whitelisted
    - `variation_id` integer, required — The unique identifier for the variation

## Other responses

- `401` — Invalid credentials
- `403` — You do not have permission to access the specified Experiment
- `404` — Experiment not found
- `default` — Unexpected error

---

[API](https://skmtc.net/optimizely/apis/optimizely-api.md) · [All operations](https://skmtc.net/optimizely/apis/optimizely-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/optimizely/optimizely-api/versions/35d56dc0d1b9/schema)
