---
title: Create experiment
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Experiments
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

# Create experiment{% #create-experiment %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                          |
| ----------------- | ----------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/experiments |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/experiments |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/experiments      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/experiments      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/experiments  |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v2/experiments |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/experiments     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/experiments |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/experiments |

### Overview

Create a draft experiment. `name` is required. `structured_metadata` identifies each metadata field by `field_key`; use `freetext_value` for free-text fields and `enum_values` for enum fields. When this attribute is present, the request must include a value for every required metadata field. When `protocol_id` is present, the published protocol supplies the subject type, decision metrics, analysis-plan defaults, and configuration and enforcement baselines. The request may also include hypothesis, tags, teams, related links, and assignment or event date overrides that satisfy the protocol's duration rules; omit subject_type_id, decision_metrics, variants, warehouse_exposure_configuration, datadog_flag_configuration, traffic_exposure, split_by_properties, and structured_metadata. The protocol association cannot be changed after creation. Without `protocol_id`, a complete Warehouse or Datadog configuration saves the experiment and its configuration in one transaction. For Datadog flag configuration, send `name`, `subject_type_id`, `decision_metrics`, `variants`, `traffic_exposure`, `assignments_start_date`, `assignments_end_date`, `events_start_date`, and `events_end_date`. The four date fields can be null. Inside `datadog_flag_configuration`, send `feature_flag_id`, `environment_id`, `targeting_rules`, and `entry_point`. Use `targeting_rules: []` and `entry_point: null` when unused. This creates one saved draft allocation that does not serve traffic. Omit all configuration fields to create an experiment without an allocation. This endpoint is not idempotent. This endpoint requires the `product_analytics_experiments_write` permission.

