Alert rule API
Define sustained conditions, missing-data behavior, and notification ownership.
Alert rules evaluate infrastructure conditions for a resolved resource set. Rules, firing alert instances, and notification attempts have separate identities.
/organizations/{organization_id}/projects/{project_id}/alert-rulesCreates an alert rule for a selected resource set.
Send name, selection, condition, and an optional route. A condition identifies
a metric threshold, named health condition, or no-data check.
To detect fewer than 3 healthy replicas for a volume, send this rule:
{
"name": "Missing volume replica",
"selection": { "resource_ids": ["vol_database"] },
"condition": {
"type": "metric",
"metric": "volume.replica.healthy_count",
"comparison": "less_than",
"value": 3,
"aggregation": "min"
},
"pending_seconds": 300,
"missing_data": "unknown",
"severity": "warning",
"route_id": "route_platform"
}The example requires a metric available from the selected source. Unknown metrics
or incompatible units return 422 invalid_condition. pending_seconds defaults
to 300 and accepts non-negative integer seconds. Missing-data behavior defaults
to unknown and can explicitly be firing; zero substitution is unsupported.
Returns 201 with rule ID and revision. It does not create a firing alert
because a past chart contains a threshold crossing.
Read and edit
/organizations/{organization_id}/projects/{project_id}/alert-rules/{rule_id}Returns requested configuration, enabled state, last evaluation, and ETag. Requires alerts:read.
/organizations/{organization_id}/projects/{project_id}/alert-rules/{rule_id}Updates an alert rule using its current revision.
Requires
If-Match; supplied selection and condition objects replace their whole value.
Invalid revisions leave the rule unchanged.
Disabling a rule stops new evaluations. Historical alert instances remain available under retention. It does not repair the resource's health condition.
Alert instances
/organizations/{organization_id}/projects/{project_id}/alertsLists alert instances matching the selected filters.
Filters by rule, resource, state, and severity. States include
pending, firing, unknown, and resolved. Each instance contains first
observation, last evaluation, acknowledgement, and linked delivery attempts.
/organizations/{organization_id}/projects/{project_id}/alerts/{alert_id}/acknowledgeAcknowledges an alert instance and records response ownership.
Accepts a required reason and optional
owner team. It requires alert ownership permission and returns the updated
instance. Acknowledgement does not force resolution or alter the measured value.
Notification failures
/organizations/{organization_id}/projects/{project_id}/alerts/{alert_id}/deliveriesReturns destination status and retry state. A firing instance can have no successful delivery. A failed webhook endpoint must be repaired separately from the threshold condition.
/organizations/{organization_id}/projects/{project_id}/alert-rules/{rule_id}Deletes an alert rule while retaining historical instances.
Deletion of a rule requires its ETag and retains historical instances. Use alerts and routing for maintenance suppression and Metrics query API to inspect the underlying observations.