Update a rule
Updates a rule. Changing the condition, the effective period, the action, the method chain or window_member_scope mints a new version and queues a re-evaluation, except on an on_demand rule, and the response carries backfill_enqueued to say whether one started. Changing the name, the alert message, requires_approval or evaluation updates the rule in place. Switching requires_approval off withdraws every proposal still pending on the rule.
Authorizations
Body
The rule body on a create or update. On an update, send only the fields you are changing.
Response
200
A data rule on a project. The rule's identity is stable across edits; the condition lives on its latest version.
Rule friendly ID.
"rule_Qb3k9TzdL0pWnXyz"
Proposed corrections waiting on a decision across the rule's active versions.
Link that opens this rule in the Mangrove app.
"https://app.gomangrove.com/nexus/prj_AbCd1234567890Ef/settings/data-rules/rule_Qb3k9TzdL0pWnXyz"
Derived from action. Read-only.
alert, substitution alert flags the matching record and changes nothing. substitute replaces the matching value with one derived from method_chain. Only data point rules may substitute.
alert, substitute Ordered substitution candidates. The first method that resolves wins. Empty on alert rules.
Which data points in a fired window the rule acts on. none acts on the data point that made the condition true. all extends the action to every data point in the window: an alert rule flags them, a substitute rule corrects them. repeats acts on the repeated values in a stuck-sensor run and leaves the value that opened the run as measured. Anything other than none needs a windowed aggregate in rule_text.
none, all, repeats Whether this rule's corrections wait for a person to approve them instead of being written. Substitute rules only.
automatic rules are evaluated as data arrives, and over history when the rule is saved. on_demand rules run only over a period started with Re-evaluate a rule over a period. An on_demand model rule is not evaluated when its model run finishes.
automatic, on_demand data_point evaluates event data as it arrives. model evaluates model outputs after a batch calculation.
data_point, model active The condition, in the rule expression language.
"{{data-point.ambient-temperature-c}} < 0"
On an alert rule, narrows which of the values the condition reads may be flagged. On a substitute rule, names the single value the rule corrects.
Shown on the records this rule flags. Required on an alert rule. Optional on a substitute rule, where it covers the records whose method chain resolved nothing, and Mangrove supplies a default.
Model rules only.
Whether this update started a re-evaluation. An on_demand rule starts none, so it reads false there even when the update minted a version.