Skip to main content

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

    documentId stringrequired

    Document Identifier

Query Parameters

    siteId string

    Site Identifier

Body

required

    locale

    object

    locale string

    Name of Locale

    insertDocuments

    object[]

    List of documents to insert

  • Array [

  • position DocumentGenerateInsertDocumentPosition (string)required

    Position of document

    Possible values: [APPEND]

    documentId stringrequired

    Document Identifier of the data source document

  • ]

  • datasources

    object[]

    List of data sources

  • Array [

  • name string

    The data source name

    documentId stringrequired

    Document Identifier of the data source document

    dataRoot string

    The default JSON object path for the data object

    Default value: data
  • ]

  • outputType DocumentGenerateOutputType (string)

    Document Generate Output Type

    Possible values: [DOCX, PDF]

    saveAsDocumentId string

    Save the generated document with a specific documentId

    path string

    The path of the generated document

Responses

201 CREATED

Response Headers

  • Access-Control-Allow-Origin

    string

  • Access-Control-Allow-Methods

    string

  • Access-Control-Allow-Headers

    string

Schema

    documentId string

    Generated document identifier

Loading...