This product is not supported for your selected Datadog site. ().

Create metric

POST https://api.ap1.datadoghq.com/api/v2/experiments/metricshttps://api.ap2.datadoghq.com/api/v2/experiments/metricshttps://api.datadoghq.eu/api/v2/experiments/metricshttps://api.ddog-gov.com/api/v2/experiments/metricshttps://api.us2.ddog-gov.com/api/v2/experiments/metricshttps://api.uk1.datadoghq.com/api/v2/experiments/metricshttps://api.datadoghq.com/api/v2/experiments/metricshttps://api.us3.datadoghq.com/api/v2/experiments/metricshttps://api.us5.datadoghq.com/api/v2/experiments/metrics

Overview

Create a metric. The metric’s type is derived from the aggregation shape: a numerator alone is SIMPLE, a numerator with a denominator is RATIO, and a percentile aggregation is PERCENTILE. Warehouse aggregations reference measures by UUID. Property filters use property_id or measure_id UUIDs returned by the same metric SQL model; every reference must belong to the aggregation’s data source. The is_certified attribute is rejected. Certification cannot be changed through this endpoint. This endpoint requires the product_analytics_metrics_write permission.

OAuth apps require the product_analytics_metrics_write authorization scope to access this endpoint.

Request

Body Data (required)

Expand All

Field

Type

Description

data [required]

object

Metric resource to create.

attributes [required]

 <oneOf>

Configuration for the new metric. Supply either numerator_aggregation or percentile_aggregation. A denominator_aggregation requires numerator_aggregation. Omit unused aggregation fields; do not send them as null.

Object 1

object

Configuration for a metric calculated from a numerator and an optional denominator. Omit percentile_aggregation. Omit denominator_aggregation when unused.

data_source_type [required]

enum

Source of the data backing this metric. Allowed enum values: DATADOG,DATADOG_REFERENCE_TABLE,CUSTOMER_WAREHOUSE

denominator_aggregation

 <oneOf>

Measure and calculation settings for a numerator or denominator aggregation. Supply exactly one non-null measure.

Object 1

object

Settings for a metric aggregation that uses a Warehouse measure. The other measure must be omitted or null.

aging_threshold_days

int64

Stored aging threshold in days. The subject aging filter uses the aggregation window end and unit.

datadog_metric_measure

object

Optional Datadog measure. Use null when the other measure is selected.

column_name

string

Name of the Datadog event field used by this measure.

column_type [required]

string

Data type of the source column.

filters

Conditions used to select the metric's source data.

name [required]

string

Display name of the Datadog measure.

query

string

Query used to retrieve the Datadog measure.

source_definition_filter

Filter applied to the Datadog source definition.

source_subtype [required]

string

Subtype of the Datadog data source.

source_type [required]

string

Type of Datadog data source used for the measure.

enable_aging_subject_filter

boolean

Whether to exclude subjects whose observation time is shorter than the aggregation window.

operation [required]

string

Calculation applied to the measure values, such as sum.

property_filters

[array]

Property filters that select data for this aggregation.

threshold_aggregation_type

string

Calculation used to evaluate the threshold.

threshold_breach_value

double

Value used to determine whether the threshold is breached.

threshold_comparison_operator

string

Operator used to compare the calculated value with the threshold.

threshold_timeframe_dimension

string

Time unit for the threshold evaluation window. Supports seconds, minutes, hours, days, calendar_days, and weeks. Calendar days start at midnight on the assignment day. Other units start at the assignment time.

threshold_timeframe_value

double

End of the threshold evaluation window, measured from assignment in the configured time unit.

timeframe_end_value

double

End offset of the aggregation window from assignment, in timeframe_unit.

timeframe_start_value

double

Start offset of the aggregation window from assignment, in timeframe_unit.

timeframe_unit

string

Time unit for the aggregation window. Calendar days are measured from midnight on the assignment day. Other units are measured from the assignment time.

warehouse_metric_measure [required]

object

Reference to a measure defined in a warehouse metric SQL model.

id [required]

uuid

Identifier of the warehouse metric measure.

winsor_lower_fixed_value

