GET /api/v1/alerts/routing/rules
position ascending). It requires alerts.routing.read. Rules that are off are listed too.
curl http://localhost:5080/api/v1/alerts/routing/rules \
-H "authorization: Bearer $MS_TOKEN"
[
{
"id": "3KF0q7vXbJ2mYc8sTn4LwRk9Ez1",
"org_id": "<organization-id>",
"name": "Payments in production",
"enabled": true,
"position": 0,
"conditions": [
{ "key": "env", "operator": "equals", "values": ["prod"] },
{ "key": "service.name", "operator": "in", "values": ["checkout", "cart"] }
],
"min_severity": "error",
"origins": [],
"target": { "kind": "team", "team_id": "<team-id>" },
"created_by": "<user-id>",
"created_at": 1790000000000000,
"updated_at": 1790000000000000
}
]
Rule fields
| Field | Description |
|---|---|
id, org_id | Identifiers of the rule and the organization. |
name | The rule’s name. |
enabled | A rule that is off is not tried. |
position | The order of trying; smaller first. |
conditions | Conditions on the incident’s labels, all of which must hold; empty matches every incident. Each has a key, an operator and values. |
min_severity | The incident’s severity must be at least this: info, warning, error or critical; null for any. |
origins | The origins the rule applies to: rule (alert rules), external (alert sources), synthetic (synthetic checks); empty for all. |
target | Where a matching incident goes: {"kind": "team", "team_id": …} or {"kind": "policy", "policy_id": …}. |
created_by | The user who created the rule. |
created_at, updated_at | When the rule was created and last changed, in microseconds. |
operator:
operator | values | Matches when |
|---|---|---|
equals | One value | The label equals the value. |
not_equals | One value | The label differs from the value, or the incident lacks the label. |
in | One or more values | The label equals any of them. |
matches | One regular expression | The whole label value matches it. |