---
title: "Update an alert rule"
method: PATCH
path: "/v1/platform/alerts/{session_id}/{alert_rule_id}"
tags: ["alert_rules"]
---

# Update an alert rule

`PATCH /v1/platform/alerts/{session_id}/{alert_rule_id}`

Updates an alert rule.

## Path parameters

- `session_id` string, required
- `alert_rule_id` string, required

## Request body

- AlertsUpdateAlertRuleRequest
  - `actions` AlertsAlertActionBase[], required
    - `alert_rule_id` string
    - `config` object, required
    - `id` string
    - `target` 'pagerduty' | 'webhook' | 'dynatrace', required
  - `rule` AlertsAlertRuleBase, required
    - `aggregation` 'avg' | 'sum' | 'pct', required
    - `attribute` 'latency' | 'error_count' | 'feedback_score' | 'run_latency' | 'run_count' | 'total_cost', required
    - `denominator_filter` string
    - `description` string, required
    - `filter` string
    - `id` string
    - `name` string, required
    - `operator` 'gte' | 'lte' | 'gt' | 'lt', required
    - `threshold` number
    - `threshold_multiplier` number
    - `threshold_window_minutes` integer
    - `type` 'threshold' | 'change', required
    - `window_minutes` integer, required — 1-60 minutes for alert rule

## Other responses

- `400` — Bad request
- `403` — Forbidden
- `404` — Not found
- `500` — Internal server error
- `503` — Service unavailable

## Changes

- **2026-04-13** `e86be67718ee` — 1 warning, 2 info
  - the `rule/window_minutes` request property's min was set to `1.00`
  - added the new `total_cost` enum value to the request property `rule/attribute`
  - the `rule/window_minutes` request property's max was increased from `15.00` to `60.00`
- **2026-03-31** `9b9d7777d6a9` — 1 info
  - added the new `dynatrace` enum value to the request property `actions/items/target`
- **2026-03-24** `6b0ee17295ef` — 2 info
  - added the new `gt` enum value to the request property `rule/operator`
  - added the new `lt` enum value to the request property `rule/operator`

[Change history](https://skmtc.dev/langchain-ai/apis/langsmith/changes/v1/platform/alerts/:session_id/:alert_rule_id/patch.md)

---

[API](https://skmtc.dev/langchain-ai/apis/langsmith.md) · [All operations](https://skmtc.dev/langchain-ai/apis/langsmith/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/langchain-ai/langsmith/revisions/a0acb3a6a101/schema)
