Replace experiment protocol
Replace the template of a published protocol. Draft and archived protocols return 409. Send subject_type_id, all four required boolean settings, and metric_groups. Omitted optional template fields are cleared. Omitted enforcement keeps the existing locks.
Use primary_metric_id to select the primary metric. Use default_duration_days to set target_duration_days on experiments created from the protocol. The nested metric is_primary and analysis_plan.target_duration_days fields are rejected. An unchanged GET response can be sent as the request body. Response-only fields are ignored.
Independent configuration errors are returned together in the JSON:API errors array. Each error identifies the field in source.pointer. Earlier request and reference checks can stop on the first error. A failed request leaves the protocol unchanged. Changes apply to future experiments; existing experiments keep their settings.
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_experiments_write
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
The UUID of the protocol.
Query parameters
The updated_at value from the last read. Include the full timestamp, with fractional seconds. Returns 409 if another write changed the protocol. Omit to skip this check.
Request body
Example request
{
"data": {
"attributes": {
"assignment_source_id": "550e8400-e29b-41d4-a716-446655440000",
"enforcement": {
"confidence_interval_method": "LOCKED",
"confidence_level": "EDITABLE",
"cuped_calculation": "EDITABLE",
"default_duration": "EDITABLE",
"environment": "EDITABLE",
"flag_source": "LOCKED",
"multiple_testing_correction": "EDITABLE",
"notifications": "EDITABLE",
"primary_metric": "EDITABLE",
"secondary_metrics": "EDITABLE",
"split_by_exploration_dimensions": "EDITABLE",
"subject_type": "LOCKED",
"targeting_rules": "EDITABLE",
"traffic_exposure": "EDITABLE",
"warehouse_exposure_source": "EDITABLE"
},
"environment_id": "550e8400-e29b-41d4-a716-446655440000",
"metric_groups": [],
"primary_metric_id": "550e8400-e29b-41d4-a716-446655440000",
"subject_type_id": "550e8400-e29b-41d4-a716-446655440000"
},
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "protocols"
}
}Response
OK
Example response
{
"data": {
"attributes": {
"archived_at": "2026-07-31T14:00:00Z",
"created_at": "2026-07-31T12:00:00Z",
"metric_groups": [],
"name": "Checkout conversion",
"status": "PUBLISHED",
"updated_at": "2026-01-01T00:00:00Z"
},
"id": "550e8400-e29b-41d4-a716-446655440000",
"type": "protocols"
}
}Changes
Changes to this operation have not been checked yet.