Alerts
Create alert
POST
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.
bearerAuthheader
AuthorizationBearer <token>Use a Voice API key or connected-app OAuth access token. Authentication.
Idempotency-Key*stringRequired. Reuse the same key to retry this write safely. Retries and idempotency.
Match
^[A-Za-z0-9!#$%&'*+.^_`|~-]+$Length
1 <= length <= 255application/json- body
name*stringLength
1 <= length <= 120definition*enabled?booleanSuccessful Alerts operation
application/json- response
id*stringFormat
uuidorg_id*stringFormat
uuidname*stringLength
1 <= length <= 120definition*enabled*booleanresource_version*integerstate*stringValue in
"healthy""pending""firing""recovering""insufficient_data""error""paused"value*number|nullnumerator*integerdenominator*integerbreach_since*|nullrecovery_since*|nullevaluated_at*|nulllast_error*string|nullarchived_at*|nullcreated_at*stringFormat
date-timeupdated_at*stringFormat
date-timecurl -X POST 'https://api.kejue.co/v1/alerts' \ -H 'Idempotency-Key: string' \ -H 'Content-Type: application/json' \ -d '{ "name": "string", "definition": { "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
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b", "name": "string", "definition": { "min_coverage_percent": 80, "metric": "tool_5xx", "campaign_ids": [ "3e7ba4c0-66cf-49db-b351-57800273b6f0" ], "failure_codes": [ "provider_busy" ], "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, "field": "string", "operator": "eq", "expected": "string" }, "enabled": true, "resource_version": 0, "state": "healthy", "value": 0, "numerator": 0, "denominator": 0, "breach_since": "2019-08-24T14:15:22Z", "recovery_since": "2019-08-24T14:15:22Z", "evaluated_at": "2019-08-24T14:15:22Z", "last_error": "string", "archived_at": "2019-08-24T14:15:22Z", "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z"}