Generation API Reference
Technical notes: how to let an external system generate documents with Epistola.
User guide navigation
On this page
Generation API reference
Use this page when you build a connection between systems. To learn how to set it up first, start with Connected Systems and Generate Documents. This page follows Epistola Suite 2.0, which implements API contract 2.0.0.
Request shape
To generate one document, send POST /tenants/{tenantKey}/documents/generate. For many documents, send POST /tenants/{tenantKey}/documents/generate/batch with up to 10,000 items. A request names:
- The catalog:
namespaceandcatalogKey, and optionallyregistry. - The template:
templateKey. - Optionally the variant:
variantKey, orattributesthat Epistola uses to select a variant. Send one or the other, not both. - Optionally which release:
versionRange,environmentKey, or both. - The
dataobject that fills the document fields. - Optionally a
filenameand acorrelationIdfor your own records.
Take the exact JSON contract from the API contract for the Suite version you run. Do not copy example payloads from project notes into production code.
Which release renders
Epistola picks the release when it accepts the request. Publishing a new release while the request waits does not change what it renders.
| The request names | Epistola renders |
|---|---|
| nothing | the highest release (the highest version number) of the catalog |
versionRange |
the highest release that matches, such as 1.4.0, ^1.4.0, or >=1.0.0 <2.0.0 |
environmentKey |
the draft deployed to that environment if there is one, else the highest release it serves |
environmentKey and a range |
the highest release the environment serves that matches; a draft never matches a range |
Environments are optional. A document rendered from a draft carries a preview watermark, and an environment marked as production serves no drafts. The document always reports the releaseId it was rendered from, and its version. For a draft, version is null. How releases and environments fit together is explained in From template to document.
Epistola is open source, not free of cost. The organisations that use it fund its development, through Epistola or an Official Partner. We are steward-owned: fair prices, no profit maximisation. How Epistola is funded →