---
title: "Update an incident rule"
method: PATCH
path: "/api/v2/incidents/config/rules/{rule_id}"
tags: ["Incidents"]
---

# Update an incident rule

`PATCH /api/v2/incidents/config/rules/{rule_id}`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/incidents/config/rules/{rule_id}`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `incident_settings_write`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/incidents/config/rules/:rule_id/patch.ts> (a function with typed inputs; its response is checked against the schema)

Update an incident rule.

## Path parameters

- `rule_id` string, uuid, required

## Request body

- IncidentRulePatchRequest: Request payload for patching an incident rule.
  - `data` IncidentRulePatchDataRequest, required: Incident rule data in a patch request.
    - `attributes` IncidentRulePatchDataAttributesRequest: Attributes for patching an incident rule. All fields are optional.
      - `condition` IncidentRuleQueryCondition: A query-based condition for an incident rule.
        - `normalized_query` string, nullable: The normalized query string.
        - `raw_query` string, nullable: The raw query string.
      - `conditions` IncidentRuleCondition[]: List of field-based conditions.
        - `field` string, required: The field to match on.
        - `values` string[], required: The values to match.
      - `enabled` boolean: Whether the rule is enabled.
      - `task_payload` string: The JSON-encoded payload for the task.
      - `trigger` 'incident_saved_trigger' | 'incident_created_trigger' | 'incident_modified_trigger': The trigger event for an incident rule.
    - `id` string, uuid, required: The rule identifier.
    - `type` 'incident_rules', required: Incident rule resource type.

## Response `200`

OK

- IncidentRuleResponse: Response with a single incident rule.
  - `data` IncidentRuleDataResponse, required: Incident rule data in a response.
    - `attributes` IncidentRuleDataAttributesResponse, required: Attributes of an incident rule in a response.
      - `condition` IncidentRuleQueryCondition: A query-based condition for an incident rule.
        - `normalized_query` string, nullable: The normalized query string.
        - `raw_query` string, nullable: The raw query string.
      - `condition_table_type` integer: The condition table type.
      - `conditions` IncidentRuleCondition[]: List of field-based conditions.
        - `field` string, required: The field to match on.
        - `values` string[], required: The values to match.
      - `created` string, date-time: Timestamp when the rule was created.
      - `created_by_uuid` string, uuid: UUID of the user who created the rule.
      - `deleted` string, date-time, nullable: Timestamp when the rule was deleted.
      - `enabled` boolean: Whether the rule is enabled.
      - `execution_type` integer: The execution type of the rule.
      - `incident_settings_association_uuid` string, uuid, nullable: The incident settings association UUID.
      - `match_any_condition` boolean: Whether any condition should match.
      - `modified` string, date-time: Timestamp when the rule was last modified.
      - `modified_by_uuid` string, uuid: UUID of the user who last modified the rule.
      - `org_id` integer: The organization ID.
      - `task_id` string, nullable: The task ID.
      - `task_payload` string, nullable: The JSON-encoded task payload.
      - `trigger` string: The trigger event for the rule.
    - `id` string, uuid, required: The rule identifier.
    - `type` 'incidents_rules', required: Incident rule response resource type.

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
