Skip to main content

Create Gate

Create an approval gate with optional schema scope. Gates aggregate validation checks and control approval workflows.

Create an approval gate to control the flow of structuring results to delivery. 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

Response

Response fields (201 Created)

idstringGate UUID.
namestringGate name.
user_schema_idstring | nullSchema scope, if provided.
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_requestNo specific customer 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.