DynamicDocumentAPI

Overview

How the API turns templates, HTML, URLs and Markdown into PDFs and images, with the core concepts and conventions to know first.

View as Markdown

Dynamic Document API is a REST API for generating PDFs and images. You send JSON data together with a stored template, raw HTML, a web page URL or Markdown, and the API returns the finished file, either directly in the response or through a signed webhook when the render is complete.

Typical documents are invoices, quotes, receipts, statements, certificates, tickets, shipping labels and reports. You can also convert existing web pages to PDF or take screenshots of them.

How it works

  1. Build a template. Write HTML and CSS with Jinja placeholders in the dashboard code editor at https://app.dynamicdocumentapi.com, or start from a template in the gallery.
  2. Publish a version. Publishing validates the template and creates an immutable version.
  3. Create a render. Call POST /v1/renders with the template ID and your data.
  4. Receive the file. Get a signed download URL, the raw file or base64 content. Long renders can run asynchronously and notify your server with a webhook.
curl https://api-eu.dynamicdocumentapi.com/v1/renders \
  -H "Authorization: Bearer $DYNAMIC_DOCUMENT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": { "type": "template", "template_id": "tpl_01J9ZK3M7Q8V5W2X4Y6Z8A0B1C" },
    "data": { "number": "2026-0042", "customer": { "name": "Example GmbH" } },
    "output": { "format": "pdf" }
  }'

Core concepts

Templates and versions

A template stores a document's HTML, the contents of <head> (usually CSS), header and footer, sample data and default output options. Templates use a Jinja-compatible template language with extra filters for currencies, dates, QR codes and barcodes.

Every template has one editable draft and a series of immutable published versions (1, 2, 3, …). Publishing checks the syntax, validates the sample data and runs a test render before it moves the live pointer to the new version. Renders use the live version unless you pin a version number, and a rollback moves the pointer back to an earlier version. Test keys can also render the draft.

Each template is pinned to an engine channel such as 2026.4, which fixes the Chromium version and the bundled fonts. The same template version, data and engine channel produce visually identical output.

PDF templates are HTML, CSS and Jinja, edited visually or as code, or Markdown; image templates are designed in the canvas editor.

Renders

A render is one generation job. POST /v1/renders accepts four input types (template, html, url and markdown) and produces PDF, PNG, JPEG, WebP or HTML output. PDFs can be accessible as PDF/UA, archived as PDF/A or carry an embedded e-invoice (Factur-X, ZUGFeRD, XRechnung). Batches render many documents in one request, and PDF tools merge, split, protect and convert existing PDFs.

Each render has an ID (rnd_…), a status and a list of output files. Renders are synchronous by default: the response contains the result. With mode: "async" the API responds immediately and you poll the render or wait for a webhook. See Renders.

Usage

Usage is measured in renders. A PDF of up to 50 pages is 1 render, with 1 more for each additional 50 pages, and an image is 1 render. Test renders and failed renders are free. Plans include a monthly number of renders, and paid plans top up automatically with 1,000 renders when they run low, up to a monthly top-up limit that you control. See Plans and limits.

Test and live keys

A workspace can have several API keys, each in test or live mode. Test keys (dda_test_…) render for free with a "TEST" watermark, keep files for 24 hours and still deliver webhooks. Live keys (dda_live_…) produce clean output and count as billed renders. See Authentication and test mode.

Data residency

Render payloads and generated files are processed and stored in the EU (https://api-eu.dynamicdocumentapi.com).

Files and retention

Generated files are private. Download URLs are signed and expire after one hour by default, and files are deleted when your workspace's retention period ends. For sensitive documents, zero-retention delivery returns the file in the response without keeping a copy.

API conventions

TopicConvention
Base URLhttps://api-eu.dynamicdocumentapi.com/v1 (https://api.dynamicdocumentapi.com/v1 is an alias)
AuthenticationAuthorization: Bearer dda_live_…
Request bodiesJSON with Content-Type: application/json
Errorsapplication/problem+json (RFC 9457) with a stable code field
IDsPrefixed opaque strings such as rnd_…, tpl_… and file_…
TimestampsRFC 3339 in UTC, for example 2026-09-17T15:06:33Z
Booleans and enumsJSON booleans and lowercase strings
LengthsCSS length strings with a unit, such as "20mm" or "1in"
PaginationCursor-based, with limit and cursor query parameters
IdempotencyIdempotency-Key header on POST requests; responses are replayed for 24 hours
Request IDsX-Request-Id response header, also included in error bodies
VersioningThe major version is part of the path. Additive changes don't change it, and deprecations are announced at least 12 months ahead with Deprecation and Sunset headers

Next steps

On this page