Skip to main content

Create Gate

Create a review gate with POST /v1/structuring/gates, scoped to one schema. Gates aggregate rule thresholds and control the review workflow.

POST /v1/structuring/gates creates an review gate that controls the flow of structuring results to delivery for one schema. A gate starts with no rules; add rules via the gate rules endpoint to define quality thresholds. The on_approve and on_flag fields control what happens when results pass or fail the gate's rules.

A newly created gate has an empty rules array. Results will auto-approve until you add at least one rule via POST /v1/structuring/gates/{id}/rules.
POST/v1/structuring/gates

Body parameters

name*stringGate name.
user_schema_id*uuidSchema this gate applies to. Must be a valid UUID.
on_approvestringAction on approval. Defaults to export.
on_flagstringAction on flag. Defaults to queue.
auto_approve_after_hoursnumberHours after which pending items auto-approve. Omit to disable.
destination_iduuidOptional delivery destination to link to this gate.

Response

Response fields (201 Created)

idstringGate UUID.
namestringGate name.
user_schema_idstringSchema this gate applies to.
destination_idstring | nullLinked delivery destination, if provided.
on_approvestringAction on approval.
on_flagstringAction on flag.
auto_approve_after_hoursnumber | nullHours before auto-approval, if configured.
is_activebooleanAlways true for newly created gates.
rulesarrayEmpty array — rules must be added separately.
created_atstringISO 8601 creation timestamp.
updated_atstringISO 8601 last update timestamp.
linksobjectRelated resource URLs (self, rules).

Response (201 Created)

{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "name": "Finance approval gate",
  "user_schema_id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "destination_id": null,
  "on_approve": "export",
  "on_flag": "queue",
  "auto_approve_after_hours": null,
  "is_active": true,
  "rules": [],
  "created_at": "2024-09-14T12:00:00.000Z",
  "updated_at": "2024-09-14T12:00:00.000Z",
  "links": {
    "self": "/v1/structuring/gates/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "rules": "/v1/structuring/gates/a1b2c3d4-e5f6-7890-abcd-ef1234567890/rules"
  }
}

Errors

Error responses

400bad_requestValidation failed (missing name or user_schema_id) or no specific organization context available (master-view API key used on a create operation).
401unauthorizedMissing or invalid API key.
429rate_limitedToo many requests. Retry after the period indicated in the Retry-After header.

A gate starts with an empty rules array, which means all results auto-approve until you add rules. The typical setup sequence is: create the gate, then immediately call POST /v1/structuring/gates/{id}/rules to add a min_confidence rule with your desired threshold. Optionally set destination_id to route approved results directly to a delivery destination.