Alerts API

Delete Alert Rule

Delete an alert rule.

Deletes the rule and its associated state, including the Datadog monitor.

delete
https://api.dev.poly.ai/v1/alert-rules/{rule_id}

Path Parameters

rule_idstringrequired

Response

Successful Response

delete/v1/alert-rules/{rule_id}
 

Update Alert Rule

Update an alert rule (partial updates).

Supports partial updates of alert rule attributes.

patch
https://api.dev.poly.ai/v1/alert-rules/{rule_id}

Path Parameters

rule_idstringrequired

Body

application/json

AlertRuleUpdateRequest

Update alert rule request (PATCH - partial updates)

namestring

Alert rule name

project_idstring

Project ID

metric

Metric to monitor

Allowed values:turn_latency_p50turn_latency_p95api_errorsfunction_errorscall_crashescall_volume

operator

Comparison operator

Allowed values:><>=<=

threshold_valueinteger

Threshold value

>= 0

window_duration

Window duration (5m, 10m, or 60m)

Allowed values:5m10m60m

enabledboolean

Whether the alert is enabled

Response

application/json

Successful Response

AlertRuleResponse

An alert rule: its trigger condition, evaluation window, and current state.

idstringrequired

Alert rule ID

namestringrequired

Alert rule name

project_idstring

Project ID

metricstringrequired

Metric being monitored

operatorstringrequired

Comparison operator

threshold_valueintegerrequired

Threshold value

window_durationstringrequired

Window duration (5m, 10m, or 60m)

enabledbooleanrequired

Whether the alert is enabled

current_statestring

Current alert state

sincestring(date-time)

When the current state started

last_evaluated_atstring(date-time)

Last evaluation timestamp

current_valueinteger

Current metric value

created_atstring(date-time)required

Creation timestamp

updated_atstring(date-time)required

Last update timestamp

patch/v1/alert-rules/{rule_id}

Body

{}
 
application/json

Get Active Alerts

Get active alerts (rules currently in ALERT state).

Returns only alert rules that are currently in ALERT state.

Query params:

  • project_id: Filter by project ID (optional)
  • metric: Filter by metric type (optional)
get
https://api.dev.poly.ai/v1/alerts

Query Parameters

project_idstring

Filter by project ID

metric

Filter by metric

Allowed values:turn_latency_p50turn_latency_p95api_errorsfunction_errorscall_crashescall_volume

Response

application/json

Successful Response

ActiveAlertsListResponse

Every rule currently in the triggered state.

dataarray[object]required

A rule currently in the triggered state, including when it first
crossed the threshold.

Show Child Parameters
get/v1/alerts
 
application/json

ActiveAlertResponse

object

A rule currently in the triggered state, including when it first
crossed the threshold.

alert_rule_idstringrequired

Alert rule ID

namestringrequired

Alert rule name

project_idstring

Project ID

metricstringrequired

Metric being monitored

operatorstringrequired

Comparison operator

threshold_valueintegerrequired

Threshold value

window_durationstringrequired

Window duration (5m, 10m, or 60m)

sincestring(date-time)required

When the alert started

last_evaluated_atstring(date-time)

Last evaluation timestamp

current_valueinteger

Current metric value

Example

ActiveAlertsListResponse

object

Every rule currently in the triggered state.

dataarray[object]required

A rule currently in the triggered state, including when it first
crossed the threshold.

Show Child Parameters
Example