Overview
Configuration rating form-logic rules determine which forms are attached to a policy or quote. Rules are stored in the rating engine revision’s config JSON (rating_engine_revisions.config.policyFormLogicConfigs). Each rule has a shouldAdd conditional expression that is evaluated during rating against the policy, insured, coverage, and form data.
Key Concepts
- ratingEngineRevisionId: The rating engine revision whose config holds the rules — must already exist.
- revisionStrategy: Controls how the revision is updated —
UpdateExistingRevisionmodifies the specified revision in place.CreateNewRevisionis not yet implemented. - ruleName: Human-readable name for the rule.
- rank: Controls the position of attached forms in the output list (lower numbers appear first). Does not control evaluation order. Duplicates are permitted. Required on create, so returned rules always carry a rank.
- step: Optional — tag controlling which form-selection contexts the rule’s output appears in.
"policies"(appears during policy form selection),"quotes"(appears during quote form selection), or an array of these values. If omitted, the rule’s output only appears during policy form selection. - shouldAdd: A conditional expression that evaluates to true or false. When it evaluates to true, the form is attached. See Expression Shapes below.
API Endpoints
Permissions
GET Query Parameters
GET Response Properties
Each item initems has the following shape.
Filters and sorts run on raw rules; response validation runs only on the surviving rows. A rule that survives filtering but has a missing or malformed
id, rank, or shouldAdd returns a 400 InvalidProperties response. In practice, rules written through this API always pass validation, so this condition indicates a data-integrity issue with legacy config rather than a caller error.
POST Request Properties
Expression Shapes
shouldAdd is a recursive structure built from three variants.
Branch Expression
Combines child expressions with a logical operator.operator values: AND, OR.
Leaf Expression
Compares the value atleftKey against rightValue using the given operator.
operator values: =, !=, <, <=, >, >=, IN, NOTIN, EXISTS, NOTEXISTS, SOME.
Operator-specific behavior:
EXISTS/NOTEXISTS— check only whetherleftKeyresolves to a defined, non-null value.rightValueis required structurally but ignored.IN/NOTIN—rightValueis either an array (membership: theleftKeyvalue must be an element) or a string (substring: theleftKeyvalue must appear withinrightValue).SOME—rightValueis a nested expression evaluated against each element of the array atleftKey. ReturnsfalseifleftKeydoes not resolve to an array.=,!=,<,<=,>,>=— standard JavaScript-style comparison between the resolvedleftKeyvalue andrightValue.
rightValue may be a primitive, an array, null, or — for SOME — a nested expression.
Inverted Leaf Expression
Checks whether a staticleftValue appears in the array (or string) stored at rightKey. Only the IN operator is supported in this shape.
