Skip to main content

Generate Documents Multiple

GenerateGenerate Documents Multiple

The Generate Documents Multiple API generates multiple documents from one template and multiple data items. You send the template (templateFileType, templateFileName, templateFileData Base64), documentDataType (Json or XML), outputType (Docx, PDF, Word, Excel, HTML), documentDataText or documentDataFile, optional fileMetaData and metaDataJson, and async. The API returns JSON with an outputDocuments array (or a polling URL when async). Use the tester below to try it; more details are in the sections that follow.

Try the Generate Documents Multiple API

:::note Quick reference Endpoint: POST /api/v2/GenerateDocumentMultiple · Required: api-key, templateFileType, templateFileName, templateFileData, documentDataType, outputType, documentDataText :::

:::info Try it live Use the form below to send your API key, template file (Base64), data type, output type, and data (JSON/XML text or file). The response is JSON with generated documents. No code required—fill the fields and click Send request. :::

Loading API Tester...

Overview, parameters, and use cases

What is Generate Documents Multiple?

This endpoint generates multiple documents from one template and multiple data records (JSON or XML). You provide the template (Word, HTML, or PDF as Base64), documentDataType (Json or XML), outputType (Docx, PDF, Word, Excel, HTML), and data via documentDataText or documentDataFile. The API produces one document per data record and returns them in the outputDocuments array (or a polling URL when async).

Key features

  • One template, many documents – Same template merged with each data record.
  • Template types – Docx, Word, HTML, or PDF (Base64).
  • DatadocumentDataType: Json or XML; data in documentDataText or documentDataFile.
  • OutputoutputType: Docx, PDF, Word, Excel, or HTML.
  • Async – Use async for large batches.

:::tip Best for Use when you need many documents from one template (batch letters, certificates, labels). For a single document per call use Generate Document Single. :::

Prerequisites

Before using this endpoint, make sure you have:

  • A valid PDF4me API key (Get your API Key)
  • A template file (Word, HTML, or PDF) in Base64 format
  • Data in JSON or XML format

Response Format

The API returns JSON with outputDocuments array containing the generated documents for synchronous processing (200 OK) or provides a polling URL for asynchronous processing (202 Accepted).

Get Help