Note: This endpoint is in preview and is subject to change.
If you have any feedback, contact Datadog support.
PATCH https://api.ap1.datadoghq.com/api/v2/incidents/config/rules/{rule_id}https://api.ap2.datadoghq.com/api/v2/incidents/config/rules/{rule_id}https://api.datadoghq.eu/api/v2/incidents/config/rules/{rule_id}https://api.ddog-gov.com/api/v2/incidents/config/rules/{rule_id}https://api.us2.ddog-gov.com/api/v2/incidents/config/rules/{rule_id}https://api.uk1.datadoghq.com/api/v2/incidents/config/rules/{rule_id}https://api.datadoghq.com/api/v2/incidents/config/rules/{rule_id}https://api.us3.datadoghq.com/api/v2/incidents/config/rules/{rule_id}https://api.us5.datadoghq.com/api/v2/incidents/config/rules/{rule_id}
Overview
Update an incident rule.
This endpoint requires
any
of the following permissions:
incident_settings_writeincident_notification_settings_writeOAuth apps require the incident_settings_write authorization scope to access this endpoint.
Arguments
Path Parameters
The UUID of the incident rule.
Request
Body Data (required)
Incident rule patch payload.
Expand All
Incident rule data in a patch request.
Attributes for patching an incident rule. All fields are optional.
A query-based condition for an incident rule.
The normalized query string.
List of field-based conditions.
Whether the rule is enabled.
The JSON-encoded payload for the task.
The trigger event for an incident rule.
Allowed enum values: incident_saved_trigger,incident_created_trigger,incident_modified_trigger
Incident rule resource type.
Allowed enum values: incident_rules
{
"data": {
"attributes": {
"condition": {
"normalized_query": "severity:SEV-1",
"raw_query": "severity:SEV-1"
},
"conditions": [
{
"field": "severity",
"values": [
"SEV-1",
"SEV-2"
]
}
],
"enabled": true,
"task_payload": "{}",
"trigger": "incident_created_trigger"
},
"id": "00000000-0000-0000-0000-000000000000",
"type": "incident_rules"
}
}
Response
OK
Response with a single incident rule.
Expand All
Incident rule data in a response.
Attributes of an incident rule in a response.
A query-based condition for an incident rule.
The normalized query string.
The condition table type.
List of field-based conditions.
Timestamp when the rule was created.
UUID of the user who created the rule.
Timestamp when the rule was deleted.
Whether the rule is enabled.
The execution type of the rule.
incident_settings_association_uuid
The incident settings association UUID.
Whether any condition should match.
Timestamp when the rule was last modified.
UUID of the user who last modified the rule.
The JSON-encoded task payload.
The trigger event for the rule.
Incident rule response resource type.
Allowed enum values: incidents_rules
{
"data": {
"attributes": {
"condition": {
"normalized_query": "severity:SEV-1",
"raw_query": "severity:SEV-1"
},
"condition_table_type": 1,
"conditions": [
{
"field": "severity",
"values": [
"SEV-1",
"SEV-2"
]
}
],
"created": "2024-01-01T00:00:00.000Z",
"created_by_uuid": "00000000-0000-0000-0000-000000000001",
"deleted": null,
"enabled": true,
"execution_type": 1,
"incident_settings_association_uuid": null,
"match_any_condition": false,
"modified": "2024-01-01T00:00:00.000Z",
"modified_by_uuid": "00000000-0000-0000-0000-000000000001",
"org_id": 123456,
"task_id": "notify-incident-handles-job",
"task_payload": "{}",
"trigger": "incident_created_trigger"
},
"id": "00000000-0000-0000-0000-000000000000",
"type": "incidents_rules"
}
}
Bad Request
{
"errors": [
"Bad Request"
]
}
Unauthorized
{
"errors": [
"Bad Request"
]
}
Forbidden
{
"errors": [
"Bad Request"
]
}
Not Found
{
"errors": [
"Bad Request"
]
}
Too many requests
{
"errors": [
"Bad Request"
]
}
Code Example
## default
#
# Path parameters
export rule_id="CHANGE_ME"
# Curl command
curl -X PATCH "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/incidents/config/rules/${rule_id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"data": {
"attributes": {
"enabled": false
},
"id": "00000000-0000-0000-0000-000000000001",
"type": "incident_rules"
}
}
EOF