Batches & Downloads
List generation batches, read one with its documents and per-document files, retry missing PDFs, and download a document as Word or PDF or a whole batch as ZIP.
A batch is the result of one POST /v1/doc-gen/jobs. It carries its status (running, completed or failed), the template ids and names, who created it, whether it is kept in the workspace, whether PDF conversion was available (pdfAvailable), and its documents. Each document has its own status (pending, ready or failed), the values with their origins, its audit events, its files (kind docx or pdf, name and size in bytes), an error and, when the Word file was made but the PDF was not, a pdfError.
The history route returns summaries, newest first: the same batch fields, with documents as a count of the documents the key's minting user may read, plus failed (documents with status failed) and pdf_missing (documents with a PDF error). limit runs from 1 to 50 and defaults to 50. A batch none of whose documents that person may read is reported as not found by the single-batch route, and the download routes apply the same check per document.
File retention follows save_to_workspace. A batch kept in the workspace keeps its files under the batch. A batch generated with save_to_workspace: false is download-only: filesExpireAt gives the deletion time (24 hours after generation), filesExpired turns true once the files are gone, each document's files is then empty, and the values and history stay. The download, ZIP and PDF retry routes answer 410 from that moment.
/v1/doc-gen/jobsQuery parameters
50/v1/doc-gen/jobs/{id}Response fields
Response: Completed batch (excerpt)
{
"id": "e61a0c97-2b4f-4d38-a5c1-7f90d3b8e426",
"templateIds": ["3b1f6a52-8c0e-4f0a-9d5e-2a7c1e4b9d10"],
"templateNames": ["contract-letter"],
"createdAt": "2026-10-21T09:31:07.000Z",
"by": "api:5d1c0e7a",
"status": "completed",
"error": null,
"savedToWorkspace": true,
"pdfAvailable": true,
"filesExpireAt": null,
"filesExpired": false,
"documents": [
{
"id": "0b9d2f64-71c3-4e58-8a16-c5e4d7a39f10",
"templateId": "3b1f6a52-8c0e-4f0a-9d5e-2a7c1e4b9d10",
"templateName": "contract-letter",
"recordId": "rec_0417",
"recordLabel": "C-2026-0417",
"status": "ready",
"files": [
{ "kind": "docx", "name": "contract-letter C-2026-0417.docx", "size": 41873 },
{ "kind": "pdf", "name": "contract-letter C-2026-0417.pdf", "size": 96412 }
],
"error": null,
"pdfError": null,
"values": {},
"events": []
}
],
"events": []
}/v1/doc-gen/jobs/{id}/pdf/v1/doc-gen/jobs/{id}/documents/{doc}/filePath and query parameters
docx/v1/doc-gen/jobs/{id}/zipcURL: Retry PDFs, then download the archive
curl -X POST "https://api.talonic.com/v1/doc-gen/jobs/$JOB_ID/pdf" \
-H "Authorization: Bearer $TALONIC_API_KEY"
curl -OJ "https://api.talonic.com/v1/doc-gen/jobs/$JOB_ID/zip" \
-H "Authorization: Bearer $TALONIC_API_KEY"pdfAvailable: false. A PDF that fails where conversion is configured is kept as pdfError on its document, and the batch's error says how many are missing. Make them again with POST /v1/doc-gen/jobs/{id}/pdf rather than generating the batch a second time.