Render documents from templates
DocUnum is a document merge service. Feed it a template and a JSON payload, get back a finished document — no runtime dependencies, no magic.
What it does
Field substitution
Replace [* field.path *] tags with values from a JSON payload, including nested objects and array indexing.
Expressions
Evaluate inline arithmetic and logic with [= qty * price =]. Built-in helpers: sum, avg, min, max, and more. Reference →
Loops & conditionals
Repeat blocks with for, branch with if / else, and scope with with — all inside any supported format.
Template inspection
Use /peek to list every tag in a template before merging, and /validate to check data completeness.
Schema inference
Automatically derive a JSON Schema from any template so callers know exactly what data shape is expected.
Delimiter conversion
Migrate templates between delimiter schemes — e.g. [* *] to {{ }} — in a single API call.
API endpoints
Quick start
# Merge a plain-text template curl -X POST http://localhost:8080/v1/merge \ -H "Content-Type: application/json" \ -d '{ "name": "hello.txt", "format": "txt", "content": "'$(echo -n "Hello [* name *]!" | base64)'", "data": { "name": "World" } }'