Cwr Export
Generate a CWR export job for a publisher
POST /cwr/export
POST
This endpoint requires authentication. Include your Bearer token in the Authorization header.
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
application/json
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.