List Metric Alert Rules

GET /v1/traffic/alerts

Returns the calling user's threshold-based metric alert rules. Each rule defines a metric, an operator, a threshold, a sliding window, optional endpoint scope, a cooldown, and one or more notification channels. The evaluator worker (deployed separately) computes each metric every cycle and transitions a rule into firing when the condition holds.

Pagination is opt-in — omit page/page_size to receive every rule.

Query parameters

page int
1-indexed page number. Defaults to 1.
page_size int
Items per page. When omitted or ≤0 the server applies its default page size; values above the server max are clamped down.
q string
Optional. Server-side search over rule fields. Filtering is applied before pagination.
status string
Optional. Filter by evaluator status (e.g. ok, firing, unknown).
metric string
Optional. Filter to one metric (e.g. error_rate_pct).
enabled string
Optional. enabled/true/1 returns only enabled rules; disabled/false/0 returns only disabled. Omit for both.

Response (200 OK)

items array<Rule>
Rules owned by the calling user. See Get Alert for the per-rule field list. List entries additionally carry two derived fields computed only on this endpoint: last_delivered_at (timestamp of the most recent notification attempt, nullable) and last_delivery_status (delivered | failed | pending | "" when no events).
total int
Total rule count across all pages.
page, page_size int
Echo of the resolved pagination.

Errors

401 Unauthorized
Missing auth.
Request
curl "https://api.ngris.com/v1/traffic/alerts" \ -H "X-API-KEY: <your_api_key>"
Response — 200 OK
{ "items": [ { "uuid": "0d3e9f8a-2b5c-4a7d-9f1a-1a2b3c4d5e6f", "name": "5xx spike on api", "metric": "error_rate_pct", "operator": ">", "threshold": 1.0, "window_seconds": 300, "endpoint_id": 99, "cooldown_seconds": 600, "enabled": true, "status": "ok", "last_value": 0.04, "last_evaluated_at": "2026-05-21T12:34:56Z", "notify_channels": [ {"type": "email", "target": "ops@acme.dev"} ], "created_at": "2026-05-20T09:00:00Z", "updated_at": "2026-05-20T09:00:00Z" } ], "total": 1, "page": 0, "page_size": 0 }
Iris