Agent

Update a routing rule (v1.126)

operator_passkey assurance. PATCH semantics: only fields PRESENT in the body are touched — {"project_id": null} clears the filter to wildcard, while omitting project_id leaves it unchanged. Same validation as create for any field supplied, plus enabled.

patch/agent/v1/notifications/rules/{rule_id}

Request

  • Base URL: https://api.run402.com
  • URL: https://api.run402.com/agent/v1/notifications/rules/{rule_id}
  • Auth: API key in header SIGN-IN-WITH-X

Path parameters

rule_idstring uuid required

Headers

SIGN-IN-WITH-Xstring required

SIWX auth header — base64-encoded JSON payload containing a signed CAIP-122 (EIP-4361) message. See https://docs.x402.org/extensions/sign-in-with-x.

Request body

project_idstring nullable
source'app' | 'platform' nullable
event_typesstring[] nullable
classesstring[] nullable
min_severity'info' | 'notice' | 'warn' | 'critical'

Present → replaces the stored minimum (400 INVALID_MIN_SEVERITY outside the vocabulary). Absent → unchanged; an update never re-derives the create-time default.

group_bystring[] nullable

Present → replaces (null clears). The merged rule must keep a window under a group: 400 INVALID_WINDOW_SECONDS otherwise.

window_secondsinteger nullable

Present → replaces (null returns the rule to per-event delivery; a pending window is discarded unsent, the feed keeps every event).

escalation_levelinteger

Escalation rules only. A rule keeps its channel: channel is not patchable, and the other channel's field is 400 INVALID_RULE_FIELD.

telegram_binding_idstring uuid
enabledboolean

Response

Updated rule

idstring uuid
recipient_emailstring
project_idstring nullable

Wildcard when null.

source'app' | 'platform' nullable

Wildcard when null.

event_typesstring[] nullable

Wildcard when null. An explicit [] matches NO event_type — a real, if unsatisfiable, filter — distinct from omitting the field.

classesstring[] nullable

Wildcard when null; same [] semantics as event_types.

min_severity'info' | 'notice' | 'warn' | 'critical'

event-attention-rules: only events at or above this severity match. Never null: a rule created without one stores notice when it names no event_types (routine traffic stays in the feed) and info when it names some (naming a type opts in to it). Rules that existed before severity shipped read info and deliver exactly what they did.

group_bystring[] nullable

event-attention-rules: 1 to 3 top-level payload keys (^[A-Za-z_][A-Za-z0-9_]{0,63}$) whose values group a window's events; needs window_seconds. A rule holds at most 200 distinct keys per window; further keys are counted under (other), so varying a payload value multiplies neither messages nor stored state.

window_secondsinteger nullable

event-attention-rules: reduce a run of events to ONE message per closed wall-clock window (aligned to multiples of window_seconds), with one line per group key ordered by count, ten lines then a summary, plus the total and up to three bounded samples. 60 to 86400. Null delivers per event.

next_window_closes_atstring date-time

Windowed rules only: when the current window closes — the earliest a message can arrive. Computed at read.

escalation_levelinteger nullable

event-attention-rules: set exactly for channel escalation — the ladder level a match raises at (the lowest staffed level at or above it).

escalation_refused_countinteger

Escalation rules: raises the bounds refused (20 per rule per UTC day; 20 open per organization). 0 otherwise.

last_escalation_refused_atstring date-time nullable
channel'telegram' | 'escalation'

event-attention-rules: telegram sends to telegram_binding_id; escalation raises on the organization's escalation ladder at escalation_level (mandatory delivery to the contacts there, one-tap ack, deadman climb), and one open escalation per rule: a repeat attaches. Was generic on purpose (widening to email/webhook rules later is a CHECK-constraint migration, not a reshape); v1 only ever writes 'telegram'.

telegram_binding_idstring uuid
enabledboolean
created_atstring date-time
updated_atstring date-time

Changes

No recorded changes to this operation across all 1 revision of this API.