POST https://api.ap1.datadoghq.com/api/v2/experiments/metric-collections https://api.ap2.datadoghq.com/api/v2/experiments/metric-collections https://api.datadoghq.eu/api/v2/experiments/metric-collections https://api.ddog-gov.com/api/v2/experiments/metric-collections https://api.us2.ddog-gov.com/api/v2/experiments/metric-collections https://api.uk1.datadoghq.com/api/v2/experiments/metric-collections https://api.datadoghq.com/api/v2/experiments/metric-collections https://api.us3.datadoghq.com/api/v2/experiments/metric-collections https://api.us5.datadoghq.com/api/v2/experiments/metric-collections
Overview Create metric collection.
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
Metric collection resource to create.
Name, description, and metric selection for the new collection.
Description of the metric collection.
Whether the collection is designated as a guardrail collection.
Metrics to include in the collection.
Identifier of the metric to include in the collection.
Display name of the metric collection.
Optional JSON:API resource identifier field.
Metric collections resource type.
Allowed enum values: metric-collections
default: metric-collections
{
"data" : {
"type" : "metric-collections" ,
"attributes" : {
"name" : "ex-14bb9543f523edde"
}
}
} Response Created
Response containing the metric collection.
Expand All
JSON:API resource containing the metric collection identity and fields.
Details of the metric collection.
Time when this resource was created.
Text that explains the metric collection.
Whether the collection is used for guardrail metrics.
Number of metrics in this collection.
Metrics included in this collection.
ID of the metric represented by this entry.
Display name of the metric represented by this entry.
Display name of the metric collection.
Time when this resource was last updated.
ID of the metric collection.
Metric collections resource type.
Allowed enum values: metric-collections
default: metric-collections
{
"data" : {
"attributes" : {
"created_at" : "2026-08-01T12:00:00Z" ,
"description" : "Metrics reviewed for every checkout experiment." ,
"is_guardrail" : false ,
"metrics" : [
{
"metric_id" : "550e8400-e29b-41d4-a716-446655440020" ,
"metric_name" : "Checkout conversion"
}
],
"name" : "Checkout metrics" ,
"updated_at" : "2026-08-02T09:30:00Z"
},
"id" : "550e8400-e29b-41d4-a716-446655440040" ,
"type" : "metric-collections"
}
} Bad Request
API error response.
Expand All
A human-readable explanation specific to this occurrence of the error.
Non-standard meta-information about the error
References to the source of the error.
A string indicating the name of a single request header which caused the error.
A string indicating which URI query parameter caused the error.
A JSON pointer to the value in the request document that caused the error.
Status code of the response.
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"
}
]
} Unauthorized
API error response.
Expand All
A human-readable explanation specific to this occurrence of the error.
Non-standard meta-information about the error
References to the source of the error.
A string indicating the name of a single request header which caused the error.
A string indicating which URI query parameter caused the error.
A JSON pointer to the value in the request document that caused the error.
Status code of the response.
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"
}
]
} Forbidden
API error response.
Expand All
A human-readable explanation specific to this occurrence of the error.
Non-standard meta-information about the error
References to the source of the error.
A string indicating the name of a single request header which caused the error.
A string indicating which URI query parameter caused the error.
A JSON pointer to the value in the request document that caused the error.
Status code of the response.
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"
}
]
} Conflict
API error response.
Expand All
A human-readable explanation specific to this occurrence of the error.
Non-standard meta-information about the error
References to the source of the error.
A string indicating the name of a single request header which caused the error.
A string indicating which URI query parameter caused the error.
A JSON pointer to the value in the request document that caused the error.
Status code of the response.
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
A human-readable explanation specific to this occurrence of the error.
Non-standard meta-information about the error
References to the source of the error.
A string indicating the name of a single request header which caused the error.
A string indicating which URI query parameter caused the error.
A JSON pointer to the value in the request document that caused the error.
Status code of the response.
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
{
"errors" : [
"Bad Request"
]
} Code Example Copy
## 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/metric-collections " \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN} " \
-d @- << EOF
{
"data": {
"attributes": {
"name": "Activation"
},
"type": "metric-collections"
}
}
EOF