Rules

Rules are workspace-scoped decisioning logic. They evaluate JSON Logic expressions against the full decisioning context — across any model and relationship within that context. Rules are not tied to a single model.

Endpoints

Method
Path
Description

POST

/rules

Create a rule

GET

/rules

List rules

GET

/rules/{ruleId}

Get a rule

PUT

/rules/{ruleId}

Update a rule

DELETE

/rules/{ruleId}

Delete a rule

PUT

/rules/{ruleId}/status/{targetStatus}

Lifecycle transition

Lifecycle

Rules have their own lifecycle, independent of models and contexts:

draft → active → archived
Status
Meaning

draft

The rule is being configured. It does not evaluate.

active

The rule is live. It evaluates against all relevant contexts.

archived

The rule is retired. Active evaluations are removed; the definition is preserved.

Create a rule

POST /rules

Request

Field
Required
Description

name

Yes

Human-readable rule name

description

No

What the rule checks

category

No

Freeform grouping string (e.g., affordability, identity, compliance)

severity

Yes

Impact level: hard, soft, or info

expression

Yes

Valid JSON Logic expression

Severity levels

Severity
Meaning

hard

Blocking. The decision cannot proceed if this rule fails.

soft

Warning. Flags an issue but does not block the decision.

info

Informational. Logged for audit but triggers no action.

Response 201 Created

The server validates the JSON Logic expression and resolves all var references against existing model fields in the workspace. Invalid expressions or unresolvable paths return 422 Unprocessable Entity.

inputPaths is derived from the expression at creation time — it is a read-only field listing all field paths the rule depends on.

Get a rule

Response 200 OK

Same shape as the create response.

List rules

Supports standard filtering and sorting.

Useful filters

Update a rule

Rule updates use PUT (full replacement) rather than PATCH (partial update). Provide the complete rule definition in every update request — any omitted fields will be cleared. This differs from other resources in the API (models, records, contexts) which support partial updates via PATCH.

Updating an active rule bumps the version and marks all affected evaluation rows stale for recomputation.

Request

Response 200 OK

Returns the full updated rule with the new version.

Lifecycle transition

Effects

  • Activating a rule creates evaluation rows for all relevant contexts and triggers initial evaluation.

  • Archiving a rule removes active evaluations and preserves the definition.

Error cases

Scenario
Status

Invalid transition (e.g., archiveddraft)

422 Unprocessable Entity

Delete a rule

Performs a soft delete — the rule is marked as deleted and excluded from system operations but retained for auditing.

Response 204 No Content

Last updated