Skip to content

Custom States

Custom monitor states let you extend the default state machine (up/down/degraded) with domain-specific states such as draining, canary, or rollback. States drive notification routing and status-page badges.

MethodPathDescriptionScope
GET/api/v1/monitor-statesList custom states defined for the org.monitors
POST/api/v1/monitor-statesCreate a custom state.monitors
PATCH/api/v1/monitor-states/{id}Update.monitors
DELETE/api/v1/monitor-states/{id}Delete. Fails if rules still reference it.monitors
GET/api/v1/monitors/{id}/rulesList the rule set applied to one monitor.monitors
PUT/api/v1/monitors/{id}/rulesReplace the rule set for one monitor.monitors

POST /api/v1/monitor-states

{
"name": "draining",
"label": "Draining",
"severity": "warning",
"color": "#f59e0b",
"visibility": "private"
}
FieldNotes
namesnake_case, unique within the org.
severityinfo, warning, critical; drives alerting.
visibilityprivate (internal only) or public (shown on status pages).

PUT /api/v1/monitors/{id}/rules

{
"rules": [
{
"when": {"http_status_in": [429, 503]},
"set_state": "draining"
},
{
"when": {"response_header_equals": {"x-canary": "true"}},
"set_state": "canary"
}
]
}

Rules are evaluated in order; the first match wins. If none match, the default state machine applies.

See Monitors → Custom States for the rule grammar.