Replace a rule
Beta. The request and response shapes may still change.
Overwrite a rule in place. The body is the whole rule, not a patch: what you omit is cleared.
The new expression is compiled before it is stored. It is not re-checked against the recipes already scoring over this rule, so an edit that drops an attribute or parameter reference is accepted here and the rule is reported as unavailable at evaluation time. Re-save the recipe to validate the association.
name and expression are required, and the stored rule becomes exactly what you send.
The identifier does not change, so every recipe already scoring over this rule picks up the new condition on its next evaluation. There is no versioning at the rule level.
Editing a rule a recipe depends on
The new expression is compiled against the latest catalog, on its own - not against the recipes that score over it. An edit that starts readingattr.cart_total is accepted here even if no recipe declares that key.
At evaluation time such a rule can’t compile in that recipe’s environment. It reports unavailable and contributes nothing, and the recipe reports partial_evidence. Re-saving the recipe is what checks the pair, and it is the fastest way to confirm an edit landed cleanly.
Aiming a replace at a managed rule’s identifier answers 403 - managed_rule_read_only.Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The rule identifier.
"rul_01jc0t6fwwfgfsq1md24mhyztj"
Body
A label for the rule. It is returned in evaluation results, so make it say what the rule looks for.
128"free_plan_signup"
The condition, written in CEL. It must evaluate to a boolean, and it is compiled before it is stored: an expression that does not compile is refused.
It may reference the signals Prelude resolves for an evaluation, a recipe's request attributes as attr.<key>, and a recipe's configured values as param.<key>. A rule that references either namespace is bound to the recipes declaring those names, and can only be used by them. See Rules, recipes and flows; the signal vocabulary is not published yet, so contact us for the names available to your rules.
"attr.plan_tier == \"free\""
Response
OK
The rule identifier. Reference it in a recipe's rules to score over it.
"rul_01jc0t6fwwfgfsq1md24mhyztj"
"free_plan_signup"
"attr.plan_tier == \"free\""
Always CUSTOM. A rule you author is your own; Prelude's are a separate, read-only listing.
CUSTOM