Add a bank-authored rule
const url = 'http://localhost:8080/v1/rules/custom';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"id":"example","title":"example","severity":"example","field":"example","comparison":"example","kind":"example","docType":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:8080/v1/rules/custom \ --header 'Content-Type: application/json' \ --data '{ "id": "example", "title": "example", "severity": "example", "field": "example", "comparison": "example", "kind": "example", "docType": "example" }'Creates a declarative rule; a canonical field plus one comparison: agree (every source must agree, under the bank’s tolerances), matches_lar (documents must match the approval record) or present (the field must exist, optionally on one document type). The id is derived from the title (CUSTOM-…) unless given. Evaluated by the same deterministic engine as the shipped catalog. Administrators only. 400 with reasons when the spec is invalid, 409 for a duplicate id.
Request Bodyrequired
Section titled “Request Bodyrequired”Wire shape for creating/editing a custom rule; maps 1:1 onto CustomRuleSpec.
object
Examplegenerated
{ "id": "example", "title": "example", "severity": "example", "field": "example", "comparison": "example", "kind": "example", "docType": "example"}Responses
Section titled “Responses”OK
object
One row of the Rules page: a shipped or bank-authored rule with its policy state.
object
One bank-authored rule, declaratively: a canonical field and one of three comparisons. Evaluated by CustomRule; the same deterministic engine path as the shipped catalog, so custom rules are configuration, never code, and runtime behaviour stays explainable line by line.
object
Examplegenerated
{ "rulesetVersion": "example", "rules": [ { "id": "example", "version": "example", "severity": "example", "title": "example", "fields": [ "example" ], "enabled": true, "isCustom": true, "spec": { "id": "example", "title": "example", "severity": "example", "field": "example", "comparison": "example", "kind": "example", "docType": "example" } } ]}