Document Generation API

Document generation API: from template and data to finished document

One template library for every document your business sends — invoices, reports, certificates, receipts — filled automatically from your app, your database or a spreadsheet.

  • 50 free renders/month
  • No credit card
  • EU region · DPA available

What is a document generation API?

A document generation API creates business documents automatically. You store an approved template once; your systems send the variable data as JSON; the API merges the two, lays out the pages and returns a finished, branded PDF or image. No one opens a file, replaces a name and exports it by hand.

An honest note before you read on. Many tools in this category merge Word (.docx) templates. This one does not: templates are HTML and CSS, and the output is PDF or image, never an editable Word file. That is a real difference in approach, and the comparison further down says plainly which one fits your process.

Document generation API key facts
EndpointPOST https://api.dynamicdocumentapi.com/v1/renders, or the direct routes /v1/pdf/from-template, /from-html, /from-url, /from-markdown
Template languageHTML and CSS with Jinja syntax — loops, conditions, filters — plus Markdown for text-heavy documents
OutputPDF, PNG or JPG from the same template
Not supportedDOCX, XLSX or PPTX templates and output; editable Word files
VersionsEvery template change is kept, renders can be pinned to a version, rollback at any time
VolumeOne-off renders, batches from a JSON list or CSV, async with signed webhooks (paid plans)
Data handlingEU region, data processing agreement, per-request retention_days, signed links that expire
Render timeMedian 216 ms, p95 516 ms1
PriceFree: 50 renders/month. Paid from €15/month (billed annually) for 3,000 renders, auto top-ups from €6 per 1,000

1. Measured over 1,664 successful renders on engine 2026.4, Chromium 153. total_ms = time in the queue plus processing in the worker, excluding API overhead and network transfer.

How automated document generation works

Four moving parts, and only the first one is a design decision. The rest is plumbing you set up once.

  1. The template library

    Each document type gets one approved template with your logo, fonts and legal footer. Marketing and legal sign it off once, not once per document.

  2. The data

    Your product, your database, a CRM export or a spreadsheet supplies the variable fields as JSON — in whatever shape your system already uses.

  3. The render

    One HTTP call merges data and template in Chromium and returns the document, typically in a few hundred milliseconds.

  4. The delivery

    Attach the bytes to an email, hand out a signed link, put the file in your portal or write it to your own storage bucket.

Three things make this survive contact with production: an Idempotency-Key so a retried call never produces a duplicate document, signed webhooks for long-running batches, and test keys that render watermarked output without spending quota. The technical details live on the PDF generation API page.

One template library for every document type

The mechanism is the same for every document; only the template and the data change. These four have pages of their own, with code and layout details.

Invoices and credit notes

Line items that break cleanly across pages, any currency, payment QR codes and totals that always match your ledger. See invoice automation.

Reports and statements

Charts, long tables with repeating headers, bookmarks and “Page 3 of 12”. See automated reports.

Certificates and cards

A print-ready PDF and a shareable image per participant, with a QR code pointing at your verification page. See certificate generation.

Receipts and confirmations

A4, Letter or 58/80 mm thermal width, generated the moment a payment settles. See receipt generation.

Quotes, contracts and order forms

Text-heavy documents with numbered clauses, signature blocks and conditional sections. Markdown works well here, through the Markdown to PDF API.

Labels, badges and social graphics

Custom paper sizes for shipping labels and event badges, or the image generation API for PNG and JPG from the same template.

Where the data comes from

The API does not care which system holds your records; it only needs JSON over HTTPS.

  • Your own application. The most common case: the code that already knows an order was placed calls the endpoint and attaches the result to the confirmation email.
  • Your database or warehouse. A scheduled job selects the rows for the period and sends one batch — month-end statements, payout reports, renewal notices.
  • A spreadsheet or CSV export. A batch takes a CSV directly: one row per document. This is how most teams do their first bulk run, straight out of the CRM export.
  • An automation platform. Any tool that can make an HTTP request can trigger a render. There is no prebuilt app for a specific platform yet, so the call is configured once as a generic HTTP step.

Keeping hundreds of documents on brand

The moment more than one person can create documents, consistency becomes the real problem — not rendering.

Shared header, footer and styles

Brand colors, fonts and the legal footer live in one shared stylesheet and shared partials. A rebrand means editing them once, not opening forty documents.

Versions with rollback

