Update Metric Alert Rule

PUT /v1/traffic/alerts/{uuid}

Replaces the user-mutable fields of an existing rule. Evaluator-owned state (status, last_value, last_evaluated_at, last_triggered_at) is preserved across the update — only the configuration is replaced.

Send the full rule body, not a partial patch. Use the response from Get Alert as the starting point and modify the fields you want to change.

Plan-gated: requires the metric_alerts entitlement (403 without it).

Path parameters

uuid string (uuid) Req
Alert rule UUID.

Request body

Same shape as Create. endpoint_uuid is re-resolved on every update; pass an empty string to clear an endpoint scope.

Response (200 OK)

The updated rule. status and other evaluator fields reflect the worker's last cycle, not the update.

Errors

400 Bad Request
Validation failure or unresolvable endpoint_uuid.
401 Unauthorized
Missing auth.
403 Forbidden
Plan doesn't include metric_alerts.
404 Not Found
No rule with that UUID owned by the caller.
Request — raise threshold + add channel
curl -X PUT "https://api.ngris.com/v1/traffic/alerts/<uuid>" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d '{ "name": "5xx spike on api", "metric": "error_rate_pct", "operator": ">", "threshold": 2.0, "window_seconds": 300, "endpoint_uuid": "<endpoint_uuid>", "cooldown_seconds": 600, "enabled": true, "notify_channels": [ {"type": "email", "target": "ops@acme.dev"}, {"type": "email", "target": "oncall@acme.dev"} ] }'
Response — 200 OK
{ "uuid": "0d3e9f8a-2b5c-4a7d-9f1a-1a2b3c4d5e6f", "name": "5xx spike on api", "threshold": 2.0, "notify_channels": [ {"type": "email", "target": "ops@acme.dev"}, {"type": "email", "target": "oncall@acme.dev"} ], "status": "ok", "last_value": 0.04, "updated_at": "2026-05-21T13:00:00Z" }
Iris