Gate Rules
Add rules to a review gate with POST /v1/structuring/gates/:id/rules or remove them with DELETE: min_confidence, validation_pass, field_value, and more.
Gate rules are the conditions a structuring result must meet for a review gate to auto-approve it. After validation checks run, every active rule on the gate is evaluated; the result auto-approves only when all rules pass, and a single failing rule records a pending decision that parks the record for manual review. Rules are attached one at a time with POST /v1/structuring/gates/{gateId}/rules and removed with DELETE /v1/structuring/gates/{gateId}/rules/{ruleId}.
Six rule types exist, each reading its own config keys:
- min_confidence — the result's row-level confidence must be at least
config.min(e.g.{ "min": 0.85 }). - field_confidence — one field's confidence (or cell readiness, when available) must be at least
config.min:{ "field": "total_amount", "min": 0.9 }. - validation_pass — the result's failing check outcomes must not exceed
config.max_failures(default 0).config.scopenarrows which checks count:all(default),critical_only(only critical-severity checks), orspecificwith acheck_idsarray. - field_presence — every field in
config.fieldsmust have a non-null value. - field_value — one field must satisfy an operator test:
{ "field": "currency", "operator": "in", "value": ["EUR", "USD"] }. Operators:eq,neq,gt,lt,gte,lte,in,not_in,regex. - canonical_complete — passes only once every conflicting field on the result has a canonical selection; used for multi-document reconciliation flows. It always fails at initial evaluation and is re-checked when canonical selections complete.
/v1/structuring/gates/{gateId}/rulesBody parameters
curl
curl -s -X POST https://api.talonic.com/v1/structuring/gates/4014c518-7f75-425c-bf67-3052464b95a0/rules \
-H "Authorization: Bearer tlnc_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"name": "Row confidence at least 0.85",
"type": "min_confidence",
"config": { "min": 0.85 }
}'Response
Response fields (POST)
Response (POST)
{
"gate_id": "4014c518-7f75-425c-bf67-3052464b95a0",
"name": "Row confidence at least 0.85",
"type": "min_confidence",
"config": { "min": 0.85 },
"sort_order": 0,
"id": "285aae61-8378-49e2-926a-ac54e4e54853",
"is_active": true,
"created_at": "2026-08-29T11:35:30.485Z"
}/v1/structuring/gates/{gateId}/rules/{ruleId}Path parameters
Response (DELETE)
{
"deleted": true
}Errors
Error responses
Rules compose with checks through validation_pass: checks record per-issue outcomes, and the rule aggregates them into a single go/no-go. The strictest useful policy is { "scope": "all", "max_failures": 0 } — any failing check flags the record. A more forgiving production pattern scopes to critical_only so advisory warning checks never block, or names specific contract-critical checks via { "scope": "specific", "check_ids": [...] }. Note that check outcomes with status skip and error do not count as failures here — only explicit fail verdicts do.
When a decision lands as pending, its rule_results array records each rule's verdict by rule_id, rule_name, type, and passed, so a review UI can show exactly which condition held a record back. Removing a rule is soft: past decisions keep the recorded verdicts of the deleted rule, while future evaluations simply no longer include it.