Early access. Oomplo is looking for its first pilot companies. Tell us about your documents →

API reference

Every call an API key may make, generated from the OpenAPI definition. For a walk-through with examples, read the API guide.

Version 0.1.0. Set OOMPLO_URL to your server (e.g. https://oomplo.your-company.example) and OOMPLO_KEY to an API key to run the examples.

Oomplo runs on your own server (Docker). Every address below is relative to it, e.g. https://oomplo.your-company.example.

Requests and answers are JSON unless a file is returned. Errors are {"error": "…"} with a status code: 400 wrong request, 401 missing or wrong key, 403 outside the key's scope, 404 unknown, 409 conflict, 422 the document cannot be made, 429 too many requests at a time (retry after Retry-After seconds), 503 the server is busy.

Authenticate with an API key: Authorization: Bearer oomplo_…. An administrator creates keys in the page: account menu → API keys.

Documents #

A PDF or a filled Word document from a published template, the data a template needs and a check of your data before you generate.

POST /api/templates/{id}/render #

PDF of a template of the library by its id

The PDF of the template's published version (or of version) with the data given; the pipeline, the limits and the answers are those of POST /api/render with the version's document, so the PDF has the same bytes. POST /api/render with a DOCX file stays the way to render without keeping the template on the server.

Parameters

NameInTypeDescription
id requiredpathstring

The template of the library

Request body required

application/json
object
dataobject

Data replacing the template's own (as in POST /api/render)

versioninteger

A kept version instead of the published one

min 1
draftboolean

The working copy instead of a version (X-Oomplo-Template-Version 0); a test key or a signed-in user, not a production key (403)

strictboolean

Refuse a template whose PDF would be simplified

missingstring

Error (422 naming every missing value) or empty (an empty text)

one of "error", "empty" · default "error"
formatstring

Docx returns the filled Word document instead of the PDF

one of "pdf", "docx" · default "pdf"
fieldsstring

With docx: keep leaves the data fields as Word content controls showing their values (the file stays a template)

one of "text", "keep" · default "text"
responsestring

Json answers { file (base64), contentType, fileName, pages, warnings } instead of the file

one of "file", "json" · default "file"
sealboolean

The company seal over the PDF (OOMPLO_SEAL_KEY and OOMPLO_SEAL_CERT; 422 when the server has only the test seal)

pdfastring

Archival PDF/A, as in POST /api/render

one of "2b", "2u", "2a", "3b", "3u", "3a"
pdfuaboolean

Accessible PDF/UA-1, as in POST /api/render

attachDataboolean

The data attached as data.json (PDF/A-3 or no PDF/A), as in POST /api/render

dataXmlstring (byte)

The data as an XML file in base64 (a KSeF invoice gets $ksef), as in POST /api/render

Responses

200The PDF
application/pdf
string (binary)
Headers
X-Oomplo-Template-Version

The version rendered

X-Oomplo-Signature-Fields

Percent-encoded JSON array, one item per signature field of the PDF, for a signing service: name (the PDF field, Podpis-<GUID>), label, page (from 1), rect (points from the page's bottom-left corner: left, bottom, right, top, as the field's /Rect), pageSize (points), and who signs there after the data is filled in: role, signer, email (null when the workflow cannot be resolved).

X-Oomplo-Warnings
X-Oomplo-Warnings-List

Percent-encoded JSON array

X-Oomplo-Fonts-Substituted

Percent-encoded JSON array

400Invalid request or data
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

404No such template or version
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

409The template has no published version
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

422The template cannot be filled or laid out, or strict refused it (with warnings)
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

503The render queue is full or the library is not configured
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

POST /api/templates/{id}/validate #

What is wrong with data for a template, all at once, without a PDF

Fills the published version (or version) with data without a layout and lists every value the template reads that the data does not have (each path once, with the first item of an array without it and the count), every value of the wrong kind for its field (a date, a number, an e-mail address, a picture) with its path and the index of its item, and the error filling stops at otherwise.

Parameters

NameInTypeDescription
id requiredpathstring

The template of the library

Request body required

application/json
object
dataobject

Data as for render (a plain object is json.dane1)

versioninteger
min 1

Responses

200The report
application/json
object
validbooleanrequired
missingarray of objectrequired
Fields
pathstringrequired
rowinteger

First item (from 1) of an array without the value

countintegerrequired
problemsarray of objectrequired
Fields
pathstringrequired

With the index of its item, e.g. json.dane1.items[2].price

messagestringrequired
errorstring | null
versionintegerrequired
400Invalid request or data
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

404No such template or version
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

409The template has no published version
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

GET /api/templates/{id}/schema #

What data a template needs

The fields of the template's published version (or of version): data fields and {{path}} markers with their full path, kind and number of uses; the arrays of repeated rows and paragraphs with the fields of an item; who signs; and an example data file (a source registry) that fills every field, so POST /api/templates/{id}/render with data set to it gives a PDF. The same list as oomplo schema and the editor's Editor.schema().

Parameters

NameInTypeDescription
id requiredpathstring

The template of the library

versionqueryinteger

A kept version instead of the published one

min 1

Responses

200The schema
application/json
object
versionintegerrequired
fieldsarray of SchemaFieldrequired
Fields
pathstringrequired

Full address of the value, e.g. json.dane1.klient.nazwa

kindstringrequired

barcode: the value of a QR code or barcode (Word field DISPLAYBARCODE), the example has 12 digits, which QR, CODE128 and EAN13 all take; checkbox: a Word check box (true or false); email: the address of a signer; date and number: a field (or marker) with a date or number format (Word switch \@ or \#), the example has 2026-01-31 or 1234.5; image: a picture of the data, a PNG or JPEG as a data: address (data:image/png;base64,…) or plain base64, the example is a grey PNG of one pixel

one of "text", "checkbox", "email", "date", "number", "image", "barcode"
usesintegerrequired

How many places of the template read it

requiredbooleanrequired

False when every use has a text without data (default)

arraysarray of objectrequired
Fields
pathstringrequired

The array: a JSON array, an Excel sheet or the rows of a CSV

fieldsarray of SchemaFieldrequired

Fields of an item (<array>[]…)

Fields
pathstringrequired

Full address of the value, e.g. json.dane1.klient.nazwa

kindstringrequired

barcode: the value of a QR code or barcode (Word field DISPLAYBARCODE), the example has 12 digits, which QR, CODE128 and EAN13 all take; checkbox: a Word check box (true or false); email: the address of a signer; date and number: a field (or marker) with a date or number format (Word switch \@ or \#), the example has 2026-01-31 or 1234.5; image: a picture of the data, a PNG or JPEG as a data: address (data:image/png;base64,…) or plain base64, the example is a grey PNG of one pixel

one of "text", "checkbox", "email", "date", "number", "image", "barcode"
usesintegerrequired

How many places of the template read it

requiredbooleanrequired

False when every use has a text without data (default)

signersarray of objectrequired
Fields
rolestringrequired
namestringrequired

As the template gives it, with {{path}} markers for values of the data

emailstringrequired
exampleobjectrequired

A source registry ($oomploSources) with a value for every field; for a template whose fields read tables of its data model (table.…), the template's own sources with the model ($oomploModel)

jsonSchemaobject

A JSON Schema (draft 2020-12) of the data: the plain object (json.dane1) when the template reads only it, else the source registry; types from the kinds of the fields, required unless every use of a field has a text without data

400Invalid version
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

404No such template or version
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

409The template has no published version
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

503The library is not configured
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

GET /api/library #

The control panel's library — templates with their use, flows with a summary, the newest runs

Templates (format-3 documents) and flow definitions (packages) kept on the server and shared by every browser. A flow links templates by id (package.documents[].id); a run records the templates it was made from and its flow (flow of POST /api/runs). flows and runs of a template say what uses it; such a template cannot be removed. Templates and data files belong to stores: named groups, a folder magazyny/<name> [<id>]/ each (main, the main store, by default); a flow links data files by id (package.inputs[].source). Runs: the 300 newest, with their owner links. No accounts yet: internal network or an authenticating proxy only.

Responses

200The library
application/json
object
projectsarray of object

Projects (a DocumentFlow from before projects is one of its own)

Fields
idstring
titlestring
updatedinteger
layoutobject

Where the elements of its Project canvas are: element id → [x, y]

Fields
{key}array of number
storesarray of object

The main store first

Fields
idstring
titlestring
updatedinteger
templatesinteger
datainteger
kindstring

A project's store holds one kind (pdf: documents saved by store steps; runs: every file of its project's runs); empty: templates and data (the main store)

one of "", "templates", "data", "pdf", "runs"
projectstring

The project (flow id) it belongs to

keystring

Its folder in the storage

runsinteger

Runs in a runs store

linkedarray of string

Projects it is linked to (besides its owner)

mainboolean

The project's own store of its kind (folder projekty/<projekt> [id]/<szablony|dane|pdf|uruchomienia>, renamed with the project); false: a further store of the project (projekty/<projekt> [id]/magazyny/<nazwa> [id]) or one outside projects

templatesarray of object
Fields
idstring
titlestring
originstring
storestring
updatedinteger

Unix milliseconds

sizeinteger
flowsarray of string
runsinteger
runninginteger
publishedinteger | null

The published version, which POST /api/templates/{id}/render uses; null: not published

draftboolean

The template as last saved differs from the published version (or nothing is published)

versionsarray of object

Kept versions, oldest first

Fields
versioninteger
labelstring
createdinteger

Unix milliseconds

authorstring

The user who made it

dataarray of object
Fields
idstring
titlestring
kindstring
one of "json", "xlsx", "csv"
storestring
updatedinteger
sizeinteger
flowsarray of string

Flows that link it

flowsarray of object
Fields
idstring
titlestring
updatedinteger
templatesarray of object
Fields
idstring
titlestring
storedboolean
inputsarray of string

The data (input names) the template is filled with

versioninteger

The version its runs take (0: @latest)

inputsarray of object
stepsarray of object
Fields
idstring
kindstring
storestring

A store step: its PDF store

labelstring
runsobject
Fields
totalinteger
statesobject
Fields
{key}integer
laststring (date-time) | null
runsarray of object
Fields
idstring
titlestring
statestring
rowinteger | null
batchstring
packagestring
createdstring (date-time)
finishedstring (date-time) | null
documentsarray of object
Fields
idstring
titlestring
doneinteger
totalinteger
activearray of string
ownerstring
ownerPathstring
storestring

The runs store holding the run (empty: none)

runCountinteger
testSealboolean
503The store is not configured
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

Series jobs #

Many documents at once from rows of a spreadsheet, a CSV or a JSON array: one PDF per row in a ZIP, or one PDF for all rows.

POST /api/templates/{id}/jobs #

A series as a job on the server

One copy of the template's published version (or of version) per row of a series file, as oomplo pdf --series: each row replaces the JSON source series.name of the template's data. Every chosen row is filled before the job starts; an error in any row refuses the whole job (422 with the rows), so no PDF is made. The job renders in the background (202); follow it with GET /api/jobs/{id}. At most 1000 rows. Jobs and results are deleted after OOMPLO_JOB_HOURS (24 by default); a restart fails running jobs.

Parameters

NameInTypeDescription
id requiredpathstring

The template of the library

Idempotency-Keyheaderstring

A request repeated with the same key (per user, while the job is kept) answers the job it started instead of a new one

max length 200

Request body required

application/json
object
seriesobjectrequired
Fields
namestringrequired

The JSON source a row replaces (json.<name>…)

kindstring

Xlsx also reads an OpenDocument spreadsheet (.ods); csv reads UTF-8, UTF-16 with BOM, Windows-1250 or ISO-8859-2 with a tab, ; or , between columns; json also reads XML (a KSeF invoice: its lists are arrays)

one of "xlsx", "csv", "json"
filestring (byte)

The series file in base64 (with kind); or rows

rowsarray of object

The rows as JSON objects instead of kind and file

sheetstring

Excel: the sheet (empty: the first)

headerRowinteger

Excel: the row of column names (1)

min 1
pathstring

JSON: the array of rows inside the file (empty: the file itself or its only list)

mappingobject

The template field (key of a row) each column fills when their names differ, e.g. { "nazwisko": "Last name" }; the column stays under its own name too. Without mapping and join the job takes those the template remembers for the same name („Generuj z pliku”, $oomploSeries in the template data)

Fields
{key}string
joinobject

Excel only: the rows of another sheet (items) become an array of each row whose key equals the item's key (invoices and their lines)

Fields
sheetstringrequired

The sheet of the items

keystringrequired

The column of a row with its key

detailKeystring

The column of an item with its row's key (empty: the same name as key)

asstringrequired

The array of a row the items are, e.g. pozycje

mappingobject

The field of an item each column of the items sheet fills

Fields
{key}string
versioninteger
min 1
rowsstring

Rows such as 1-3, 7 (empty: all)

labelstring

Pattern of the labels and file names, with {{path}} (default Wiersz {{$wiersz}})

zipboolean

A ZIP with a PDF per row instead of one PDF with an outline entry per copy

duplexboolean

One PDF: every copy starts on an odd page

strictboolean

The job fails when the template has simplifications

missingstring

A value a row does not have is an error of the row (the job does not start) or an empty text

one of "error", "empty" · default "error"
formatstring

Docx makes a ZIP of filled Word documents, one per row (zip implied; not with seal or duplex)

one of "pdf", "docx" · default "pdf"
fieldsstring

With docx: keep leaves the data fields as Word content controls showing their values

one of "text", "keep" · default "text"
webhookstring

An https:// or http:// address (public) told with a POST { event: job, job: <state as GET /api/jobs/{id}> } signed X-Oomplo-Signature: sha256=<HMAC of the body> when the job ends; three tries, no redirects

outputstring

A path in the client's store (OOMPLO_S3_ENDPOINT, http:// or https://; else the server's storage directory) the result is also saved to when the job ends, ending with .zip (zip or docx) or .pdf; the job fails when the store refuses it

sealboolean

The company seal over every PDF (422 when the server has only the test seal)

pdfastring

Every PDF in archival PDF/A (as in POST /api/render); not with docx

one of "2b", "2u", "2a", "3b", "3u", "3a"
pdfuaboolean

Every PDF accessible (PDF/UA-1); not with docx

attachDataboolean

Each PDF of a ZIP carries its row's data, one PDF all rows as a JSON array (data.json; PDF/A-3 or no PDF/A)

Responses

202The job started
application/json
object
idstringrequired
statestringrequired
one of "running"
totalintegerrequired
400The request is not a job
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

404No such template or version
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

409The template has no published version
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

422The series cannot be read, or rows cannot be filled (rows, at most 100 listed); no job was started
application/json
object
errorstringrequired
rowsarray of object
Fields
rowintegerrequired
errorstringrequired

GET /api/jobs/{id} #

The state of a series job

Only the user or API key that started the job, and administrators, see it (404 for others).

Parameters

NameInTypeDescription
id requiredpathstring

Responses

200The job
application/json
object
idstringrequired
templatestringrequired
versionintegerrequired
createdintegerrequired

Unix time

expiresintegerrequired

Unix time when the job and its result are deleted

finishedinteger | null
outputstring | null

The path in the client's store the result was saved to

statestringrequired
one of "running", "done", "failed"
totalintegerrequired
doneintegerrequired

Copies rendered so far

formatstringrequired
one of "pdf", "zip"
resultstring | null

The address of the result when done

errorstring | null

Why the job failed (with the row)

404No such job, it expired, or another user started it
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

GET /api/jobs/{id}/result #

The result of a finished series job

Only the user or API key that started the job, and administrators, get it (404 for others).

Parameters

NameInTypeDescription
id requiredpathstring

Responses

200One PDF or a ZIP of PDFs
application/pdf
string (binary)
application/zip
string (binary)
404No such job
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

409The job is running or failed
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

Templates in the request #

Work with a DOCX sent in the request instead of a stored template: render it, check it, or build a template from filled documents.

POST /api/render #

PDF from a template and data, without a browser

Runs the engine crates (DOCX import, fill, layout, PDF) on the server: the same code as oomplo-cli and the WASM build, so the PDF has the same bytes as oomplo pdf for the same template. The template is either a DOCX (docx, base64; fields and repeated rows are Word content controls, saved data in the Oomplo custom XML part) or a DocumentSource in format 3 (document). data replaces the template's saved data (JSON object or a source registry). The PDF has no attachments: it contains neither the template nor the source data. Renders run one per CPU core; further requests wait in a queue of 256 and get 503 only when it is full. Warnings of the import and the layout (what the PDF shows simplified, e.g. a font with other widths than Word's or an element drawn without its effect) come back in the X-Oomplo-Warnings headers; information without effect on the result (a font replaced by one with the same widths) is not a warning. With strict: true a template with warnings is refused with 422 and the list. A picture field takes a PNG or JPEG in data: or base64, or an address (https://…, http://…) the server fetches from the hosts listed in OOMPLO_IMAGE_HOSTS (public addresses only unless OOMPLO_IMAGE_PRIVATE=1; at most 5 MB a picture, 50 MB and 200 addresses a request, 15 s each and 30 s together, no redirects); a host not listed is refused with 422. Limits: 16 MiB transferred, 160 MiB after gzip, DOCX 20 MB, data 10 MB, the document limits (source, nodes, characters; no limit on table rows), 1000 pages and OOMPLO_RENDER_SECONDS (60 s) of layout (422 past it). Requests wait for a render slot in a queue of 256 requests and 512 MiB of bodies (503 past it).

Parameters

NameInTypeDescription
Content-Encodingheaderstring
one of "identity", "gzip" · default "identity"

Request body required

application/json
RenderRequest

Exactly one template, docx (with an optional title) or document.

Variant 1: object
docxstring (byte)required

The DOCX template in base64 (at most 20 MB decoded)

titlestring

Document title (PDF metadata and file name); default "dokument"

dataany

Template data replacing the data saved in the DOCX: a source registry ($oomploSources) or a plain JSON object, which is the main source json.dane1 (fields json.dane1.client.name and client.name both read the plain object's client.name)

strictboolean

Refuse a template whose PDF would have simplifications (422 with the warnings)

default false
missingstring

A value the template reads that the data does not have: error (422 naming every missing value, each path once with the first item without it) or empty (an empty text, an unchecked box, no rows of a missing array). A field's default text is used either way

one of "error", "empty" · default "error"
formatstring

Docx returns the filled Word document (application/vnd.openxmlformats-officedocument.wordprocessingml.document) instead of the PDF

one of "pdf", "docx" · default "pdf"
fieldsstring

With docx: keep leaves the data fields as Word content controls showing their values (paths of array items get the item's index, e.g. items[1].price) and the data in the template part, so the file is still a template; text makes them plain text

one of "text", "keep" · default "text"
responsestring

Json answers { file (base64), contentType, fileName, pages, warnings, fontsSubstituted } instead of the file (low-code tools); the headers stay

one of "file", "json" · default "file"
pdfastring

Archival PDF/A (ISO 19005): part 2 or 3, level b (appearance), u (also Unicode text) or a (also the structure); the PDF is refused (422 naming the rule) when it cannot meet it, e.g. a font that forbids embedding or a CMYK picture. Pictures are not smoothed when scaled (PDF/A forbids it)

one of "2b", "2u", "2a", "3b", "3u", "3a"
pdfuaboolean

Accessible PDF/UA-1 (ISO 14289-1): the title from the document's properties, the language, an outline, headings, lists, tables (header rows as TH), notes, pictures with their Word description as figures, links; headers, footers and repeated header rows as artifacts; without the empty signature fields (a seal still signs)

default false
attachDataboolean

The data the document was filled with attached as data.json (with dataXml the XML file as data.xml) (an associated file, relation Data); with PDF/A only in part 3 (400 otherwise)

default false
dataXmlstring (byte)

The data as an XML file in base64 instead of data (an ERP export, a KSeF invoice FA(2)/FA(3)), read as JSON like oomplo pdf --data file.xml; a KSeF invoice also gets $ksef (verification code KOD I from the file's exact bytes: url, urlTest, urlDemo, hash, nip, date, label OFFLINE). Not together with data (400)

markupboolean

The PDF with markup: comments and tracked changes in balloons beside the scaled page, as Word exports a document shown with all markup

default false
Variant 2: object
documentobjectrequired

DocumentSource in format 3

dataany

Template data replacing the document's own (a plain JSON object is the source json.dane1, as above)

strictboolean

Refuse a template whose PDF would have simplifications (422 with the warnings)

default false
missingstring

A value the template reads that the data does not have: error (422 naming every missing value, each path once with the first item without it) or empty (an empty text, an unchecked box, no rows of a missing array). A field's default text is used either way

one of "error", "empty" · default "error"
formatstring

Docx returns the filled Word document (application/vnd.openxmlformats-officedocument.wordprocessingml.document) instead of the PDF

one of "pdf", "docx" · default "pdf"
fieldsstring

With docx: keep leaves the data fields as Word content controls showing their values (paths of array items get the item's index, e.g. items[1].price) and the data in the template part, so the file is still a template; text makes them plain text

one of "text", "keep" · default "text"
responsestring

Json answers { file (base64), contentType, fileName, pages, warnings, fontsSubstituted } instead of the file (low-code tools); the headers stay

one of "file", "json" · default "file"
pdfastring

Archival PDF/A (ISO 19005): part 2 or 3, level b (appearance), u (also Unicode text) or a (also the structure); the PDF is refused (422 naming the rule) when it cannot meet it, e.g. a font that forbids embedding or a CMYK picture. Pictures are not smoothed when scaled (PDF/A forbids it)

one of "2b", "2u", "2a", "3b", "3u", "3a"
pdfuaboolean

Accessible PDF/UA-1 (ISO 14289-1): the title from the document's properties, the language, an outline, headings, lists, tables (header rows as TH), notes, pictures with their Word description as figures, links; headers, footers and repeated header rows as artifacts; without the empty signature fields (a seal still signs)

default false
attachDataboolean

The data the document was filled with attached as data.json (with dataXml the XML file as data.xml) (an associated file, relation Data); with PDF/A only in part 3 (400 otherwise)

default false
dataXmlstring (byte)

The data as an XML file in base64 instead of data (an ERP export, a KSeF invoice FA(2)/FA(3)), read as JSON like oomplo pdf --data file.xml; a KSeF invoice also gets $ksef (verification code KOD I from the file's exact bytes: url, urlTest, urlDemo, hash, nip, date, label OFFLINE). Not together with data (400)

Responses

200The PDF
application/pdf
string (binary)
Headers
Content-Disposition
X-Oomplo-Warnings

Number of warnings (0 when the PDF has no simplifications)

X-Oomplo-Warnings-List

The warnings as a JSON array of Polish messages, UTF-8 percent-encoded (decodeURIComponent, then JSON.parse)

X-Oomplo-Fonts-Substituted

Fonts of the document drawn with a bundled substitute, as a JSON array of { name, family, status, alternate? } (status sameWidths: line and page breaks as in Word; sameLetterWidths: letters and digits have Word's widths, a few other characters differ; otherWidths: text may break differently; alternate: the font table's w:altName drawn in place of a missing font, as Word draws it), UTF-8 percent-encoded like X-Oomplo-Warnings-List. Fonts embedded in the DOCX and bundled fonts are not listed.

400Malformed request (not exactly one of docx and document, invalid base64) or invalid document (Polish message with the place of the error)
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

413More than 16 MiB transferred, 160 MiB after gzip decompression or a DOCX above 20 MB
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

415Unsupported Content-Encoding
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

422The DOCX cannot be read, the template cannot be filled or laid out (missing data, missing glyph, too many pages), or strict is set and the template has warnings (then warnings lists them)
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

503The render queue is full; retry later
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

POST /api/check #

Qualification report of a template

The same request as /api/render (import, data, fill and layout on the same queue and limits), but instead of the PDF a JSON report: the fonts of the document and how they are drawn, Word elements kept in the document but not shown, the warnings (what the PDF shows simplified), the notes (without effect on the result) and the page count. qualified is true when there are no warnings, i.e. when /api/render with strict: true accepts the template.

Request body required

application/json
RenderRequest

Exactly one template, docx (with an optional title) or document.

Variant 1: object
docxstring (byte)required

The DOCX template in base64 (at most 20 MB decoded)

titlestring

Document title (PDF metadata and file name); default "dokument"

dataany

Template data replacing the data saved in the DOCX: a source registry ($oomploSources) or a plain JSON object, which is the main source json.dane1 (fields json.dane1.client.name and client.name both read the plain object's client.name)

strictboolean

Refuse a template whose PDF would have simplifications (422 with the warnings)

default false
missingstring

A value the template reads that the data does not have: error (422 naming every missing value, each path once with the first item without it) or empty (an empty text, an unchecked box, no rows of a missing array). A field's default text is used either way

one of "error", "empty" · default "error"
formatstring

Docx returns the filled Word document (application/vnd.openxmlformats-officedocument.wordprocessingml.document) instead of the PDF

one of "pdf", "docx" · default "pdf"
fieldsstring

With docx: keep leaves the data fields as Word content controls showing their values (paths of array items get the item's index, e.g. items[1].price) and the data in the template part, so the file is still a template; text makes them plain text

one of "text", "keep" · default "text"
responsestring

Json answers { file (base64), contentType, fileName, pages, warnings, fontsSubstituted } instead of the file (low-code tools); the headers stay

one of "file", "json" · default "file"
pdfastring

Archival PDF/A (ISO 19005): part 2 or 3, level b (appearance), u (also Unicode text) or a (also the structure); the PDF is refused (422 naming the rule) when it cannot meet it, e.g. a font that forbids embedding or a CMYK picture. Pictures are not smoothed when scaled (PDF/A forbids it)

one of "2b", "2u", "2a", "3b", "3u", "3a"
pdfuaboolean

Accessible PDF/UA-1 (ISO 14289-1): the title from the document's properties, the language, an outline, headings, lists, tables (header rows as TH), notes, pictures with their Word description as figures, links; headers, footers and repeated header rows as artifacts; without the empty signature fields (a seal still signs)

default false
attachDataboolean

The data the document was filled with attached as data.json (with dataXml the XML file as data.xml) (an associated file, relation Data); with PDF/A only in part 3 (400 otherwise)

default false
dataXmlstring (byte)

The data as an XML file in base64 instead of data (an ERP export, a KSeF invoice FA(2)/FA(3)), read as JSON like oomplo pdf --data file.xml; a KSeF invoice also gets $ksef (verification code KOD I from the file's exact bytes: url, urlTest, urlDemo, hash, nip, date, label OFFLINE). Not together with data (400)

markupboolean

The PDF with markup: comments and tracked changes in balloons beside the scaled page, as Word exports a document shown with all markup

default false
Variant 2: object
documentobjectrequired

DocumentSource in format 3

dataany

Template data replacing the document's own (a plain JSON object is the source json.dane1, as above)

strictboolean

Refuse a template whose PDF would have simplifications (422 with the warnings)

default false
missingstring

A value the template reads that the data does not have: error (422 naming every missing value, each path once with the first item without it) or empty (an empty text, an unchecked box, no rows of a missing array). A field's default text is used either way

one of "error", "empty" · default "error"
formatstring

Docx returns the filled Word document (application/vnd.openxmlformats-officedocument.wordprocessingml.document) instead of the PDF

one of "pdf", "docx" · default "pdf"
fieldsstring

With docx: keep leaves the data fields as Word content controls showing their values (paths of array items get the item's index, e.g. items[1].price) and the data in the template part, so the file is still a template; text makes them plain text

one of "text", "keep" · default "text"
responsestring

Json answers { file (base64), contentType, fileName, pages, warnings, fontsSubstituted } instead of the file (low-code tools); the headers stay

one of "file", "json" · default "file"
pdfastring

Archival PDF/A (ISO 19005): part 2 or 3, level b (appearance), u (also Unicode text) or a (also the structure); the PDF is refused (422 naming the rule) when it cannot meet it, e.g. a font that forbids embedding or a CMYK picture. Pictures are not smoothed when scaled (PDF/A forbids it)

one of "2b", "2u", "2a", "3b", "3u", "3a"
pdfuaboolean

Accessible PDF/UA-1 (ISO 14289-1): the title from the document's properties, the language, an outline, headings, lists, tables (header rows as TH), notes, pictures with their Word description as figures, links; headers, footers and repeated header rows as artifacts; without the empty signature fields (a seal still signs)

default false
attachDataboolean

The data the document was filled with attached as data.json (with dataXml the XML file as data.xml) (an associated file, relation Data); with PDF/A only in part 3 (400 otherwise)

default false
dataXmlstring (byte)

The data as an XML file in base64 instead of data (an ERP export, a KSeF invoice FA(2)/FA(3)), read as JSON like oomplo pdf --data file.xml; a KSeF invoice also gets $ksef (verification code KOD I from the file's exact bytes: url, urlTest, urlDemo, hash, nip, date, label OFFLINE). Not together with data (400)

Responses

200The report
application/json
TemplateReport
qualifiedbooleanrequired

No warnings (strict mode accepts the template)

pagesintegerrequired
fontsarray of objectrequired
Fields
namestringrequired

Font name in the document

familystringrequired

Bundled family that draws it

alternatestring

The font table's alternative (w:altName) drawn in place of a missing font, as Word draws it; only when used

statusstringrequired

embedded in the DOCX (drawn with its own file); bundled; replaced by a font with the same glyph widths (breaks as in Word); replaced by a font with Word's widths for letters and digits only (nearly always breaks as in Word; still a warning); replaced by a font with other widths (text may break differently)

one of "embedded", "organization", "bundled", "sameWidths", "sameLetterWidths", "otherWidths"
elementsarray of objectrequired

Word elements kept in the document but not shown as in Word (bookmarks and other elements Word does not draw are left out)

Fields
namestringrequired
countintegerrequired
warningsarray of stringrequired
notesarray of stringrequired
400As for /api/render
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

413As for /api/render
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

422The DOCX cannot be read, or the template cannot be filled or laid out
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

503The render queue is full; retry later
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

POST /api/infer #

A template from filled documents

2 to 20 filled DOCX documents of one kind (the same contract for different clients) are compared: text that differs becomes data fields (json.dane1.<name>, named after the text before the value), a table whose rows differ in number a repeated row (header and total rows stay fixed, their values become fields), and paragraphs or tables only some documents have conditional blocks (a true/false value per document). The first document gives the look. The answer has the template as DOCX, the data set of each document and a report that says whether the template filled with each data set gives that document's text again. Same as oomplo infer. API keys: scope render.

Request body required

application/json
object
documentsarray of objectrequired
min items 2 · max items 20
Fields
namestringrequired

The document's name (its data set's name), at most 100 characters

docxstring (byte)required

The filled document in base64

Responses

200The template, the data sets and the report
application/json
object
templatestring (byte)required

The template as DOCX in base64 (fields as Word content controls

titlestringrequired
datasetsarray of objectrequired
Fields
namestring
dataobject

The document's data for the template (fields, arrays of repeated rows, true/false of conditional blocks)

reportobjectrequired
Fields
documentsinteger
fieldsarray of object
Fields
namestring
pathstring
labelstring
valuesarray of string
tablesarray of object
Fields
namestring
pathstring
columnsarray of string
rowsarray of integer
conditionsarray of object
Fields
namestring
pathstring
textstring
presentarray of boolean
reproducedarray of object
Fields
namestring
sameboolean
differencestring
warningsarray of string
400Not JSON, not base64, or more than 20 documents
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

422A document cannot be read, or fewer than two documents
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

History #

Who made which document when. The history never contains your data or the documents.

GET /api/history #

The history of generating

One entry per call of POST /api/templates/{id}/render and per series job (also refused ones), newest first: time, user, template, version, pages, rows, duration, number of warnings and the error. The data and the PDFs are never stored; quoted parts of error messages are cut out („…”). Entries are deleted after OOMPLO_HISTORY_DAYS (90 by default).

Parameters

NameInTypeDescription
templatequerystring
userquerystring
kindquerystring
one of "render", "job"
statusquerystring
one of "ok", "error"
fromqueryinteger

Unix time from (inclusive)

toqueryinteger

Unix time to (exclusive)

limitqueryinteger
min 1 · max 10000

Responses

200The entries
application/json
object
daysintegerrequired

How long entries are kept

entriesarray of objectrequired
Fields
timeintegerrequired

Unix time

userstringrequired
kindstringrequired
one of "render", "job"
templatestringrequired
versioninteger | null
pagesintegerrequired
rowsintegerrequired
durationMsintegerrequired
warningsintegerrequired
errorstring | null
400An unknown filter
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

GET /api/history.csv #

The history of generating as CSV

The entries of GET /api/history with the same filters, ;-separated, UTF-8 with a byte order mark, times in UTC.

Responses

200The CSV file
text/csv
string

Embedded editor #

A short-lived token that opens the template editor in an iframe of your application.

POST /api/embed #

A token for the template editor embedded in a page of the client (an iframe of /?embed=<token>)

For an API key (scope render) or a session. The origin must be listed in OOMPLO_EMBED_ORIGINS (only those pages may frame Oomplo). The token is the editor of its one template until it expires: that template (not removing it), the flows that hold it, fonts and the library overview limited to that template; every other path (storage, runs, workflows, other templates, data files, projects, rendering, accounts, keys) is 403. A token without a template is bound to the new template it saves first. Revoking the API key (or disabling the account) that asked for it ends the token. The page and talks with postMessage only to the window of that origin.

Request body required

application/json
object
originstringrequired

The host page's origin, e.g. https://crm.firma.pl

templatestring

The template to open: its id or API name; none: a new template

titlestring

The title of a new template

max length 200
ttlinteger

Seconds the token lasts

default 3600 · min 60 · max 28800

Responses

200The token and the address of the editor's page
application/json
object
tokenstringrequired

oomplo_embed_…

urlstringrequired

The iframe's src: <OOMPLO_PUBLIC_URL>/?embed=<token>

templatestring
originstringrequired
expiresintegerrequired

Unix time

403Embedding is off or the origin is not allowed
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

404No such template
application/json
Error
errorstringrequired
warningsarray of string

In strict mode, the warnings that refused the template

Server #

Whether the server runs.

GET /api/health #

Whether the server can serve templates

For monitoring and the container's health check. 200 when the library (its database and files) is open, 503 otherwise.

Responses

200The server is ready
application/json
Health
statusstringrequired
one of "ok", "unavailable"
versionstringrequired

Version of the server

librarybooleanrequired

The library of templates is open

storagestringrequired

Where the files are: a directory or s3://bucket

flowbooleanrequired

DocumentFlow

503The library could not be opened (the reason is in the server's log)
application/json
Health
statusstringrequired
one of "ok", "unavailable"
versionstringrequired

Version of the server

librarybooleanrequired

The library of templates is open

storagestringrequired

Where the files are: a directory or s3://bucket

flowbooleanrequired

DocumentFlow