Create a schema
Create a draft extraction schema.
Authorizations
Organisation API key from Settings → API / /api/keys/. The secret is
shown once. Send Authorization: Bearer sk-abacus-…. One active key
per organisation. Ingest (/api/v2/ingest/*) refuses API keys — that
surface is Auth0-only with ingest:read / ingest:write scopes.
Body
Write shape for POST /structs/ and PATCH /structs/{slug}/.
Accepts only the editable fields. Validates schema_json against the
ExtractionSchema Pydantic model so malformed schemas are rejected up
front. Status is read-only at this layer — transitions go through the
publish / archive (delete) endpoints.
1 - 200200^[-a-zA-Z0-9_]+$Org-scoped black-hole participation flag (Decision 2). Only the current PUBLISHED, non-deprecated version participates in classification — enforced by documents.services.black_hole.black_hole_participants(), not here. The flag may be set on a draft; it becomes effective on first publish.
Response
Full Struct projection for the detail / restore response.
Adds the working draft body (schema_json, annotations_json), the
nested current version summary, optional sample attachment, and a
description for editing.
200^[-a-zA-Z0-9_]+$200List shape for StructVersion rows (no schema body).
draft- Draftactive- Activearchived- Archived
draft, active, archived Mirror of schema_json['mode'] for filtering/display; schema_json is authoritative.
form- Formdocument- Document
form, document Org-scoped black-hole participation flag (Decision 2). Only the current PUBLISHED, non-deprecated version participates in classification — enforced by documents.services.black_hole.black_hole_participants(), not here. The flag may be set on a draft; it becomes effective on first publish.

