Skip to main content
PATCH
/
v1
/
alert-rules
/
{rule_id}
Update an alert rule
curl --request PATCH \
  --url https://api.us.poly.ai/v1/alert-rules/{rule_id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "threshold_value": 2000,
  "enabled": false
}
'
{
  "id": "ar_0Kx4mNpQ8rWvYb2dFgHjLs",
  "name": "<string>",
  "metric": "turn_latency_p50",
  "operator": ">",
  "threshold_value": 1,
  "window_duration": "5m",
  "enabled": true,
  "current_state": "ok",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "project_id": "<string>",
  "since": "2023-11-07T05:31:56Z",
  "last_evaluated_at": "2023-11-07T05:31:56Z",
  "current_value": 123
}

Authorizations

x-api-key
string
header
required

Path Parameters

rule_id
string
required

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

Pattern: ^ar_[A-Za-z0-9]+$
Example:

"ar_0Kx4mNpQ8rWvYb2dFgHjLs"

Body

application/json
name
string
project_id
string | null
metric
enum<string>
Available options:
turn_latency_p50,
turn_latency_p95,
api_errors,
function_errors,
call_crashes,
call_volume
operator
enum<string>
Available options:
>,
<,
>=,
<=
threshold_value
integer
Required range: x >= 0
window_duration
enum<string>

Evaluation window duration

Available options:
5m,
10m,
60m
enabled
boolean

Response

Alert rule updated successfully.

id
string
required
Pattern: ^ar_[A-Za-z0-9]+$
Example:

"ar_0Kx4mNpQ8rWvYb2dFgHjLs"

name
string
required
metric
enum<string>
required
Available options:
turn_latency_p50,
turn_latency_p95,
api_errors,
function_errors,
call_crashes,
call_volume
operator
enum<string>
required
Available options:
>,
<,
>=,
<=
threshold_value
integer
required
Required range: x >= 0
window_duration
enum<string>
required

Evaluation window duration

Available options:
5m,
10m,
60m
enabled
boolean
default:true
required
current_state
enum<string>
required
Available options:
ok,
alert,
no_data,
unknown
created_at
string<date-time>
required
updated_at
string<date-time>
required
project_id
string | null
since
string<date-time> | null
last_evaluated_at
string<date-time> | null
current_value
integer | null
Last modified on March 31, 2026