Skip to main content
PATCH
Update rule

Authorizations

Authorization
string
header
required

Path Parameters

project_id
string
required

The project's friendly ID (e.g. prj_aBcD1234eFgH5678).

rule_id
string
required

Body

application/json
rule
object
required

Response

Rule updated

A rule on a project's project-scope rule set. Identity is stable; rule_text lives on the latest RuleVersion, while alert_message lives on the rule itself.

id
string

Friendly ID (e.g. rule_abc123…)

Example:

"rule_4cd9b2f6e1a08"

pending_count
integer
read-only

Undecided proposals across active versions of all periods of this runnable rule. Zero for disabled rules.

Required range: x >= 0
name
string
rule_type
enum<string>

Derived from action — read-only.

Available options:
alert,
substitution
action
enum<string>

What the rule does — alert flags the record, substitute replaces the value (a substituted missing value is an imputation). Only data_point rules may substitute.

Available options:
alert,
substitute
method_chain
object[]

The latest version's method chain, tried in order until a method resolves a value. Empty for alert rules.

window_member_scope
enum<string>
default:none

Versioned action reach. Requires a windowed aggregate unless none. none acts on the firing data point alone; all reaches same-slug data points in the fired windows; repeats keeps that window boundary and requires a predecessor with the same value, preserving the reading that opens the run. Existing repeats versions retain this behavior. run requires a flat-window condition for the subject and extends the action in both directions through the same original value, including the opener and readings outside the detection window. A changed value, conflicting values at one timestamp, the rule's effective-period boundary, or a gap that neither touching spans nor the event type's cadence connects ends the run. A reading another rule corrected is judged by its measured value: the walk passes through it and it is not attributed to this rule. A single recorded zero or missing reading outside the rule's scope can be crossed only when the same value resumes immediately; that dropout is not itself attributed. Selecting run creates a new version. Scope-only changes can recover original values through consecutive earlier versions in the same period with unchanged condition, action, and method chain. Manual edits, reverts, or another rule's corrections reset that evidence. The reference population retains repeats-based window exclusions independently of the expanded repair reach, so selecting run alone does not widen reference exclusions. No method may draw its replacement from the run it is replacing. Attributed result context records the firing data point and detection-window end; run attribution also records the run bounds. Dashboard and API v1 authoring are supported; MCP authoring parity is a follow-up.

Available options:
none,
all,
repeats,
run
target_type
enum<string>
Available options:
data_point,
model
status
enum<string>
Available options:
active
enabled
boolean
rule_text
string

Latest version's rule expression

subject_slugs
string[]

Rule-level config: the data point(s) alerts are attributed to (the rule's "subject"). Applied as a read-time lens — changing it does not re-evaluate historical data, only refreshes the alert projection. Empty means attribute to whichever referenced data point breached.

alert_message
string

The rule's alert message. A substitute rule saved without one gets "This rule could not correct this data point." Editing it does not mint a new version.

version
integer

Latest version number

effective_from
string<date> | null

Null when the rule has no lower bound (applies indefinitely from the past).

effective_to
string<date> | null
model_id
string | null

Friendly ID of the targeted model (model rules only)

model_name
string | null
requires_approval
boolean

Whether this rule's corrections wait for a human decision instead of being written. Rule-level config like subject_slugs — toggling it never mints a version. Switching it off withdraws the rule's waiting proposals; measured values stay in force.

evaluation
enum<string>

automatic rules are evaluated as data arrives and over history when the rule is saved. on_demand rules run only when a run is started over a period (POST rule_runs), so a substitute rule may read DATA_CAPTURE_RATE or TIME_NOT_CAPTURED of a data point other than its subject. An on_demand model rule is not evaluated when its model run finishes or is recomputed.

Available options:
automatic,
on_demand
ui_url
string<uri>

Link to the data rule's page in the app.

Example:

"https://app.gomangrove.com/nexus/prj_AbCd1234567890/settings/data-rules/rule_4cd9b2f6e1a08"

created_by
string

Display name of the user who authored the latest version

created_at
string<date-time>
updated_at
string<date-time>
backfill_enqueued
boolean