double

Fixed lower bound used to cap extreme measure values.

winsor_lower_percentile

double

Percentile used to determine the lower bound for extreme measure values.

winsor_upper_fixed_value

double

Fixed upper bound used to cap extreme measure values.

winsor_upper_percentile

double

Percentile used to determine the upper bound for extreme measure values.

winsorization_strategy

string

Method used to cap extreme measure values before aggregation.

Object 2

object

Settings for a metric aggregation that uses a Datadog measure. The other measure must be omitted or null.

aging_threshold_days

int64

Stored aging threshold in days. The subject aging filter uses the aggregation window end and unit.

datadog_metric_measure [required]

object

Datadog source and query that supply values for the metric.

column_name

string

Name of the Datadog event field used by this measure.

column_type [required]

string

Data type of the source column.

filters

Conditions used to select the metric's source data.

name [required]

string

Display name of the Datadog measure.

query

string

Query used to retrieve the Datadog measure.

source_definition_filter

Filter applied to the Datadog source definition.

source_subtype [required]

string

Subtype of the Datadog data source.

source_type [required]

string

Type of Datadog data source used for the measure.

enable_aging_subject_filter

boolean

Whether to exclude subjects whose observation time is shorter than the aggregation window.

operation [required]

string

Calculation applied to the measure values, such as sum.

property_filters

[array]

Property filters that select data for this aggregation.

threshold_aggregation_type

string

Calculation used to evaluate the threshold.

threshold_breach_value

double

Value used to determine whether the threshold is breached.

threshold_comparison_operator

string

Operator used to compare the calculated value with the threshold.

threshold_timeframe_dimension

string

Time unit for the threshold evaluation window. Supports seconds, minutes, hours, days, calendar_days, and weeks. Calendar days start at midnight on the assignment day. Other units start at the assignment time.

threshold_timeframe_value

double

End of the threshold evaluation window, measured from assignment in the configured time unit.

timeframe_end_value

double

End offset of the aggregation window from assignment, in timeframe_unit.

timeframe_start_value

double

Start offset of the aggregation window from assignment, in timeframe_unit.

timeframe_unit

string

Time unit for the aggregation window. Calendar days are measured from midnight on the assignment day. Other units are measured from the assignment time.

warehouse_metric_measure

object

Optional warehouse measure. Use null when the other measure is selected.

id [required]

uuid

Identifier of the warehouse metric measure.

winsor_lower_fixed_value

double

Fixed lower bound used to cap extreme measure values.

winsor_lower_percentile

double

Percentile used to determine the lower bound for extreme measure values.

winsor_upper_fixed_value

double

Fixed upper bound used to cap extreme measure values.

winsor_upper_percentile

double

Percentile used to determine the upper bound for extreme measure values.

winsorization_strategy

string

Method used to cap extreme measure values before aggregation.

description

string

Description of the metric. Send null to leave it unset.

desired_change [required]

enum

Direction of change that represents an improvement for this metric. Allowed enum values: METRIC_INCREASES,METRIC_DECREASES

format_as_percent

boolean

Whether results render as a percentage. Defaults to false when omitted.

guardrail_cutoff_threshold

double

Guardrail cutoff threshold. Send null to leave it unset.

migration_metadata

Metadata associated with migration of this resource.

name [required]

string

Name of the metric.

numerator_aggregation [required]

 <oneOf>

Measure and calculation settings for a numerator or denominator aggregation. Supply exactly one non-null measure.

Object 1

object

Settings for a metric aggregation that uses a Warehouse measure. The other measure must be omitted or null.

aging_threshold_days

int64

Stored aging threshold in days. The subject aging filter uses the aggregation window end and unit.

datadog_metric_measure

object

Optional Datadog measure. Use null when the other measure is selected.

column_name

string

Name of the Datadog event field used by this measure.

column_type [required]

string

Data type of the source column.

filters

Conditions used to select the metric's source data.

name [required]

string

Display name of the Datadog measure.

query

string

Query used to retrieve the Datadog measure.

source_definition_filter

Filter applied to the Datadog source definition.

