Skip to main content
Batch HTML to PDF allows you to convert up to 20 HTML documents into PDFs in a single API call. You can also merge all generated PDFs into a single file.
POST https://api.pdfnoodle.com/v1/html-to-pdf/batch

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 a 202 Accepted response with a status URL to poll.
The 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

When merge is set to true, the response will also include a mergedUrl pointing to a single PDF containing all successfully generated PDFs combined:

Parameters

array
required
An array of HTML to PDF conversion items. Minimum 1 item, maximum 20 items per batch.Each item accepts the following properties:
boolean
default:"false"
If true, the request will return immediately with a batchRequestId and statusUrl. You can poll the Get Batch PDF Status endpoint to track progress.
boolean
default:"false"
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.
string
A URL to receive a POST request when the batch is complete. The webhook payload will contain the full batch status and results.
number
default:"3600"
Number of seconds that the generated signed URLs will take to expire (default: 1 hour)

Async Mode

When async is set to true, the request returns immediately with a batchRequestId and a statusUrl:
You can then check the status of your batch using the Get Batch PDF Status endpoint.

Payload Size Limit

The request body is limited to 3MB. Since batch requests contain multiple items with raw HTML content, this limit can be reached quickly when sending many items with large HTML documents. If your request exceeds this limit, you’ll receive a 413 status code with the following error:
If you’re hitting the 3MB payload limit, consider splitting your batch into multiple smaller requests. For example, instead of sending 20 items in a single request, send two requests with 10 items each.

Checking Batch Status

You can check the status of your batch at any time using the Get Batch PDF Status endpoint with the batchRequestId. To check the status of an individual PDF within the batch, use the Get PDF Status endpoint with the individual requestId from the results.