v1

latestOpenAPI 3.1.02026-07-2687120159.0 KB

Update an alert rule

Update an alert rule. Only the fields included in the request body are changed.

patch/v1/alert-rules/{rule_id}

Path parameters

rule_idstring required
Example:ar_0Kx4mNpQ8rWvYb2dFgHjLs

The rule_id must be a prefixed ID (e.g. ar_0Kx4mNpQ8rWvYb2dFgHjLs).

Request body

namestring

Alert rule name

project_idstring nullable

Project ID

metric'turn_latency_p50' | 'turn_latency_p95' | 'api_errors' | 'function_errors' | 'call_crashes' | 'call_volume'

Metric to monitor.

operator'>' | '<' | '>=' | '<='

Comparison operator used by the alert rule.

threshold_valueinteger
window_duration'5m' | '10m' | '60m'

Evaluation window duration. Allowed values: 5m, 10m, or 60m.

enabledboolean

Example request

{
  "threshold_value": 2000,
  "enabled": false
}

Response

Alert rule updated successfully.

idstring required

Alert rule ID

namestring required

Alert rule name

project_idstring nullable

Project ID

metric'turn_latency_p50' | 'turn_latency_p95' | 'api_errors' | 'function_errors' | 'call_crashes' | 'call_volume' required

Metric to monitor.

operator'>' | '<' | '>=' | '<=' required

Comparison operator used by the alert rule.

threshold_valueinteger required

Threshold value

window_duration'5m' | '10m' | '60m' required

Evaluation window duration. Allowed values: 5m, 10m, or 60m.

enabledboolean required

Whether the alert is enabled

current_state'ok' | 'alert' | 'no_data' | 'unknown'

Current state of an alert rule.

sincestring date-time nullable

When the current state started

last_evaluated_atstring date-time nullable

Last evaluation timestamp

current_valueinteger nullable

Current metric value

created_atstring date-time required

Creation timestamp

updated_atstring date-time required

Last update timestamp

Example response

{
  "id": "ar_0Kx4mNpQ8rWvYb2dFgHjLs"
}