source_subtype [required]

string

Subtype of the Datadog data source.

source_type [required]

string

Type of Datadog data source used for the measure.

enable_aging_subject_filter

boolean

Whether to exclude subjects whose observation time is shorter than the aggregation window.

operation [required]

string

Calculation applied to the measure values, such as sum.

property_filters

[array]

Property filters that select data for this aggregation.

threshold_aggregation_type

string

Calculation used to evaluate the threshold.

threshold_breach_value

double

Value used to determine whether the threshold is breached.

threshold_comparison_operator

string

Operator used to compare the calculated value with the threshold.

threshold_timeframe_dimension

string

Time unit for the threshold evaluation window. Supports seconds, minutes, hours, days, calendar_days, and weeks. Calendar days start at midnight on the assignment day. Other units start at the assignment time.

threshold_timeframe_value

double

End of the threshold evaluation window, measured from assignment in the configured time unit.

timeframe_end_value

double

End offset of the aggregation window from assignment, in timeframe_unit.

timeframe_start_value

double

Start offset of the aggregation window from assignment, in timeframe_unit.

timeframe_unit

string

Time unit for the aggregation window. Calendar days are measured from midnight on the assignment day. Other units are measured from the assignment time.

warehouse_metric_measure [required]

object

Reference to a measure defined in a warehouse metric SQL model.

id [required]

uuid

Identifier of the warehouse metric measure.

winsor_lower_fixed_value

double

Fixed lower bound used to cap extreme measure values.

winsor_lower_percentile

double

Percentile used to determine the lower bound for extreme measure values.

winsor_upper_fixed_value

double

Fixed upper bound used to cap extreme measure values.

winsor_upper_percentile

double

Percentile used to determine the upper bound for extreme measure values.

winsorization_strategy

string

Method used to cap extreme measure values before aggregation.

Object 2

object

Settings for a metric aggregation that uses a Datadog measure. The other measure must be omitted or null.

aging_threshold_days

int64

Stored aging threshold in days. The subject aging filter uses the aggregation window end and unit.

datadog_metric_measure [required]

object

Datadog source and query that supply values for the metric.

column_name

string

Name of the Datadog event field used by this measure.

column_type [required]

string

Data type of the source column.

filters

Conditions used to select the metric's source data.

name [required]

string

Display name of the Datadog measure.

query

string

Query used to retrieve the Datadog measure.

source_definition_filter

Filter applied to the Datadog source definition.

source_subtype [required]

string

Subtype of the Datadog data source.

source_type [required]

string

Type of Datadog data source used for the measure.

enable_aging_subject_filter

boolean

Whether to exclude subjects whose observation time is shorter than the aggregation window.

operation [required]

string

Calculation applied to the measure values, such as sum.

property_filters

[array]

Property filters that select data for this aggregation.

threshold_aggregation_type

string

Calculation used to evaluate the threshold.

threshold_breach_value

double

Value used to determine whether the threshold is breached.

threshold_comparison_operator

string

Operator used to compare the calculated value with the threshold.

threshold_timeframe_dimension

string

Time unit for the threshold evaluation window. Supports seconds, minutes, hours, days, calendar_days, and weeks. Calendar days start at midnight on the assignment day. Other units start at the assignment time.

threshold_timeframe_value

double

End of the threshold evaluation window, measured from assignment in the configured time unit.

timeframe_end_value

double

End offset of the aggregation window from assignment, in timeframe_unit.

timeframe_start_value

double

Start offset of the aggregation window from assignment, in timeframe_unit.

timeframe_unit

string

Time unit for the aggregation window. Calendar days are measured from midnight on the assignment day. Other units are measured from the assignment time.

warehouse_metric_measure

object

Optional warehouse measure. Use null when the other measure is selected.

id [required]

uuid

Identifier of the warehouse metric measure.

winsor_lower_fixed_value

double

Fixed lower bound used to cap extreme measure values.

winsor_lower_percentile

double

Percentile used to determine the lower bound for extreme measure values.

winsor_upper_fixed_value

double

Fixed upper bound used to cap extreme measure values.

