Skip to main content
PATCH
/
v1
/
alert-rules
/
{rule_id}
Update an alert rule
curl --request PATCH \
  --url https://api.poly.ai/v1/alert-rules/{rule_id} \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "data": {
    "type": "alert-rules",
    "id": "00aa00aa-bb11-cc22-dd33-eeeeeeeeeeee",
    "attributes": {
      "threshold_value": 2000,
      "enabled": false
    }
  }
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "metric": "turn_latency_p50",
  "operator": ">",
  "threshold_value": 1,
  "window_duration_seconds": 2,
  "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<uuid>
required

Body

application/json
data
object
required

Response

Alert rule updated successfully.

id
string<uuid>
required
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_seconds
integer
required
Required range: x >= 1
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