Get Metric Alert Rule
Returns one rule by UUID. Scoped to the calling user — the rule must belong to the caller or the response is 404.
Path parameters
uuid string (uuid) Req
Alert rule UUID. Returned by Create + List.
Response (200 OK)
uuid string (uuid)
Stable identifier for this rule.
name, description string
User-supplied label + optional context.
metric, operator, threshold enum / string / number
The comparison. See Create for the metric and operator vocabularies.
window_seconds, cooldown_seconds int
Aggregation window and minimum gap between notifications.
endpoint_uuid string (uuid)?
The endpoint this rule is scoped to. Omitted for an account-wide rule.
enabled boolean
When false the evaluator skips this rule.
notify_channels array<Channel>
Configured delivery targets —
email, webhook, slack, or discord. A channel's secret is write-only: a channel that has one answers "secret": "****", never the value; a channel without one has no secret key. To keep the saved secret on an update, send **** back.status enum
Current evaluator state. One of:
unknown— rule was just created; the evaluator has not run a cycle on it yet.ok— last evaluation found the metric within the threshold.firing— last evaluation found the metric crossed the threshold; notifications were dispatched on the transition into this state.
test is a status that may appear on event rows (Test button dispatches), but it never appears on the rule itself.
last_value number (nullable)
Most recent observed value. Null before the first evaluator cycle.
last_evaluated_at, last_triggered_at timestamp (nullable)
RFC 3339 timestamps.
last_triggered_at is the most recent ok→firing transition.created_at, updated_at timestamp
RFC 3339.
Deprecated: until the sunset this response also carries the legacy integer id and *_id fields. Don't use them; read uuid and the *_uuid fields.
Errors
401 Unauthorized
Missing auth.
404 Not Found
No rule with that UUID owned by the caller.
Request
curl "https://api.ngris.com/v1/traffic/alerts/019c12ab-1cf9-7acd-9ca4-e05a5284d4d8" \
-H "X-API-KEY: <your_api_key>"
Response — 200 OK
{
"uuid": "019c12ab-1cf9-7acd-9ca4-e05a5284d4d8",
"name": "5xx spike on api",
"metric": "error_rate_pct",
"operator": ">",
"threshold": 1.0,
"window_seconds": 300,
"endpoint_uuid": "019bb1e4-e785-77d2-9966-c3cff31d0a0e",
"cooldown_seconds": 600,
"enabled": true,
"status": "firing",
"last_value": 1.7,
"last_evaluated_at": "2026-05-21T12:34:56Z",
"last_triggered_at": "2026-05-21T12:30:01Z",
"notify_channels": [
{"type": "email", "target": "ops@acme.dev"},
{"type": "webhook", "target": "https://hooks.acme.dev/ngris", "secret": "****"}
],
"created_at": "2026-05-20T09:00:00Z",
"updated_at": "2026-05-21T12:30:01Z"
}
Was this helpful?