winsor_upper_percentile

double

Percentile used to determine the upper bound for extreme measure values.

winsorization_strategy

string

Method used to cap extreme measure values before aggregation.

Object 2

object

Configuration for a percentile metric. Omit numerator_aggregation and denominator_aggregation.

data_source_type [required]

enum

Source of the data backing this metric. Allowed enum values: DATADOG,DATADOG_REFERENCE_TABLE,CUSTOMER_WAREHOUSE

description

string

Description of the metric. Send null to leave it unset.

desired_change [required]

enum

Direction of change that represents an improvement for this metric. Allowed enum values: METRIC_INCREASES,METRIC_DECREASES

format_as_percent

boolean

Whether results render as a percentage. Defaults to false when omitted.

guardrail_cutoff_threshold

double

Guardrail cutoff threshold. Send null to leave it unset.

migration_metadata

Metadata associated with migration of this resource.

name [required]

string

Name of the metric.

percentile_aggregation [required]

 <oneOf>

Measure and percentile to calculate for the metric. Supply exactly one non-null measure.

Object 1

object

Settings for a percentile aggregation that uses a Warehouse measure. The other measure must be omitted or null.

datadog_metric_measure

object

Optional Datadog percentile measure. Use null when the warehouse measure is selected.

column_name [required]

string

Name of the Datadog event field used by this measure.

column_type [required]

string

Data type of the source column.

filters

Conditions used to select the metric's source data.

name [required]

string

Display name of the Datadog measure.

query

string

Query used to retrieve the Datadog measure.

source_definition_filter

Filter applied to the Datadog source definition.

source_subtype [required]

string

Subtype of the Datadog data source.

source_type [required]

string

Type of Datadog data source used for the measure.

percentile [required]

double

Percentile to calculate from the measure values.

property_filters

[array]

Property filters that select data for the percentile calculation.

warehouse_metric_measure [required]

object

Reference to a measure defined in a warehouse metric SQL model.

id [required]

uuid

Identifier of the warehouse metric measure.

Object 2

object

Settings for a percentile aggregation that uses a Datadog measure. The other measure must be omitted or null.

datadog_metric_measure [required]

object

Datadog measure used to calculate a percentile.

column_name [required]

string

Name of the Datadog event field used by this measure.

column_type [required]

string

Data type of the source column.

filters

Conditions used to select the metric's source data.

name [required]

string

Display name of the Datadog measure.

query

string

Query used to retrieve the Datadog measure.

source_definition_filter

Filter applied to the Datadog source definition.

source_subtype [required]

string

Subtype of the Datadog data source.

source_type [required]

string

Type of Datadog data source used for the measure.

percentile [required]

double

Percentile to calculate from the measure values.

property_filters

[array]

Property filters that select data for the percentile calculation.

warehouse_metric_measure

object

Optional warehouse measure. Use null when the other measure is selected.

id [required]

uuid

Identifier of the warehouse metric measure.

type [required]

enum

The metric resource type. Allowed enum values: metrics

default: metrics

{
  "data": {
    "type": "metrics",
    "attributes": {
      "name": "ex-14bb9543f523edde",
      "data_source_type": "DATADOG",
      "desired_change": "METRIC_INCREASES",
      "numerator_aggregation": {
        "operation": "sum",
        "datadog_metric_measure": {
          "name": "ex-14bb9543f523edde view duration",
          "source_type": "PRODUCT_ANALYTICS",
          "source_subtype": "RUM_VIEWS",
          "column_type": "double",
          "column_name": "@view.time_spent"
        }
      }
    }
  }
}

Response

Created

Response containing the metric.

Expand All

Field

Type

Description

data [required]

object

JSON:API resource containing the metric identity and fields.

attributes

object

Details of the metric.

certified_at

date-time

Time when this resource was certified.

created_at

date-time

Time when this resource was created.

data_source_type

enum

Source of the data used to calculate the metric. Allowed enum values: DATADOG,DATADOG_REFERENCE_TABLE,CUSTOMER_WAREHOUSE,IMPORTED,UNKNOWN

denominator_aggregation

object

