How to generate documents with dynamic templates through the API

Introduction

In this guide, you will learn how to generate documents with dynamic templates through the Omnidocs Create API.

Dynamic templates use a structured JSON payload to define the data that should be inserted into the document. Each field in the payload must match the expected node type in the template, such as text, number, date, group, element, select, repeat, or table.

Prerequisites

Before you begin, make sure you have:

  • Access to the Omnidocs Create API
  • A valid API token
  • A unitId
  • A templateId
  • Knowledge of the dynamic template schema used by the template

Endpoint

Use the generate endpoint to generate a document from a template:

POST /api/v1/units/{unitId}/recipes/{templateId}/generate

The request body contains the data required by the dynamic template.

Basic request example:

{
  "senderName": "Jane Doe",
  "recipientName": "John Doe",
  "amount": 1234.56,
  "date": "2025-10-10T00:00:00"
}