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
| Method | Endpoint | Description |
|---|---|---|
| GET | /configuration/rating/form-logic | List form-logic rules in the revision config |
| POST | /configuration/rating/form-logic | Create a new form-logic rule in the revision config |
| DELETE | /configuration/rating/form-logic/{formLogicId} | Remove a form-logic rule from the revision config |
Permissions
| Action | Permission |
|---|---|
| List rules | company:read |
| Create rule | company:update |
| Delete rule | company:update |
GET Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ratingEngineRevisionId | string (UUID) | Yes | Rating engine revision whose config holds the rules |
| ruleName | string | No | Filter to rules whose ruleName matches exactly. Must be non-empty when provided. |
| id | string (UUID) | string[] | No | Filter to a single rule ID or an array of rule IDs |
| sortBy | "ruleName" | "rank" | No | Sort field — default ruleName |
| sortDirection | "asc" | "desc" | No | Sort direction — default asc. Ties are broken by id in the same direction. |
GET Response Properties
Each item initems has the following shape.
| Property | Type | Description |
|---|---|---|
| id | string (UUID) | Server-generated rule ID |
| ruleName | string | Human-readable name for the rule |
| rank | number | Sort rank controlling output position (lower first) |
| step | string | string[] | null | "policies", "quotes", an array of the two, or null if the rule was created without a step |
| shouldAdd | object | Conditional expression — see Expression Shapes |
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
| Property | Type | Required | Description |
|---|---|---|---|
| ratingEngineRevisionId | string (UUID) | Yes | Rating engine revision to add the rule to |
| revisionStrategy | string | Yes | "UpdateExistingRevision" or "CreateNewRevision" (501) |
| ruleName | string | Yes | Human-readable name for the rule |
| rank | number | Yes | Sort rank — lower values appear earlier in the attached forms list |
| step | string | string[] | No | "policies", "quotes", or an array of the two |
| shouldAdd | object | Yes | Conditional expression (see below) |
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.
