Skip to main content
POST
Reassign a single BatchDocument's StructVersion
Pins a different published version onto one BatchDocument. Does not extract by itself — follow with Reprocess if you want a fresh run.

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

batch_id
integer
required
doc_id
integer
required

Body

application/json

Body for batch version reassignment endpoints (Task 16).

Accepts a single version_number field; the consuming view resolves it against the parent batch's struct and rejects deprecated versions.

version_number
integer
required
Required range: x >= 1

Response

Response shape for POST /api/v2/batches/{id}/documents/{doc_id}/version/.

Extends the summary with id (so the grid can repoint row.struct_version_id), pinned_field_ids (the sorted list of field IDs in the new version's schema_json — needed by the JS grid so the per-row out-of-schema mask refreshes after reassignment without a full page reload), the per-row output-language hints (output_language / output_language_label / output_language_is_rtl), and source_languages / source_language_labels from the new version's pinned schema.

The output-language hints are read by batch_grid.js::reassignDocVersion to refresh row.output_language* after a reassignment — without them, a doc reassigned from a French-only version to an Arabic version would still render its cells LTR (the per-row RTL flag would stay stale until a full page reload), and the inline editor + sub-table modal would inherit the wrong language label too.

AD-205 clean cut: this serializer no longer reads or emits translation_language. Stored schema_json blobs were rewritten by backfill_schema_keys before deploy, so every read site can safely assume output_language is the only key.

id
integer
required
read-only
version_number
integer
required
Required range: 0 <= x <= 2147483647
published_at
string<date-time>
required
read-only
published_by
object | null
required

Compact projection of the user who published / deprecated a version.

field_count
integer
required
read-only
is_deprecated
boolean
required
read-only
deprecated_by
object | null
required

Compact projection of the user who published / deprecated a version.

pinned_field_ids
string[]
required
read-only
output_language
string | null
required
read-only
output_language_label
string
required
read-only
output_language_is_rtl
boolean
required
read-only
source_languages
string[]
required
read-only
source_language_labels
string[]
required
read-only
publish_note
string
Maximum string length: 500
deprecated_at
string<date-time> | null
deprecation_note
string
Maximum string length: 500