Update metric
Update a metric. Certified metrics are read-only through this endpoint. This is a partial update: every attribute is optional and an omitted attribute keeps its stored value, so a body carrying only the fields being changed is enough. guardrail_cutoff_threshold is nullable -- send null to clear it, omit it to leave it alone. Omitting the aggregation leaves the metric's definition untouched; supplying one replaces it wholesale, and the metric's type is re-derived from the shape supplied. Property filters use property_id or measure_id UUIDs from the aggregation's data source. Attributes that are computed rather than stored (short_id, metric_type, certified_at, experiment_count, created_at, updated_at) are rejected rather than ignored, so a body copied from GET must have them removed. The is_certified attribute is rejected. Certification cannot be changed through this endpoint.
Request
- Base URLhttps://api.datadoghq.com
- Auth
- API key in header DD-API-KEY and API key in header DD-APPLICATION-KEY
- or OAuth 2Authorization code/oauth2/v1/authorizeToken URL/oauth2/v1/tokenScopesproduct_analytics_metrics_write
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
The UUID of the metric.
Request body
Example request
{
"data": {
"attributes": {
"name": "Checkout conversion"
},
"id": "550e8400-e29b-41d4-a716-446655440020",
"type": "metrics"
}
}Response
OK
Example response
{
"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"
}
}Changes
Changes to this operation have not been checked yet.