{{placeholder}} tags and replace them with dynamic values — text, images, lists, or even full table rows.
How it works
- Upload your template file (DOCX or ODT) via the file upload endpoint
- Upload any image files you want to use in placeholders
- Create a job via
POST /tools/docx/replace-placeholderswith the file ID and avariablesobject - Poll the job via
GET /tools/jobs/{jobId}until status isCOMPLETED - Download the result via
GET /tools/files/{fileId}/download
Request body
Top-level properties
Variable types
Text variable
A simple string value. In your template, use{{name}} and the text will be replaced directly.
Image variable
Replaces a{{placeholder}} tag with an image. The image must first be uploaded via the file upload endpoint — pass the file ID as src.
Upload the image via
POST /tools/files/upload (the tools file upload), then use the returned id as the src value. Do not use the temporary image upload endpoint (POST /images/upload) — that is only for render jobs (JSON/Markdown rendering). The two upload endpoints use separate storage systems.List variable
Replaces a{{placeholder}} tag with a formatted list — either bulleted or numbered.
Lists are rendered as formatted text in the document. Each item appears on a new line with the appropriate prefix.
Table variable
Expands a single template row into multiple rows with dynamic data. This is the most powerful variable type — it duplicates a table row in your DOCX/ODT template for each entry in therows array.
How to set up the template
In your DOCX or ODT file, create a real table with a header row and one data row. In each cell of the data row, use dot-notation placeholders:
The property names after the dot (
plan, price, credits) must match the keys in each row object exactly.
Output format
By default, the output format matches the input (DOCX in → DOCX out, ODT in → ODT out). UseoutputFormat to convert:
Complete example
1. Upload the template
2. Upload an image (optional)
3. Create the replacement job
4. Poll for completion
5. Download the result
Supported file types
For best results, use DOCX templates.