OAuth apps require the `product_analytics_experiments_write` authorization [scope](https://docs.datadoghq.com/api/latest/scopes.md#experiments) to access this endpoint.



### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field                     | Field                                   | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| -------------------------------- | --------------------------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                                  | data [*required*]                  | object          | Experiment resource to create.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| data                             | attributes [*required*]            | object          | Configuration and descriptive fields for the new experiment draft.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| attributes                       | assignments_end_date                    | date-time       | End of the window assignments are read from. Optional; must be after assignments_start_date.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| attributes                       | assignments_start_date                  | date-time       | Start of the window assignments are read from. Optional.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| attributes                       | datadog_flag_configuration              | object          | Feature flag, environment, and targeting configuration for a Datadog experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| datadog_flag_configuration       | entry_point [*required*]           | object          | Datadog measure and filters used to select analyzed subjects.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| entry_point                      | filters [*required*]               | [array]         | Complete Datadog OR-of-ANDs entry-point filter expression.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| entry_point                      | measure_id [*required*]            | string          | Datadog measure UUID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| datadog_flag_configuration       | environment_id [*required*]        | uuid            | Identifier of the feature flag environment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| datadog_flag_configuration       | feature_flag_id [*required*]       | uuid            | Identifier of the Datadog feature flag used by the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| datadog_flag_configuration       | reset_on_feature_flag_change            | boolean         | Accepted on create but has no effect.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| datadog_flag_configuration       | targeting_rules [*required*]       | [object]        | Use an empty array when no targeting rules apply.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| targeting_rules                  | conditions [*required*]            | [ <oneOf>] | Conditions that must all match for this rule. Each condition must use exactly one shape: saved_filter_id alone or operator plus attribute plus value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| conditions                       | Object 1                                | object          | A condition that uses a saved filter. Inline fields must be omitted or null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Object 1                         | saved_filter_id [*required*]       | uuid            | Saved-filter UUID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| conditions                       | Object 2                                | object          | An inline condition. The saved_filter_id field must be omitted or null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Object 2                         | attribute [*required*]             | string          | Attribute to evaluate.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Object 2                         | operator [*required*]              | enum            | Required with attribute and value for an inline condition; omit when saved_filter_id is set. Allowed enum values: `LT,LTE,GT,GTE,MATCHES,NOT_MATCHES,ONE_OF,NOT_ONE_OF,IS_NULL,EQUALS`                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Object 2                         | value [*required*]                 | [string]        | Values used by the operator. Every operator requires at least one value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| attributes                       | decision_metrics                        | [object]        | Metrics selected to support the experiment decision.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| decision_metrics                 | is_primary [*required*]            | boolean         | Whether this is the experiment primary metric.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| decision_metrics                 | metric_id [*required*]             | uuid            | Decision metric UUID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| attributes                       | events_end_date                         | date-time       | End of the window metric events are read from. Optional; must be after events_start_date.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| attributes                       | events_start_date                       | date-time       | Start of the window metric events are read from. Optional; must fall within the assignments window.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| attributes                       | hypothesis                              | string          | What the experiment is expected to show. Optional and free-form.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| attributes                       | migration_metadata                      |                 | Metadata associated with migration of this resource.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| attributes                       | name [*required*]                  | string          | Display name for the experiment. The only required attribute: a request carrying nothing but a name is accepted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| attributes                       | protocol_id                             | string          | Published protocol whose defaults create this draft. May be combined with hypothesis, tags, teams, related links, and date overrides. Omit subject_type_id, decision_metrics, variants, warehouse_exposure_configuration, datadog_flag_configuration, traffic_exposure, and structured_metadata.                                                                                                                                                                                                                                                                                                                                                     |
| attributes                       | related_links                           | [object]        | External links associated with the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| related_links                    | id                                      | string          | Link ID. Omit it when adding a link.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| related_links                    | title                                   | string          | Optional display title.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| related_links                    | url [*required*]                   | string          | Absolute URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| attributes                       | split_by_properties                     | [object]        | Complete Datadog split-by selection. Identify each property by column_name. Omit this field to copy organization defaults.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| split_by_properties              | column_name [*required*]           | string          | Exposure field that identifies the property.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| split_by_properties              | column_type                             | enum            | Data type of the column evaluated by the entry-point filter. Allowed enum values: `varchar,int,double,boolean,varchar_array,int_array,double_array,raw`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| split_by_properties              | name                                    | string          | Optional display name. Defaults to column_name for a new property.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| attributes                       | structured_metadata                     | [object]        | Custom metadata fields and their values for the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| structured_metadata              | enum_values                             | [string]        | Selected values for an enumerated metadata field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| structured_metadata              | field_key [*required*]             | string          | Key that identifies the metadata field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| structured_metadata              | freetext_value                          | string          | Text value for a free-text metadata field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| attributes                       | subject_type_id                         | uuid            | Canonical ID of an existing subject type. Optional; defaults to the organization default.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| attributes                       | summary                                 | string          | Summary of the experiment. Optional and free-form.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| attributes                       | tags                                    | [string]        | Non-team tag names to apply. Optional.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| attributes                       | teams                                   | [string]        | Team handles that own the experiment. Optional.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| attributes                       | traffic_exposure                        | object          | Traffic exposure fraction or schedule configured for the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| traffic_exposure                 | fraction                                | double          | STATIC exposure fraction. Draft experiments can change this value. After start only warehouse experiments without a Datadog flag can change a STATIC fraction through the public API.                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| traffic_exposure                 | mode [*required*]                  | enum            | Whether exposure uses a fixed fraction or a sequence of steps. Allowed enum values: `STATIC,STEPS`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| traffic_exposure                 | steps                                   | [object]        | Configured exposure plan rather than wall-clock history. At least two steps must have strictly increasing fractions and no gaps. Warehouse steps start at assignments_start_date and can use different durations. New Datadog plans have at most five steps and a first fraction above zero. Their nonfinal durations must be equal and exclude time paused. Datadog steps start with the experiment. Running warehouse experiments can replace step fractions, durations, and the exposure mode. After start, Datadog exposure plans cannot change through the public API. The final duration is null and its fraction holds until assignment ends. |
| steps                            | duration_ms [*required*]           | int64           | Positive step duration in milliseconds. Datadog durations exclude pauses. Send null for the final step.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| steps                            | fraction [*required*]              | double          | Fraction of traffic exposed during this step.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| attributes                       | variants                                | [object]        | Variants selected for the experiment and their traffic allocations.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| variants                         | feature_flag_variant_id                 | uuid            | Stable backing flag variant ID. Required for Datadog-backed experiments and omitted for Warehouse-only experiments.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| variants                         | is_active                               | boolean         | Whether this variant participates in the experiment. Responses always include this field. On writes an included variant defaults to active; omit its row to remove or unselect it. Explicit false supports sending an unchanged response back.                                                                                                                                                                                                                                                                                                                                                                                                       |
| variants                         | is_control [*required*]            | boolean         | Whether this is the single control variant.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| variants                         | key [*required*]                   | string          | Assignment value. Datadog flag variant keys are server-owned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| variants                         | name                                    | string          | Display name. Datadog flag variant names are server-owned.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| variants                         | weight [*required*]                | double          | Traffic allocation percentage. Existing variant weights cannot change through the public API after the experiment starts.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| attributes                       | warehouse_exposure_configuration        | object          | Warehouse model and experiment key used to read assignment data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| warehouse_exposure_configuration | entry_point [*required*]           | object          | Optional Warehouse measure that scopes analyzed subjects.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| entry_point                      | filters [*required*]               | [object]        | Complete ordered Warehouse entry-point filter set.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| filters                          | operation [*required*]             | enum            | Comparison applied by the warehouse entry-point filter. Allowed enum values: `IS,IS_NOT`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| filters                          | property_id [*required*]           | string          | Warehouse property UUID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| filters                          | values [*required*]                | [string]        | Ordered values used by the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| entry_point                      | measure_id [*required*]            | string          | Warehouse measure UUID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| warehouse_exposure_configuration | experiment_key [*required*]        | string          | Warehouse experiment key. Must not be blank.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| warehouse_exposure_configuration | exposure_sql_model_id [*required*] | string          | ID of the exposure SQL model that provides assignment data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| data                             | id                                      | string          | Optional JSON:API resource identifier field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| data                             | type [*required*]                  | enum            | Experiments resource type. Allowed enum values: `experiments`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "type": "experiments",
    "attributes": {
      "name": "ex-14bb9543f523edde"
    }
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response containing an experiment and its configuration.

| Parent field                     | Field                                   | Type            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| -------------------------------- | --------------------------------------- | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                                  | data [*required*]                  | object          | Experiment resource with its identifier and configuration.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| data                             | attributes                              | object          | Details of the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| attributes                       | assignments_end_date                    | date-time       | End of the time window for experiment assignments.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| attributes                       | assignments_start_date                  | date-time       | Start of the time window for experiment assignments.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| attributes                       | concluded_at                            | date-time       | Time when the experiment was concluded.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| attributes                       | conclusion                              | object          | Outcome and supporting text recorded when the experiment is concluded.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| conclusion                       | decision_reason                         | string          | Reason for the recorded decision.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| conclusion                       | outcome                                 | enum            | Recorded experiment outcome. Allowed enum values: `POSITIVE,NEGATIVE,NEUTRAL,INCONCLUSIVE,MISCONFIGURED,UNKNOWN`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| conclusion                       | summary                                 | string          | Summary of the experiment conclusion.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| attributes                       | created_at                              | date-time       | Time when this resource was created.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| attributes                       | datadog_flag_configuration              | object          | Feature flag, environment, and targeting configuration for the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| datadog_flag_configuration       | allocation_key                          | string          | Key of the feature flag allocation linked to the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| datadog_flag_configuration       | entry_point [*required*]           | object          | Datadog measure and filters used to select analyzed subjects.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| entry_point                      | filters [*required*]               | [array]         | Complete Datadog OR-of-ANDs entry-point filter expression.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| entry_point                      | measure_id [*required*]            | string          | Datadog measure UUID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| datadog_flag_configuration       | environment_id                          | string          | ID of the feature flag environment used by the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| datadog_flag_configuration       | feature_flag_id                         | string          | ID of the feature flag linked to the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| datadog_flag_configuration       | targeting_rules                         | [object]        | Rules that select subjects for the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| targeting_rules                  | conditions [*required*]            | [ <oneOf>] | Conditions that must all match for this rule. Each condition must use exactly one shape: saved_filter_id alone or operator plus attribute plus value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| conditions                       | Object 1                                | object          | A condition that uses a saved filter. Inline fields must be omitted or null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| Object 1                         | saved_filter_id [*required*]       | uuid            | Saved-filter UUID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| conditions                       | Object 2                                | object          | An inline condition. The saved_filter_id field must be omitted or null.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Object 2                         | attribute [*required*]             | string          | Attribute to evaluate.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Object 2                         | operator [*required*]              | enum            | Required with attribute and value for an inline condition; omit when saved_filter_id is set. Allowed enum values: `LT,LTE,GT,GTE,MATCHES,NOT_MATCHES,ONE_OF,NOT_ONE_OF,IS_NULL,EQUALS`                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| Object 2                         | value [*required*]                 | [string]        | Values used by the operator. Every operator requires at least one value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| attributes                       | decision_metrics                        | [object]        | Metrics used to decide the experiment outcome.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| decision_metrics                 | is_primary [*required*]            | boolean         | Whether this is the experiment primary metric.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| decision_metrics                 | metric_id [*required*]             | uuid            | Decision metric UUID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| attributes                       | decision_variant_key                    | string          | Key of the variant selected in the experiment decision.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| attributes                       | events_end_date                         | date-time       | End of the time window for metric events.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| attributes                       | events_start_date                       | date-time       | Start of the time window for metric events.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| attributes                       | experiment_type                         | string          | Kind of experiment. STANDARD is an ordinary experiment. Other values, such as CANARY and HOLDOUT, identify experiments owned by another workflow. New kinds may be added; treat unknown values as non-standard.                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| attributes                       | hypothesis                              | string          | Expected effect that the experiment is intended to test.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| attributes                       | migration_metadata                      |                 | Metadata retained for resources imported from another system.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| attributes                       | name                                    | string          | Display name of the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| attributes                       | pipeline_table_suffix                   | string          | Suffix used to identify the experiment's pipeline output table.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| attributes                       | protocol_id                             | string          | ID of the protocol associated with the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| attributes                       | related_links                           | [object]        | Links to supporting material for the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| related_links                    | id                                      | string          | Link ID. Omit it when adding a link.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| related_links                    | title                                   | string          | Optional display title.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| related_links                    | url [*required*]                   | string          | Absolute URL.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| attributes                       | results_last_updated                    | date-time       | Time of the most recent update to the experiment's results.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| attributes                       | split_by_properties                     | [object]        | Properties used to split the experiment results into groups.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| split_by_properties              | column_name [*required*]           | string          | Exposure field or Warehouse column used for the analysis dimension.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| split_by_properties              | column_type [*required*]           | enum            | Type of the Datadog exposure field or Warehouse column. Allowed enum values: `varchar,int,double,boolean,varchar_array,int_array,double_array,raw,STRING,INTEGER`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| split_by_properties              | id [*required*]                    | string          | Read-only property ID. Omit it from POST and PATCH; writes identify properties by column_name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| split_by_properties              | name [*required*]                  | string          | Display name for the analysis dimension.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| attributes                       | status                                  | enum            | Current stage in the experiment lifecycle. Allowed enum values: `DRAFT,SCHEDULED,IN_PROGRESS,READY_FOR_DECISION,DECISION_MADE,CANCELLED,UNKNOWN`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| attributes                       | structured_metadata                     | [object]        | Values of structured metadata fields attached to the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| structured_metadata              | enum_values                             | [string]        | Selected values for an enumerated metadata field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| structured_metadata              | field_display_name                      | string          | Display name of the metadata field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| structured_metadata              | field_key [*required*]             | string          | Key that identifies the metadata field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| structured_metadata              | field_type                              | enum            | Type of value stored in the structured metadata field. Allowed enum values: `FREETEXT,ENUM`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| structured_metadata              | freetext_value                          | string          | Text value for a free-text metadata field.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| attributes                       | subject_type_id                         | string          | ID of the subject type used by this configuration.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| attributes                       | summary                                 | string          | Summary text recorded for the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| attributes                       | tags                                    | [string]        | Tags attached to the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| attributes                       | teams                                   | [string]        | Teams associated with the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| attributes                       | traffic_exposure                        | object          | Traffic exposure fraction or schedule configured for the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| traffic_exposure                 | fraction                                | double          | STATIC exposure fraction. Draft experiments can change this value. After start only warehouse experiments without a Datadog flag can change a STATIC fraction through the public API.                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| traffic_exposure                 | mode [*required*]                  | enum            | Whether exposure uses a fixed fraction or a sequence of steps. Allowed enum values: `STATIC,STEPS`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| traffic_exposure                 | steps                                   | [object]        | Configured exposure plan rather than wall-clock history. At least two steps must have strictly increasing fractions and no gaps. Warehouse steps start at assignments_start_date and can use different durations. New Datadog plans have at most five steps and a first fraction above zero. Their nonfinal durations must be equal and exclude time paused. Datadog steps start with the experiment. Running warehouse experiments can replace step fractions, durations, and the exposure mode. After start, Datadog exposure plans cannot change through the public API. The final duration is null and its fraction holds until assignment ends. |
| steps                            | duration_ms [*required*]           | int64           | Positive step duration in milliseconds. Datadog durations exclude pauses. Send null for the final step.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| steps                            | fraction [*required*]              | double          | Fraction of traffic exposed during this step.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| attributes                       | updated_at                              | date-time       | Time when this resource was last updated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| attributes                       | variants                                | [object]        | Variants configured for the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| variants                         | feature_flag_variant_id                 | string          | Backing feature flag variant ID. Present for Datadog feature flag experiments and omitted for Warehouse experiments.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| variants                         | is_active [*required*]             | boolean         | Whether this variant participates in the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| variants                         | is_control [*required*]            | boolean         | Whether this is the single control variant.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| variants                         | key [*required*]                   | string          | Value recorded in exposure data for this variant.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| variants                         | name                                    | string          | Display name of the experiment variant.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| variants                         | weight [*required*]                | double          | Traffic allocation percentage.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| attributes                       | warehouse_exposure_configuration        | object          | Warehouse exposure model and settings used to identify experiment assignments.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| warehouse_exposure_configuration | entry_point [*required*]           | object          | Optional Warehouse measure that scopes analyzed subjects.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| entry_point                      | filters [*required*]               | [object]        | Complete ordered Warehouse entry-point filter set.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| filters                          | operation [*required*]             | enum            | Comparison applied by the warehouse entry-point filter. Allowed enum values: `IS,IS_NOT`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| filters                          | property_id [*required*]           | string          | Warehouse property UUID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| filters                          | values [*required*]                | [string]        | Ordered values used by the filter.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| entry_point                      | measure_id [*required*]            | string          | Warehouse measure UUID.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| warehouse_exposure_configuration | experiment_key [*required*]        | string          | Warehouse experiment key. Reads can return null for incomplete configuration; configuration writes require a value.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| warehouse_exposure_configuration | exposure_sql_model_id [*required*] | string          | ID of the exposure SQL model that provides assignment data.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| data                             | id [*required*]                    | uuid            | Identifier of the experiment.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| data                             | type [*required*]                  | enum            | Experiments resource type. Allowed enum values: `experiments`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "assignments_end_date": "2026-08-15T00:00:00Z",
      "assignments_start_date": "2026-08-01T00:00:00Z",
      "concluded_at": "2026-08-05T09:30:00Z",
      "conclusion": {
        "decision_reason": "The primary metric improved without material regressions",
        "outcome": "POSITIVE",
        "summary": "The treatment improved conversion"
      },
      "created_at": "2026-08-01T12:00:00Z",
      "datadog_flag_configuration": null,
      "decision_metrics": [
        {
          "is_primary": true,
          "metric_id": "b1a2c3d4-0000-0000-0000-000000000000"
        }
      ],
      "decision_variant_key": "treatment",
      "events_end_date": "2026-08-22T00:00:00Z",
      "events_start_date": "2026-08-01T00:00:00Z",
      "experiment_type": "STANDARD",
      "hypothesis": "A clearer checkout button increases purchase conversion",
      "name": "Checkout button test",
      "pipeline_table_suffix": "a1b2c3d4",
      "protocol_id": "e4d5f6a7-0000-0000-0000-000000000000",
      "related_links": [
        {
          "id": "d1d2d3d4-0000-0000-0000-000000000000",
          "title": "Experiment design",
          "url": "https://docs.example.com/checkout-experiment"
        }
      ],
      "results_last_updated": "2026-08-05T09:25:00Z",
      "split_by_properties": [],
      "status": "DECISION_MADE",
      "structured_metadata": [
        {
          "enum_values": [
            "beta"
          ],
          "field_display_name": "Launch stage",
          "field_key": "launch_stage",
          "field_type": "ENUM"
        },
        {
          "field_display_name": "Notes",
          "field_key": "notes",
          "field_type": "FREETEXT",
          "freetext_value": "Checkout redesign"
        }
      ],
      "subject_type_id": "c2b3d4e5-0000-0000-0000-000000000000",
      "summary": "The treatment improved conversion",
      "tags": [
        "growth"
      ],
      "teams": [
        "growth"
      ],
      "traffic_exposure": {
        "fraction": 1,
        "mode": "STATIC"
      },
      "updated_at": "2026-08-05T09:30:00Z",
      "variants": [
        {
          "is_active": true,
          "is_control": true,
          "key": "control",
          "name": "Control",
          "weight": 50
        },
        {
          "is_active": true,
          "is_control": false,
          "key": "treatment",
          "name": "Treatment",
          "weight": 50
        }
      ],
      "warehouse_exposure_configuration": {
        "entry_point": null,
        "experiment_key": "checkout_button_test",
        "exposure_sql_model_id": "f5e6a7b8-0000-0000-0000-000000000000"
      }
    },
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "type": "experiments"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="400" %}
Invalid request body: missing required field, malformed variants or decision_metrics, or an unresolvable analysis configuration.
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="401" %}
Missing or invalid authentication (dd-api-key + dd-application-key headers, or a valid user session).
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="403" %}
Authenticated caller lacks the product_analytics_experiments_write permission.
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
The supplied protocol_id does not identify a protocol in this organization.
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="409" %}
The requested configuration is incompatible with the experiment (code: unsupported_configuration).
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="415" %}
Request body sent with a media type other than application/json or application/vnd.api+json.
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="422" %}
The supplied protocol is a draft or archived protocol and cannot be applied to a new experiment.
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                          \## Draft with a Datadog feature flag
# Replace the resource IDs with IDs from your organization. The flag variants must belong to the specified flag. This request saves a draft allocation and does not start traffic.
 \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/experiments" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "assignments_end_date": "2026-08-15T00:00:00Z",
      "assignments_start_date": "2026-08-01T00:00:00Z",
      "datadog_flag_configuration": {
        "entry_point": null,
        "environment_id": "550e8400-e29b-41d4-a716-446655440005",
        "feature_flag_id": "550e8400-e29b-41d4-a716-446655440004",
        "targeting_rules": []
      },
      "decision_metrics": [
        {
          "is_primary": true,
          "metric_id": "b1a2c3d4-0000-0000-0000-000000000000"
        }
      ],
      "events_end_date": "2026-08-22T00:00:00Z",
      "events_start_date": "2026-08-01T00:00:00Z",
      "name": "Checkout button test",
      "structured_metadata": [
        {
          "enum_values": [
            "beta"
          ],
          "field_key": "launch_stage"
        },
        {
          "field_key": "notes",
          "freetext_value": "Checkout redesign"
        }
      ],
      "subject_type_id": "c2b3d4e5-0000-0000-0000-000000000000",
      "traffic_exposure": {
        "fraction": 1,
        "mode": "STATIC"
      },
      "variants": [
        {
          "feature_flag_variant_id": "550e8400-e29b-41d4-a716-446655440010",
          "is_active": true,
          "is_control": true,
          "key": "control",
          "weight": 50
        },
        {
          "feature_flag_variant_id": "550e8400-e29b-41d4-a716-446655440011",
          "is_active": true,
          "is_control": false,
          "key": "treatment",
          "weight": 50
        }
      ]
    },
    "type": "experiments"
  }
}
EOF \## Minimal draft
# Uses the organization's default subject type. Add an assignment source, decision metrics, variants, and a run window before starting the experiment.
 \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/experiments" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Checkout button test"
    },
    "type": "experiments"
  }
}
EOF \## Draft from a published protocol
# Replace protocol_id with a published protocol ID from your organization. The protocol supplies the configuration and its rules. Do not copy the configuration fields from the other examples into this request.
 \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/experiments" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "name": "Checkout protocol test",
      "protocol_id": "550e8400-e29b-41d4-a716-446655440040"
    },
    "type": "experiments"
  }
}
EOF \## Draft with warehouse assignments
# Replace the subject type, metric, and exposure SQL model IDs with compatible resources from your organization. The SQL model must provide assignments for checkout_button_test and the control and treatment variant keys. This request saves configuration and does not start analysis.
 \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/experiments" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "assignments_end_date": "2026-08-15T00:00:00Z",
      "assignments_start_date": "2026-08-01T00:00:00Z",
      "decision_metrics": [
        {
          "is_primary": true,
          "metric_id": "b1a2c3d4-0000-0000-0000-000000000000"
        }
      ],
      "events_end_date": "2026-08-22T00:00:00Z",
      "events_start_date": "2026-08-01T00:00:00Z",
      "name": "Warehouse checkout test",
      "subject_type_id": "c2b3d4e5-0000-0000-0000-000000000000",
      "traffic_exposure": {
        "fraction": 1,
        "mode": "STATIC"
      },
      "variants": [
        {
          "is_active": true,
          "is_control": true,
          "key": "control",
          "name": "Control",
          "weight": 50
        },
        {
          "is_active": true,
          "is_control": false,
          "key": "treatment",
          "name": "Treatment",
          "weight": 50
        }
      ],
      "warehouse_exposure_configuration": {
        "entry_point": null,
        "experiment_key": "checkout_button_test",
        "exposure_sql_model_id": "550e8400-e29b-41d4-a716-446655440050"
      }
    },
    "type": "experiments"
  }
}
EOF 
                        
{% /tab %}
