Skip to main content
PATCH
Update a Struct's working draft
Writes the working draft only. Live batches keep the last published version until you publish again. Saving a draft is free.

Authorizations

Authorization
string
header
required

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.

Path Parameters

slug
string
required

Body

application/json

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.

name
string
Required string length: 1 - 200
slug
string
Maximum string length: 200
Pattern: ^[-a-zA-Z0-9_]+$
description
string
schema_json
any
annotations_json
any
sample_attachment_id
integer | null
write-only
black_hole_enabled
boolean

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.

id
integer
required
read-only
slug
string
required
Maximum string length: 200
Pattern: ^[-a-zA-Z0-9_]+$
name
string
required
Maximum string length: 200
field_count
integer
required
read-only
has_unpublished_changes
boolean
required
read-only
current_version_number
integer | null
required
read-only
version_count
integer
required
read-only
updated_at
string<date-time>
required
read-only
description
string
required
schema_json
any
required
annotations_json
any
required
sample_attachment
object | null
required
read-only
current_version
object | null
required

List shape for StructVersion rows (no schema body).

parsed_sections
object[]
required
read-only
created_at
string<date-time>
required
read-only
status
enum<string>
  • draft - Draft
  • active - Active
  • archived - Archived
Available options:
draft,
active,
archived
mode
enum<string>

Mirror of schema_json['mode'] for filtering/display; schema_json is authoritative.

  • form - Form
  • document - Document
Available options:
form,
document
black_hole_enabled
boolean

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.

latest_proposals_json
unknown