Generate a CWR export job for a publisher
POST /cwr/export
Description
POST /cwr/export Description: Loads the publisher (withPublisherTerritory rows), the tenant’s
CWRWork rows (optionally filtered to workIds) with their writer
links, and generates a CWR file at the requested version. Works
with no writer links, NULL relative shares, or bootstrap-seeded
skeletons are excluded from the file and reported back in
excludedWorks — never silently dropped.
On success the rendered CWR text is persisted through the File +
Cloud Storage pipeline and a CWRExportJob row is created with
status: completed and resultFileId set. Poll
GET /cwr/status/{publisherId} for the job list and download the
bytes via GET /cwr/jobs/{jobId}/download.
The legacy synchronous streaming path (?stream=true) has been
removed; it never produced valid work registrations or trailer
counts. A request with ?stream=true returns 400.
Authorization:
- Required role:
adminor higher
Code Examples
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Body
Publisher owning the works to export. Must belong to the caller's tenant.
CWR file-format version to render. Only the 2.x family is emittable — CWR 3.0/3.1 are a different specification (different transaction structure and record layouts) and are rejected with 400.
2.1, 2.2 Optional subset of work ids to export. Omit to export all exportable works for the publisher's tenant.
Reserved for future export options. Currently unused by the export path.
Response
Export job created and completed synchronously (the async job flow renders and persists the file before responding)
CWRExportJob row. Filters, configId, and templateId are provisioned automatically on first use for a tenant.
Works excluded from the export (no writer links, NULL relative shares, bootstrap-seeded skeletons). Never silently dropped — always reported.