DOCX Generation Generate Template Bulk Preview API
Free tier included · BusinessDOCX Generation API lets you produce Word documents without installing libraries or managing servers. POST JSON to /generate for a simple document (title, sections, table), or upload a .docx template to /generate-from-template and fill it with JSON data. /bulk-generate turns a CSV or Excel file into a ZIP of personalized DOCX files using a template, /preview renders a template with sample data so you can check output before committing, /analyze-template scans a template for {{variable}} placeholders, and /track-changes lists tracked changes (revisions) of a DOCX.
The service is stateless and offline: it runs python-docx and docxtpl locally, stores nothing, and makes no external calls. Input is capped to keep requests bounded — titles and headings up to 200 chars, 50 sections, 200 table rows, 100 paragraphs per section, cells up to 1000 chars, and a 10MB payload limit. Concurrency is limited by a semaphore (default 8) and rate-limited per plan.
It covers JSON-in/DOCX-out, templates {{var}}, bulk generation from CSV/Excel, preview, and placeholder scanning. Ideal for report automation, invoice generation, no-code document pipelines, and ETL workflows that need a stable, hosted DOCX endpoint.
Honest limits: this is not a full document editor. Complex layouts, macros, or embedded objects may not round-trip perfectly. Templates must use Jinja-style {{var}} syntax. Bulk generation returns a ZIP, not individual files. Output fidelity depends on the template structure.
Endpoints
| Method | Path | What it does |
|---|---|---|
GET | / | API metadata: name, version, and paths to the interactive docs and health endpoint. |
GET | /health | Liveness probe; returns status "ok" while the process is up. |
POST | /generate | Generate a .docx from JSON: optional title, sections with headings and paragraphs, and a table. Returns the binary .docx as an attachment. |
POST | /generate-from-template | Fill a .docx template with JSON data. Accepts a template file and a JSON data string. |
POST | /analyze-template | Scan a .docx template for Jinja-style {{variable}} placeholders. |
POST | /preview | Render a template using default or provided sample JSON data and return the resulting DOCX. |
POST | /bulk-generate | Generate multiple DOCX files from a CSV or Excel file using a template. Returns a ZIP archive of all generated files. |
POST | /track-changes | List tracked changes (revisions) of a DOCX: insertions, deletions, moves, and formatting changes with author, date, text, and part. |
Quick start
curl -X POST "https://docxgen.p.rapidapi.com/generate" \
-H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
-H "X-RapidAPI-Host: docxgen.p.rapidapi.com" \
-H "Content-Type: application/json" \
-d '{"title":"Quarterly Report","sections":[{"heading":"Summary","paragraphs":["Revenue increased 12% year-over-year."]}],"table":{"headers":["Item","Amount"],"rows":[["Revenue","1.2M"],["Cost","800K"]]},"filename":"report.docx"}'
FAQ
What file formats are supported for templates and data?
Templates must be .docx files. Data can be sent as JSON strings. For bulk generation, data files can be CSV or Excel (.xls, .xlsx).
Are generated documents stored or logged?
No. The API is stateless and offline. Generated files are returned immediately and never stored on the server.
What are the input size limits?
Maximum payload size is 10MB. Titles and headings are capped at 200 characters, sections at 50, paragraphs per section at 100, table rows at 200, and table cells at 1000 characters.
Can I preview a template before generating the final document?
Yes. Use /preview to render a template with sample or provided JSON data and see the output before committing to full generation.
Try DOCX Generation Generate Template Bulk Preview free
Free tier on every plan. Get an API key and start calling in under a minute.
Open on RapidAPI