Batch PDF generation allows you to generate up to 20 PDFs in a single API call.
Each item in the batch can use a different template and data. You can also merge all generated PDFs into a single file.
Request
Response
By default, the request waits for all PDFs to be generated before returning a response (synchronous behavior). If the batch takes longer than 30 seconds, it will return a202 Accepted response with a status URL to poll.
status field indicates the overall outcome of the batch:
- SUCCESS - All PDFs were generated successfully
- PARTIAL_SUCCESS - Some PDFs were generated, but at least one failed
- FAILED - All PDFs failed to generate
Merged Response
Whenmerge is set to true, the response will also include a mergedUrl pointing to a single PDF containing all successfully generated PDFs combined:
Parameters
An array of PDF generation items. Minimum 1 item, maximum 20 items per batch.Each item accepts the following properties:
If true, the request will return immediately with a
batchRequestId and
statusUrl. You can poll the Get Batch PDF Status
endpoint to track progress.If true, all successfully generated PDFs will be merged into a single file.
The merged file URL will be available in the
mergedUrl field of the response.
Cannot be used when any item has convertToImage set to true.A URL to receive a POST request when the batch is complete. The webhook payload
will contain the full batch status and results.
Number of seconds that the generated signed URLs will take to expire (default:
1 hour)
Async Mode
Whenasync is set to true, the request returns immediately with a batchRequestId and a statusUrl:
Payload Size Limit
The request body is limited to 3MB. Since batch requests contain multiple items, this limit can be reached when sending many items with largedata objects.
If your request exceeds this limit, you’ll receive a 413 status code with the following error:
Checking Batch Status
You can check the status of your batch at any time using the Get Batch PDF Status endpoint with thebatchRequestId.
To check the status of an individual PDF within the batch, use the Get PDF Status endpoint with the individual requestId from the results.