Skip to Content
Alerts

Preview alert

Permissionalerts:createAdd-onAlertsRetriesIdempotency-Key requiredAuthentication
POST
/alerts/preview

Team-scoped Alerts operation. Rule percentages use eligible invocations or processing attempts, not affected calls. An open incident emits one firing and one confirmed-recovery notification per selected member. Empty or stale windows never resolve an incident. Preview uses recent observations without notifications.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Use a Voice API key or connected-app OAuth access token. Authentication.

Header Parameters

Idempotency-Key*string

Required. Reuse the same key to retry this write safely. Retries and idempotency.

Match^[A-Za-z0-9!#$%&'*+.^_`|~-]+$
Length1 <= length <= 255

Request Body

application/json
  1. body
min_coverage_percent?integer

Minimum successful processing coverage, in percent, for extraction result rules. Incomplete coverage cannot resolve incidents. 0 (or omitting the field) means the default of 80; a stored 0 is omitted from responses.

Range0 <= value <= 100
Default80
metric*string

Signal to watch. trunk_registration, outbound_redial_loop, campaign_auto_paused, dncr_unresolved, dncr_connection and the backlog signals support count aggregation only. For call, trunk and outbound signals resource_keys are SIP trunk IDs; DNCR and campaign signals take no resource_keys.

Value in"tool_5xx""tool_timeout""tool_failure""webhook_failure""webhook_terminal""webhook_backlog""extraction_failure""extraction_backlog""extraction_result""call_failure""call_route_failure""call_unanswered""trunk_registration""outbound_redial_loop""campaign_auto_paused""dncr_provider_failure""dncr_rate_limited""dncr_registered""dncr_unresolved""dncr_connection"
campaign_ids?array<>

Campaigns to watch. Only for call_failure, call_route_failure, call_unanswered, outbound_redial_loop, campaign_auto_paused and the dncr_ signals; omitted or empty means every campaign and non-campaign call.

Itemsitems <= 20
failure_codes?array<>

Only for call_failure. Counts only failed calls with one of these failure codes; omitted or empty counts every failure.

Itemsitems <= 16
aggregation*string
Value in"rate""count"
severity*string
Value in"warning""critical"
resource_keys*array<>
Itemsitems <= 20
agent_ids*array<>
Itemsitems <= 20
window_minutes*integer
Value in5101530601801440
threshold*number
Range0 <= value
recovery_threshold*number
Range0 <= value
min_samples*integer
Range1 <= value <= 1000000
fire_for_minutes*integer
Range0 <= value <= 60
recover_for_minutes*integer
Range0 <= value <= 60
recipient_ids*array<>
Items1 <= items <= 20
include_tests*boolean
field?string
Lengthlength <= 120
operator?string
Value in"eq""neq""gt""lt""missing"
expected?string|number|boolean

Response Body

Successful Alerts operation

application/json
  1. response
data*array<>
coverage_note*string
Example Request
curl -X POST 'https://api.kejue.co/v1/alerts/preview' \  -H 'Idempotency-Key: string' \  -H 'Content-Type: application/json' \  -d '{  "metric": "tool_5xx",  "aggregation": "rate",  "severity": "warning",  "resource_keys": [    "string"  ],  "agent_ids": [    "06fc211d-6a87-43c8-9a41-e3b40320420d"  ],  "window_minutes": 5,  "threshold": 0,  "recovery_threshold": 0,  "min_samples": 1,  "fire_for_minutes": 0,  "recover_for_minutes": 0,  "recipient_ids": [    "bfa6ab48-642a-4965-a829-f20c353d1c93"  ],  "include_tests": true}'
Example Response
{  "data": [    {      "at": "2019-08-24T14:15:22Z",      "value": 0,      "numerator": 0,      "denominator": 0,      "state": "string"    }  ],  "coverage_note": "string"}