Source measure and aggregation settings for a metric value.

aging_threshold_days

int64

Stored aging threshold in days. The subject aging filter uses the aggregation window end and unit.

datadog_metric_measure

object

Datadog source and query that supply values for the metric.

column_name

string

Name of the Datadog event field used by this measure.

column_type

string

Data type of the source column.

filters

Conditions used to select the metric's source data.

name

string

Display name of the Datadog measure.

query

string

Query used to retrieve the Datadog measure.

source_definition_filter

Filter applied to the Datadog source definition.

source_subtype

string

Subtype of the Datadog data source.

source_type

string

Type of Datadog data source used for the measure.

enable_aging_subject_filter

boolean

Whether to exclude subjects whose observation time is shorter than the aggregation window.

operation

string

Aggregation applied to the selected measure.

pipeline_column_suffix

string

Suffix used to identify this value in pipeline output columns.

property_filters

[array]

Filters applied to the metric aggregation.

threshold_aggregation_type

string

Aggregation used to evaluate the threshold.

threshold_breach_value

double

Value used to determine whether the threshold is breached.

threshold_comparison_operator

string

Comparison applied between the aggregated value and the threshold.

threshold_timeframe_dimension

string

Time unit used for the threshold evaluation window.

threshold_timeframe_value

double

Size of the threshold evaluation window.

timeframe_end_value

double

End of the aggregation window in the specified time unit.

timeframe_start_value

double

Start of the aggregation window in the specified time unit.

timeframe_unit

string

Time unit used for the aggregation window.

warehouse_metric_measure

object

Warehouse measure that supplies values for the metric.

id

string

ID of the measure.

pipeline_column_suffix

string

Suffix used to identify this value in pipeline output columns.

winsor_lower_fixed_value

double

Fixed lower bound used to cap metric values.

winsor_lower_percentile

double

Percentile used to determine the lower bound for capped metric values.

winsor_upper_fixed_value

double

Fixed upper bound used to cap metric values.

winsor_upper_percentile

double

Percentile used to determine the upper bound for capped metric values.

winsorization_strategy

string

Method used to cap extreme metric values.

description

string

Text that explains the metric.

desired_change

enum

Direction of metric change considered desirable. Allowed enum values: METRIC_INCREASES,METRIC_DECREASES,UNKNOWN

experiment_count

int64

Number of experiments that reference this resource.

format_as_percent

boolean

Whether to display the metric value as a percentage.

guardrail_cutoff_threshold

double

Threshold used when evaluating this metric as a guardrail.

metric_type

enum

Type of metric calculation. Allowed enum values: SIMPLE,RATIO,PERCENTILE,UNKNOWN

migration_metadata

Metadata retained for resources imported from another system.

name

string

Display name of the metric.

numerator_aggregation

object

Source measure and aggregation settings for a metric value.

aging_threshold_days

int64

Stored aging threshold in days. The subject aging filter uses the aggregation window end and unit.

datadog_metric_measure

object

Datadog source and query that supply values for the metric.

column_name

string

Name of the Datadog event field used by this measure.

column_type

string

Data type of the source column.

filters

Conditions used to select the metric's source data.

name

string

Display name of the Datadog measure.

query

string

Query used to retrieve the Datadog measure.

source_definition_filter

Filter applied to the Datadog source definition.

source_subtype

string

Subtype of the Datadog data source.

source_type

string

Type of Datadog data source used for the measure.

enable_aging_subject_filter

boolean

Whether to exclude subjects whose observation time is shorter than the aggregation window.

operation

string

Aggregation applied to the selected measure.

pipeline_column_suffix

string

Suffix used to identify this value in pipeline output columns.

property_filters

[array]

Filters applied to the metric aggregation.

threshold_aggregation_type

string

Aggregation used to evaluate the threshold.

threshold_breach_value

double

Value used to determine whether the threshold is breached.

threshold_comparison_operator

string

Comparison applied between the aggregated value and the threshold.

threshold_timeframe_dimension

string

Time unit used for the threshold evaluation window.

threshold_timeframe_value

double

Size of the threshold evaluation window.

