Skip to content
HALOWERK

Formatwerk

mail merge

DOCX: finds {{placeholders}} even when Word split them across runs, plus simple and complex MERGEFIELDs, keeps the run formatting, turns line breaks into Word breaks and builds one document with a new section per record (page numbers restart) or a ZIP with one DOCX per record (headers/footers per record). Bookmark and drawing ids stay unique. PDF: a DIN 5008 letter template (fields of din5008-letter) is filled per record, empty address lines are dropped. No DOCX to PDF conversion (needs an.

POST https://format.halowerk.com/v1/mail-merge

Inputs

Fields of the published input schema
FieldTypeRequiredDescription
template_docx_base64stringNo
letter_templateobjectNoDIN 5008 letter with the fields of din5008-letter (recipient, body, subject, ...); strings may contain {{column}}.
csvstringNo
rowsarrayNo
delimiterstringNo
outputstringNodocx/zip need template_docx_base64, pdf needs letter_template.
file_namestringNoZIP entry name template; {{_nr}} = record number.
Show full input schema
{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "template_docx_base64": {
      "type": "string",
      "maxLength": 14000000
    },
    "letter_template": {
      "type": "object",
      "description": "DIN 5008 letter with the fields of din5008-letter (recipient, body, subject, ...); strings may contain {{column}}."
    },
    "csv": {
      "type": "string",
      "maxLength": 2000000
    },
    "rows": {
      "type": "array",
      "minItems": 1,
      "maxItems": 500,
      "items": {
        "type": "object",
        "additionalProperties": {
          "type": [
            "string",
            "number",
            "null"
          ]
        }
      }
    },
    "delimiter": {
      "type": "string",
      "enum": [
        "auto",
        ",",
        ";",
        "\t"
      ],
      "default": "auto"
    },
    "output": {
      "type": "string",
      "enum": [
        "docx",
        "zip",
        "pdf"
      ],
      "description": "docx/zip need template_docx_base64, pdf needs letter_template."
    },
    "file_name": {
      "type": "string",
      "maxLength": 120,
      "default": "letter-{{_nr}}",
      "description": "ZIP entry name template; {{_nr}} = record number."
    }
  }
}

Open original schema

Published input example

{
  "letter_template": {
    "sender": {
      "name": "Lagertechnik Nord GmbH",
      "street": "Hallenweg 3",
      "postal_code": "48599",
      "city": "Gronau"
    },
    "recipient": [
      "{{name}}",
      "{{street}}",
      "{{zip}} {{city}}"
    ],
    "subject": "Invoice {{no}}",
    "body": [
      "Dear {{name}}, please find invoice {{no}} attached."
    ]
  },
  "csv": "name;street;zip;city;no\nMietpartei Nord;Hauptstr. 5;10115;Berlin;R-1",
  "output": "pdf"
}

Result & documentation

Machine-readable documentation of this hub

Source of this page: the published HALOWERK catalog. Updated: 2026-11-17 UTC.

More endpoints in this hub

All endpoints in this hub โ†’