Skip to main content
POST
/
api
/
external
/
companies
/
{companyId}
/
configuration
/
rating
/
form-logic
curl --request POST \
  --url https://app.aiinsurance.io/api/external/companies/{companyId}/configuration/rating/form-logic \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "ratingEngineRevisionId": "e06153b8-53c8-4305-bc23-0b67450ec450",
  "revisionStrategy": "UpdateExistingRevision",
  "ruleName": "Attach Certificate of Insurance",
  "rank": 1,
  "step": "policies",
  "shouldAdd": {
    "leftKey": "form.number",
    "operator": "=",
    "rightValue": "FM-0001"
  }
}
'
{
  "id": "bc6a626e-7a96-49fd-b477-2b18cf189a0d"
}

Authorizations

Authorization
string
header
required

API key authentication. Include your API key in the Authorization header.

Path Parameters

companyId
string<uuid>
required

Company identifier

Body

application/json

Request body for creating a form-logic rule in a rating engine revision's config JSON

ratingEngineRevisionId
string<uuid>
required

The rating engine revision to add this rule to. Must reference an existing, non-deleted revision belonging to this company (otherwise the request returns 404).

revisionStrategy
enum<string>
required

How to handle the rating engine revision. UpdateExistingRevision modifies the specified revision in place. CreateNewRevision is not yet implemented and will return a 501 error.

Available options:
UpdateExistingRevision,
CreateNewRevision
ruleName
string
required

Human-readable name for the rule (e.g. "Attach Certificate of Insurance").

Minimum string length: 1
rank
number
required

Sort order for this rule relative to others on the same revision. Controls the position of attached forms in the output list (lower numbers appear first). Duplicates are permitted.

shouldAdd
Branch Expression · object
required

A conditional expression that evaluates to true or false during rating (of either a quote or a policy). Determines whether a form should be attached. Three variants are supported.

step

Tag controlling which form-selection contexts this rule's output appears in — "policies" (output appears during policy form selection), "quotes" (output appears during quote form selection), or an array of these values. If omitted, the rule's output only appears during policy form selection; specify "quotes" (or an array that includes it) to also participate in quote form selection.

Available options:
policies,
quotes

Response

Form-logic rule created successfully

id
string<uuid>
required

The server-generated ID of the created rule