/ Search

Search Epistola

Find documentation, integration guides, tour steps, blog posts and pages.

DocsIntegrationsTourBlogPage
↑↓↵esc

Generation API Reference

Technical notes: how to let an external system generate documents with Epistola.

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: namespace and catalogKey, and optionally registry.
  • The template: templateKey.
  • Optionally the variant: variantKey, or attributes that Epistola uses to select a variant. Send one or the other, not both.
  • Optionally which release: versionRange, environmentKey, or both.
  • The data object that fills the document fields.
  • Optionally a filename and a correlationId for 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 →