Every template change keeps its history. Pin a render to a specific version, compare what changed and roll back if a layout turns out wrong in production.

Test keys before production

A test key renders watermarked output, costs no credits and expires after a day — enough to try a layout change against real data without touching your quota.

One template, many locales

Dates, numbers and currencies follow Unicode CLDR for the locale you pass, and the text blocks come from your data — so one template can serve every market you sell in.

HTML templates vs. Word (DOCX) templates

This is the fork in the road for anyone choosing a document generation tool, and it is rarely spelled out. Both approaches are legitimate; they suit different teams.

Word template merging compared with HTML template rendering
Aspect Word (DOCX) merge tools HTML templates, this API
Who edits the templateAnyone who can use WordAnyone comfortable with HTML and CSS, or a developer
Control over the printed pageWord's layout engine decidesExact: page size, margins, page breaks, running headers
Charts and dynamic graphicsUsually a pre-rendered imageAny JavaScript chart library, drawn at render time
Web fonts and brand assetsFonts must be installed or embeddedYour fonts and assets load with the template
Editable outputYes — a .docx the recipient can changeNo — PDF or image only
Review workflowTrack changes and comments in WordVersion history with rollback, diffs like code
Best whenLegal or sales staff own the wording and need editable filesA product generates documents automatically and the layout must be exact every time

The short rule: if a human opens the finished document and keeps writing in it, choose a Word-based tool. If a system produces the document and a person only reads, prints or files it, HTML templates give you more control and fewer surprises.

Documents contain personal data

Invoices carry addresses, certificates carry names, statements carry balances. What that means in practice:

  • Roles. You remain the controller, we act as processor under a data processing agreement.
  • Region. Rendering and storage run in the EU region.
  • Retention you set. retention_days decides per request how long a file is kept, up to your plan's maximum — or take the bytes with "delivery": "binary" and have us store nothing.
  • Links that expire. Download URLs are signed and time-limited: one hour by default, up to seven days.
  • Minimal payloads. Send only the fields a document needs. A render does not require a customer record, just the values that appear on the page.
  • Isolation. Every render runs in its own sandbox, and requests to private or internal network addresses are blocked. More in security.

What document generation costs

Free

€0

50 documents per month, full REST API. No credit card.

Starter

€15 / month

3,000 renders per month, billed annually (€19 billed monthly). About €0.005 per document.

A render is one returned file of up to 50 pages. Growth (€47/month, 15,000 renders), Pro (€119/month, 50,000) and Scale (€319/month, 200,000) are billed annually; paid plans top up automatically when they run low. See the full pricing, the enterprise plan, or talk to sales about higher volumes.

FAQ

Document generation API: frequently asked questions

What is the difference between document generation and PDF generation?

PDF generation describes the technical step: HTML, a URL or Markdown goes in, a PDF comes out. Document generation describes the business process around it: a library of approved templates, data from your systems, a document produced for a person, and delivery. The same API covers both; only the framing differs.

Can I use Word (DOCX) templates?

No. Templates are HTML and CSS with Jinja syntax, or Markdown. We do not merge .docx files and we do not return editable Word documents. If your process depends on Word files that colleagues edit, a DOCX mail-merge tool is the better fit. If you want pixel-exact control over the printed result, HTML templates are stronger.

Which document types can I automate?

Anything with a fixed layout and variable data: invoices, receipts, quotes, order confirmations, delivery notes, contracts, reports, statements, certificates, labels and membership cards. The same template can also render as a PNG or JPG for emails and social posts.

Can I generate documents without writing code?

Templates are edited in the browser, and any tool that can send an HTTP request can trigger a render — an automation platform, a scheduler, a spreadsheet script or a low-code backend. There is no prebuilt app for a specific platform yet, so the call itself has to be configured once.

Is document generation GDPR-compliant?

You stay the controller and we act as processor under a data processing agreement. Rendering runs in the EU region, you decide per request how long a file is stored with retention_days, links are signed and expire, and you can delete files at any time. Send only the fields a document needs.

How do teams manage many templates?

Templates are versioned: every change keeps its history, you can pin a render to a version and roll back if a layout turns out wrong. Shared header and footer partials keep branding consistent, and test keys let you try changes against watermarked output without touching production volume.

Automate your first document free

50 renders a month on the free plan, no credit card, auto top-ups on paid plans.

Start free