Skip to main content

Gate Rules

Add rules to a review gate with POST /v1/structuring/gates/:id/rules or remove them with DELETE. Rules set thresholds like min_confidence.

Gate rules define the quality thresholds that structuring results must meet to be auto-approved through a review gate. Each rule has a type and a configuration that specifies the threshold. Rules are evaluated in sort_order; if any rule fails, the result is flagged and queued for manual review.

  • min_confidence — requires the row-level confidence score to exceed a threshold (e.g. 0.85)
  • validation_pass_rate — requires a minimum percentage of validation checks to pass
  • field_coverage — requires a minimum percentage of schema fields to have non-null values
POST/v1/structuring/gates/{id}/rules

Body parameters

name*stringRule name.
type*stringRule type (e.g. min_confidence, validation_pass_rate, field_coverage).
configobjectType-specific configuration (e.g. { threshold: 0.85 }).
sort_orderintegerEvaluation order. Defaults to 0.

Response

Response fields (POST)

idstringRule UUID.
gate_idstringParent gate UUID.
namestring | nullRule name.
typestringRule type.
configobject | nullRule configuration.
sort_orderintegerEvaluation order.
is_activebooleanAlways true for newly created rules.

Response (POST)

{
  "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
  "gate_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Minimum confidence",
  "type": "min_confidence",
  "config": { "threshold": 0.85 },
  "sort_order": 0,
  "is_active": true
}

Errors

Error responses (POST)

401unauthorizedMissing or invalid API key.
404not_foundReview gate not found or does not belong to your organization.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.
DELETE/v1/structuring/gates/{gateId}/rules/{ruleId}

Path parameters

gateId*uuidParent review gate identifier.
ruleId*uuidRule identifier to remove.

Response

Response fields (DELETE)

deletedbooleanAlways true on success.

Response (DELETE)

{
  "deleted": true
}

Errors

Error responses (DELETE)

401unauthorizedMissing or invalid API key.
404not_foundReview gate or rule not found, or gate does not belong to your organization.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.

Rules are evaluated in sort_order ascending: if any rule fails, the result is flagged for manual review via GET /v1/structuring/approvals/pending. A common setup is a min_confidence rule at sort_order: 0 followed by a validation_pass_rate rule at sort_order: 1, so confidence is checked before validation pass rate.