Skip to content

Where the alerts of the nodes a draft rule reaches would go across the week, with the draft saved as it stands (ADR-266 decision 5).

GET
/api/v1/routing-rules/preview
curl --request GET \
--url https://example.com/api/v1/routing-rules/preview \
--header 'Authorization: Bearer <token>'

The draft takes the edited rule’s place in the order, or lists last when rule_id is omitted, and is read as switched on. Only the nodes it reaches are drawn, grouped by the rules that decide for them and the zone they keep time in, and each week is judged every minute so the edge of the draft’s hours is drawn where it is. Nothing is saved.

rule_id
string | null format: uuid

The rule being edited: the draft takes its place in the order. Omitted for a new rule, which lists last.

severity
string | null

unreachable, critical, warning or info. Omitted = any severity, and the week is drawn for unreachable — node-down, the alert a person is woken for (ADR-277).

tags
string | null

Tags the node must carry one of (or every one, by tag_match), one per line (the way GET /node-tags takes reach).

group_ids
string | null

Folder ids the node must be inside one of, comma-separated.

join
One of:
null

How folders and tags combine when both are given: or (the default) or and.

tag_match
One of:
null

How the tags combine among themselves: any (the default) or all (ADR-267).

mode
One of:
null

always (the default), during or outside.

days
string | null

ISO weekdays of the window, comma-separated (1 = Monday .. 7 = Sunday).

start_minute
integer | null format: int32

Minutes after local midnight, 0 to 1439.

end_minute
integer | null format: int32

Minutes after local midnight, 0 to 1439.

when_closed
One of:
null

next_rule (the default) or hold.

hold
boolean | null

The rule holds instead of sending while open. Omitted = false.

channel_ids
string | null

Channel ids, comma-separated.

The nodes the draft reaches, grouped by the rules that decide for them, and where their alerts go across the week

Media typeapplication/json

Where the alerts of the nodes a draft rule reaches would go across the week (ADR-266 decision 5).

object
catch_all
required

The catch-all’s channels, so a stretch drawn as catch_all can be named.

Array<string>
default_zone
required

The zone a node whose folders name none keeps time in (a row whose zone is null).

string
rows
required

One per set of deciding rules and zone among the nodes the draft reaches, the most nodes first. Empty when it reaches no node.

Array<object>

One group of the nodes a draft reaches, and its week, judged every minute.

object
changes_at_minute

The minute of the week at which where an alert goes next changes, from Monday 00:00 local; null when it does not change within a week.

integer | null format: int32
node_count
required
integer
now_minute
required

The minute of the week it is now in this zone, from Monday 00:00 local.

integer format: int32
rule_ids
required

The rules that decide for these nodes, in order, the draft among them.

Array<string>
segments
required

Stretches in minutes from Monday 00:00 local, each with the rule that decides.

Array<object>

One stretch of the week in which an alert goes to the same place (ADR-262 decision 8). Minutes are counted from Monday 00:00 local time.

object
channel_ids
required

The channels it goes to; empty when held or going nowhere.

Array<string>
end
required
integer format: int32
kind
required

Where an alert goes during a [CoverageSegment].

string
Allowed values: rules catch_all held nowhere
rule_id

The rule that decides during the stretch (ADR-266 decision 4): the open rule that sends or holds, or a closed rule that holds while closed. null when the catch-all takes the alert, when it is held because no rule is open, and when it goes nowhere.

string | null format: uuid
start
required
integer format: int32
zone

The zone these nodes keep time in; null for the deployment’s default.

string | null
rule_id
required

The id the draft’s stretches carry in rule_id: the edited rule’s, or the nil id for a new rule.

string format: uuid
severity
required

The severity the week is drawn for: the draft’s own, or unreachable (node-down) when it names none.

string
Allowed values: info warning critical unreachable
Example
{
"rows": [
{
"segments": [
{
"kind": "rules"
}
]
}
],
"severity": "info"
}

A severity outside unreachable|critical|warning|info, a tag that is empty, too long or holds a control character, a malformed id, or a window with no weekday in 1..7 or a minute outside 0..1439 (invalid_rule)

Media typeapplication/json

The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies undescribed — a client that has to guess the failure shape ends up parsing the success shape and reading undefined.

object
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

No valid bearer token

Media typeapplication/json

The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies undescribed — a client that has to guess the failure shape ends up parsing the success shape and reading undefined.

object
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

Role lacks ManageSystem

Media typeapplication/json

The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies undescribed — a client that has to guess the failure shape ends up parsing the success shape and reading undefined.

object
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

rule_id names no rule (rule_not_found)

Media typeapplication/json

The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies undescribed — a client that has to guess the failure shape ends up parsing the success shape and reading undefined.

object
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}

This core has no write side (skeleton mode)

Media typeapplication/json

The ADR-019 envelope every failure renders as. pub(crate) and schema-bearing so the OpenAPI document can name one error shape for every endpoint (ADR-035) instead of leaving 4xx/5xx bodies undescribed — a client that has to guess the failure shape ends up parsing the success shape and reading undefined.

object
error
required
object
code
required

Stable machine-readable code. Clients branch on this, never on the message.

string
message
required

Operator-facing sentence. Safe to display; never carries an internal error’s own text.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example"
}
}