---
title: "Update Alert Rule"
method: PUT
path: "/api/v1/alert-rules/{rule_id}"
tags: ["alert-rules"]
---

# Update Alert Rule

`PUT /api/v1/alert-rules/{rule_id}`

## Request

- Base URL: `http://localhost:8000`
- URL: `http://localhost:8000/api/v1/alert-rules/{rule_id}`
- Auth: none declared

Update alert rule configuration.

## Path parameters

- `rule_id` string, uuid, required

## Headers

- `Authorization` string

## Request body

- AppDomainsFeatureAlertsApiV1AlertRulesUpdateAlertRuleRequest: Request schema for updating an alert rule.
  - `name` string, nullable
  - `description` string, nullable
  - `is_active` boolean, nullable
  - `cooldown_minutes` integer, nullable
  - `max_alerts_per_day` integer, nullable
  - `event_types` string[], nullable
  - `severities` string[], nullable
  - `asset_ids` string[], nullable
  - `grouping` GroupingConfig: Configuration for alert grouping/digest behavior. When enabled, alerts are grouped into digest notifications to prevent alert fatigue. The first alert always sends immediately; subsequent alerts within the window are grouped. Example: { "enabled": true, "window_minutes": 60, "min_alerts_to_group": 2 }
    - `enabled` boolean: Whether to enable alert grouping for this rule
    - `window_minutes` integer: Time window for collecting alerts to group (5-1440 minutes)
    - `min_alerts_to_group` integer: Minimum alerts before grouping kicks in (2-100)
  - `is_notify_code_authors` boolean, nullable
  - `code_author_min_confidence` number, nullable
  - `operating_schedule_id` string, uuid, nullable
  - `schema_change_config` SchemaChangeConfig: Per-rule trigger configuration for schema_change event-type rules. Scopes which kinds of detected schema change should fire the rule. Normalization rules enforced by validators: - `trigger_on="any"` with no `change_types` is the default-equivalent state. Callers should normally send `null` for that case; the API accepts either. - `trigger_on="specific_types"` requires a non-empty `change_types` list whose values all appear in the backend `ChangeType` enum. - Any other value of `trigger_on` must not carry `change_types`. The evaluation service reads this alongside the schema alert service's `change_types_present` context projection (TECH-963).
    - `trigger_on` 'any' | 'breaking' | 'non_breaking' | 'specific_types', required
    - `change_types` string[], nullable

## Response `200`

Successful Response

- StandardResponse: Standard API response wrapper.
  - `success` boolean, required
  - `data` unknown
  - `message` string, nullable
  - `error` string, nullable
  - `meta` object, nullable

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api.md) · [All operations](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/llms.txt) · [OpenAPI document](https://skmtc.dev/anomalyarmor/apis/anomalyarmor-api/revisions/51c755fb5d0b?raw)
