Add Document Generate
POST/documents/:documentId/generate
Generates a new document using a specified template file and data sources. This operation allows users to merge data from multiple documents into a template to create a new document in the desired output format (e.g., DOCX).
By Default data source must include a data object, which contains key-value pairs that will be merged into the template. The value can be any valid JSON object. { "data":{}}. The data path can be adjusted via the "dataRoot" field.
; available as an Add-On Module
Request
Path Parameters
Document Identifier
Query Parameters
Site Identifier
- application/json
Body
required
Array [
]
Array [
]
locale
object
Name of Locale
insertDocuments
object[]
List of documents to insert
Position of document
Possible values: [APPEND]
Document Identifier of the data source document
datasources
object[]
List of data sources
The data source name
Document Identifier of the data source document
The default JSON object path for the data object
dataDocument Generate Output Type
Possible values: [DOCX, PDF]
Save the generated document with a specific documentId
The path of the generated document
Responses
- 201
- 400
201 CREATED
Response Headers
Access-Control-Allow-Origin
string
Access-Control-Allow-Methods
string
Access-Control-Allow-Headers
string
- application/json
- Schema
- Example (from schema)
Schema
Generated document identifier
{
"documentId": "string"
}
400 OK
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
errors
object[]
List of errors
Error Key
Error Message
{
"errors": [
{
"key": "string",
"error": "string"
}
]
}