Add library documents to a batch
Add existing library documents to a batch.
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.
Path Parameters
Body
Body for POST /api/v2/batches/{batch_id}/documents/.
Adds existing library documents (referenced by ChatAttachment.pk) to
a batch. The batch's parent struct is implicit via
Batch.default_struct_version — every per-doc version override must
refer to the same struct.
Fields:
document_ids: ChatAttachment PKs of docs in the user's library to
attach to the batch. At least one is required. Order is
preserved when assigning BatchDocument.processing_order.
version_number: Optional override for the batch's
default_struct_version for all added docs in this request.
None means "use the batch's current default version".
per_doc_versions: Optional fine-grained per-doc override map
{document_id: version_number}. Keys must be a subset of
document_ids. A doc id present in this map takes precedence
over the request-level version_number.
ChatAttachment PKs of library docs to add to the batch.
1024x >= 1Override version number applied to every added doc unless a per-doc override is set. Defaults to the batch's default_struct_version.
x >= 1Map of {document_id: version_number} overriding the request-level version_number for individual docs.

