List incident rules
https://api.datadoghq.com/api/v2/incidents/config/ruleshttps://api.us3.datadoghq.com/api/v2/incidents/config/ruleshttps://api.us5.datadoghq.com/api/v2/incidents/config/ruleshttps://api.datadoghq.eu/api/v2/incidents/config/ruleshttps://api.ap1.datadoghq.com/api/v2/incidents/config/ruleshttps://api.ap2.datadoghq.com/api/v2/incidents/config/ruleshttps://api.uk1.datadoghq.com/api/v2/incidents/config/ruleshttps://api.ddog-gov.com/api/v2/incidents/config/ruleshttps://api.us2.ddog-gov.com/api/v2/incidents/config/rulesPrésentation
List all incident rules.
OAuth apps require the incident_settings_read authorization scope to access this endpoint.
Arguments
Chaînes de requête
filter[task_id]Filter rules by task ID.
filter[trigger]Filter rules by trigger.
incidentTypeUUIDFilter rules by incident type UUID.
Réponse
OK
Response with a list of incident rules.
data [required]List of incident rules.
attributes [required]Attributes of an incident rule in a response.
conditionA query-based condition for an incident rule.
normalized_queryThe normalized query string.
raw_queryThe raw query string.
condition_table_typeThe condition table type.
conditionsList of field-based conditions.
field [required]The field to match on.
values [required]The values to match.
createdTimestamp when the rule was created.
created_by_uuidUUID of the user who created the rule.
deletedTimestamp when the rule was deleted.
enabledWhether the rule is enabled.
execution_typeThe execution type of the rule.
incident_settings_association_uuidThe incident settings association UUID.
match_any_conditionWhether any condition should match.
modifiedTimestamp when the rule was last modified.
modified_by_uuidUUID of the user who last modified the rule.
org_idThe organization ID.
task_idThe task ID.
task_payloadThe JSON-encoded task payload.
triggerThe trigger event for the rule.
id [required]The rule identifier.
type [required]Incident rule response resource type.
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
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Unauthorized
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Forbidden
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Exemple de code
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/incidents/config/rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/incidents/config/rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/incidents/config/rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/incidents/config/rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/incidents/config/rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/incidents/config/rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/incidents/config/rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/incidents/config/rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X GET "https://api.${DD_SITE}/api/v2/incidents/config/rules" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"