timeframe_end_value

double

End of the aggregation window in the specified time unit.

timeframe_start_value

double

Start of the aggregation window in the specified time unit.

timeframe_unit

string

Time unit used for the aggregation window.

warehouse_metric_measure

object

Warehouse measure that supplies values for the metric.

id

string

ID of the measure.

pipeline_column_suffix

string

Suffix used to identify this value in pipeline output columns.

winsor_lower_fixed_value

double

Fixed lower bound used to cap metric values.

winsor_lower_percentile

double

Percentile used to determine the lower bound for capped metric values.

winsor_upper_fixed_value

double

Fixed upper bound used to cap metric values.

winsor_upper_percentile

double

Percentile used to determine the upper bound for capped metric values.

winsorization_strategy

string

Method used to cap extreme metric values.

percentile_aggregation

object

Source measure and settings for a percentile metric.

datadog_metric_measure

object

Datadog source and query that supply values for the metric.

column_name

string

Name of the Datadog event field used by this measure.

column_type

string

Data type of the source column.

filters

Conditions used to select the metric's source data.

name

string

Display name of the Datadog measure.

query

string

Query used to retrieve the Datadog measure.

source_definition_filter

Filter applied to the Datadog source definition.

source_subtype

string

Subtype of the Datadog data source.

source_type

string

Type of Datadog data source used for the measure.

percentile

double

Percentile calculated from the selected measure.

pipeline_column_suffix

string

Suffix used to identify this value in pipeline output columns.

property_filters

[array]

Filters applied to the metric aggregation.

warehouse_metric_measure

object

Warehouse measure that supplies values for the metric.

id

string

ID of the measure.

pipeline_column_suffix

string

Suffix used to identify this value in pipeline output columns.

reference_url

string

URL with supporting information about the metric.

updated_at

date-time

Time when this resource was last updated.

id [required]

uuid

ID of the metric.

type [required]

enum

The metric resource type. Allowed enum values: metrics

default: metrics

{
  "data": {
    "attributes": {
      "created_at": "2024-01-01T12:00:00Z",
      "data_source_type": "CUSTOMER_WAREHOUSE",
      "description": "Share of sessions that reach the order confirmation page",
      "desired_change": "METRIC_INCREASES",
      "format_as_percent": true,
      "metric_type": "SIMPLE",
      "name": "Checkout conversion",
      "numerator_aggregation": {
        "operation": "sum",
        "pipeline_column_suffix": "agg001",
        "timeframe_start_value": 0,
        "warehouse_metric_measure": {
          "id": "550e8400-e29b-41d4-a716-446655440021",
          "pipeline_column_suffix": "rev001"
        }
      },
      "reference_url": "",
      "updated_at": "2024-01-01T12:00:00Z"
    },
    "id": "550e8400-e29b-41d4-a716-446655440002",
    "type": "metrics"
  }
}

Malformed body, validation failure, or an aggregation that does not match metric_type.

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Missing or invalid authentication.

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Caller lacks product_analytics_metrics_write.

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Another metric in this organization already uses one of these values.

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Request body sent with a media type other than application/json or application/vnd.api+json.

API error response.

Expand All

Field

Type

Description

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

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

Too many requests

API error response.

Expand All

Field

Type

Description

errors [required]

[string]

A list of errors.

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

Code Example

                          ## default
# 

# 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.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.uk1.datadoghq.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/experiments/metrics" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${DD_BEARER_TOKEN}" \ -d @- << EOF { "data": { "attributes": { "data_source_type": "CUSTOMER_WAREHOUSE", "description": null, "desired_change": "METRIC_INCREASES", "format_as_percent": true, "guardrail_cutoff_threshold": null, "name": "Checkout conversion", "numerator_aggregation": { "operation": "sum", "property_filters": [ [ { "operation": "IS", "property_id": "550e8400-e29b-41d4-a716-446655440023", "values": [ "US" ] } ] ], "timeframe_start_value": 0, "warehouse_metric_measure": { "id": "550e8400-e29b-41d4-a716-446655440021" } } }, "type": "metrics" } } EOF