---
title: "Update alert rule"
method: PUT
path: "/api/v1/sdk/alerts/rules/{rule_id}"
tags: ["public-api", "public-alerts"]
---

# Update alert rule

`PUT /api/v1/sdk/alerts/rules/{rule_id}`

## Request

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

Update an alert rule.

**SDK Usage:**
```python
from anomalyarmor import Client

client = Client()
rule = client.alerts.update_rule(
    rule_id="uuid",
    name="Updated Name",
    is_active=False
)
```

## Path parameters

- `rule_id` string, required

## Headers

- `Authorization` string

## Request body

- AppSharedApiV1PublicAlertsUpdateAlertRuleRequest: Request to update an alert rule.
  - `name` string, nullable: Rule name
  - `description` string, nullable: Rule description
  - `is_active` boolean, nullable: Whether the rule is active
  - `event_types` string[], nullable: Event types to alert on
  - `severities` string[], nullable: Severity levels
  - `tag_filter_mode` string, nullable: Tag filter mode: any or all
  - `tag_filter_tags` string[], nullable: Tags to filter by
  - `is_notify_code_authors` boolean, nullable: Whether to notify code authors when this rule triggers
  - `code_author_min_confidence` number, nullable: Minimum git blame confidence to notify (0.0-1.0)

## 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)
