API reference
Every call an API key may make, generated from the OpenAPI definition. For a walk-through with examples, read the API guide.
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
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The template of the library |
Request body required
dataobjectData replacing the template's own (as in POST /api/render)
versionintegerA kept version instead of the published one
1draftbooleanThe working copy instead of a version (X-Oomplo-Template-Version 0); a test key or a signed-in user, not a production key (403)
strictbooleanRefuse a template whose PDF would be simplified
missingstringError (422 naming every missing value) or empty (an empty text)
"error", "empty" · default "error"formatstringDocx returns the filled Word document instead of the PDF
"pdf", "docx" · default "pdf"fieldsstringWith docx: keep leaves the data fields as Word content controls showing their values (the file stays a template)
"text", "keep" · default "text"responsestringJson answers { file (base64), contentType, fileName, pages, warnings } instead of the file
"file", "json" · default "file"sealbooleanThe company seal over the PDF (OOMPLO_SEAL_KEY and OOMPLO_SEAL_CERT; 422 when the server has only the test seal)
pdfastringArchival PDF/A, as in POST /api/render
"2b", "2u", "2a", "3b", "3u", "3a"pdfuabooleanAccessible PDF/UA-1, as in POST /api/render
attachDatabooleanThe 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
X-Oomplo-Template-VersionThe version rendered
X-Oomplo-Signature-FieldsPercent-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-WarningsX-Oomplo-Warnings-ListPercent-encoded JSON array
X-Oomplo-Fonts-SubstitutedPercent-encoded JSON array
400Invalid request or data
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
404No such template or version
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
409The template has no published version
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
422The template cannot be filled or laid out, or strict refused it (with warnings)
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
503The render queue is full or the library is not configured
errorstringrequiredwarningsarray of stringIn 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
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The template of the library |
Request body required
dataobjectData as for render (a plain object is json.dane1)
versioninteger1Responses
200The report
validbooleanrequiredmissingarray of objectrequiredFields
pathstringrequiredrowintegerFirst item (from 1) of an array without the value
countintegerrequiredproblemsarray of objectrequiredFields
pathstringrequiredWith the index of its item, e.g. json.dane1.items[2].price
messagestringrequirederrorstring | nullversionintegerrequired400Invalid request or data
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
404No such template or version
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
409The template has no published version
errorstringrequiredwarningsarray of stringIn 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
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The template of the library |
version | query | integer | A kept version instead of the published one min 1 |
Responses
200The schema
versionintegerrequiredfieldsarray of SchemaFieldrequiredFields
pathstringrequiredFull address of the value, e.g. json.dane1.klient.nazwa
kindstringrequiredbarcode: 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
"text", "checkbox", "email", "date", "number", "image", "barcode"usesintegerrequiredHow many places of the template read it
requiredbooleanrequiredFalse when every use has a text without data (default)
arraysarray of objectrequiredFields
pathstringrequiredThe array: a JSON array, an Excel sheet or the rows of a CSV
fieldsarray of SchemaFieldrequiredFields of an item (<array>[]…)
Fields
pathstringrequiredFull address of the value, e.g. json.dane1.klient.nazwa
kindstringrequiredbarcode: 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
"text", "checkbox", "email", "date", "number", "image", "barcode"usesintegerrequiredHow many places of the template read it
requiredbooleanrequiredFalse when every use has a text without data (default)
signersarray of objectrequiredFields
rolestringrequirednamestringrequiredAs the template gives it, with {{path}} markers for values of the data
emailstringrequiredexampleobjectrequiredA 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)
jsonSchemaobjectA 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
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
404No such template or version
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
409The template has no published version
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
503The library is not configured
errorstringrequiredwarningsarray of stringIn 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
projectsarray of objectProjects (a DocumentFlow from before projects is one of its own)
Fields
idstringtitlestringupdatedintegerlayoutobjectWhere the elements of its Project canvas are: element id → [x, y]
Fields
{key}array of numberstoresarray of objectThe main store first
Fields
idstringtitlestringupdatedintegertemplatesintegerdataintegerkindstringA 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)
"", "templates", "data", "pdf", "runs"projectstringThe project (flow id) it belongs to
keystringIts folder in the storage
runsintegerRuns in a runs store
linkedarray of stringProjects it is linked to (besides its owner)
mainbooleanThe 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 objectFields
idstringtitlestringoriginstringstorestringupdatedintegerUnix milliseconds
sizeintegerflowsarray of stringrunsintegerrunningintegerpublishedinteger | nullThe published version, which POST /api/templates/{id}/render uses; null: not published
draftbooleanThe template as last saved differs from the published version (or nothing is published)
versionsarray of objectKept versions, oldest first
Fields
versionintegerlabelstringcreatedintegerUnix milliseconds
authorstringThe user who made it
dataarray of objectFields
idstringtitlestringkindstring"json", "xlsx", "csv"storestringupdatedintegersizeintegerflowsarray of stringFlows that link it
flowsarray of objectFields
idstringtitlestringupdatedintegertemplatesarray of objectFields
idstringtitlestringstoredbooleaninputsarray of stringThe data (input names) the template is filled with
versionintegerThe version its runs take (0: @latest)
inputsarray of objectstepsarray of objectFields
idstringkindstringstorestringA store step: its PDF store
labelstringrunsobjectFields
totalintegerstatesobjectFields
{key}integerlaststring (date-time) | nullrunsarray of objectFields
idstringtitlestringstatestringrowinteger | nullbatchstringpackagestringcreatedstring (date-time)finishedstring (date-time) | nulldocumentsarray of objectFields
idstringtitlestringdoneintegertotalintegeractivearray of stringownerstringownerPathstringstorestringThe runs store holding the run (empty: none)
runCountintegertestSealboolean503The store is not configured
errorstringrequiredwarningsarray of stringIn 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
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string | The template of the library |
Idempotency-Key | header | string | 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
seriesobjectrequiredFields
namestringrequiredThe JSON source a row replaces (json.<name>…)
kindstringXlsx 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)
"xlsx", "csv", "json"filestring (byte)The series file in base64 (with kind); or rows
rowsarray of objectThe rows as JSON objects instead of kind and file
sheetstringExcel: the sheet (empty: the first)
headerRowintegerExcel: the row of column names (1)
1pathstringJSON: the array of rows inside the file (empty: the file itself or its only list)
mappingobjectThe 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}stringjoinobjectExcel 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
sheetstringrequiredThe sheet of the items
keystringrequiredThe column of a row with its key
detailKeystringThe column of an item with its row's key (empty: the same name as key)
asstringrequiredThe array of a row the items are, e.g. pozycje
mappingobjectThe field of an item each column of the items sheet fills
Fields
{key}stringversioninteger1rowsstringRows such as 1-3, 7 (empty: all)
labelstringPattern of the labels and file names, with {{path}} (default Wiersz {{$wiersz}})
zipbooleanA ZIP with a PDF per row instead of one PDF with an outline entry per copy
duplexbooleanOne PDF: every copy starts on an odd page
strictbooleanThe job fails when the template has simplifications
missingstringA value a row does not have is an error of the row (the job does not start) or an empty text
"error", "empty" · default "error"formatstringDocx makes a ZIP of filled Word documents, one per row (zip implied; not with seal or duplex)
"pdf", "docx" · default "pdf"fieldsstringWith docx: keep leaves the data fields as Word content controls showing their values
"text", "keep" · default "text"webhookstringAn 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
outputstringA 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
sealbooleanThe company seal over every PDF (422 when the server has only the test seal)
pdfastringEvery PDF in archival PDF/A (as in POST /api/render); not with docx
"2b", "2u", "2a", "3b", "3u", "3a"pdfuabooleanEvery PDF accessible (PDF/UA-1); not with docx
attachDatabooleanEach 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
idstringrequiredstatestringrequired"running"totalintegerrequired400The request is not a job
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
404No such template or version
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
409The template has no published version
errorstringrequiredwarningsarray of stringIn 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
errorstringrequiredrowsarray of objectFields
rowintegerrequirederrorstringrequiredGET /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
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string |
Responses
200The job
idstringrequiredtemplatestringrequiredversionintegerrequiredcreatedintegerrequiredUnix time
expiresintegerrequiredUnix time when the job and its result are deleted
finishedinteger | nulloutputstring | nullThe path in the client's store the result was saved to
statestringrequired"running", "done", "failed"totalintegerrequireddoneintegerrequiredCopies rendered so far
formatstringrequired"pdf", "zip"resultstring | nullThe address of the result when done
errorstring | nullWhy the job failed (with the row)
404No such job, it expired, or another user started it
errorstringrequiredwarningsarray of stringIn 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
| Name | In | Type | Description |
|---|---|---|---|
id required | path | string |
Responses
200One PDF or a ZIP of PDFs
404No such job
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
409The job is running or failed
errorstringrequiredwarningsarray of stringIn 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
| Name | In | Type | Description |
|---|---|---|---|
Content-Encoding | header | string | one of "identity", "gzip" · default "identity" |
Request body required
Exactly one template, docx (with an optional title) or document.
docxstring (byte)requiredThe DOCX template in base64 (at most 20 MB decoded)
titlestringDocument title (PDF metadata and file name); default "dokument"
dataanyTemplate 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)
strictbooleanRefuse a template whose PDF would have simplifications (422 with the warnings)
falsemissingstringA 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
"error", "empty" · default "error"formatstringDocx returns the filled Word document (application/vnd.openxmlformats-officedocument.wordprocessingml.document) instead of the PDF
"pdf", "docx" · default "pdf"fieldsstringWith 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
"text", "keep" · default "text"responsestringJson answers { file (base64), contentType, fileName, pages, warnings, fontsSubstituted } instead of the file (low-code tools); the headers stay
"file", "json" · default "file"pdfastringArchival 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)
"2b", "2u", "2a", "3b", "3u", "3a"pdfuabooleanAccessible 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)
falseattachDatabooleanThe 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)
falsedataXmlstring (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)
markupbooleanThe PDF with markup: comments and tracked changes in balloons beside the scaled page, as Word exports a document shown with all markup
falsedocumentobjectrequiredDocumentSource in format 3
dataanyTemplate data replacing the document's own (a plain JSON object is the source json.dane1, as above)
strictbooleanRefuse a template whose PDF would have simplifications (422 with the warnings)
falsemissingstringA 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
"error", "empty" · default "error"formatstringDocx returns the filled Word document (application/vnd.openxmlformats-officedocument.wordprocessingml.document) instead of the PDF
"pdf", "docx" · default "pdf"fieldsstringWith 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
"text", "keep" · default "text"responsestringJson answers { file (base64), contentType, fileName, pages, warnings, fontsSubstituted } instead of the file (low-code tools); the headers stay
"file", "json" · default "file"pdfastringArchival 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)
"2b", "2u", "2a", "3b", "3u", "3a"pdfuabooleanAccessible 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)
falseattachDatabooleanThe 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)
falsedataXmlstring (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
Content-DispositionX-Oomplo-WarningsNumber of warnings (0 when the PDF has no simplifications)
X-Oomplo-Warnings-ListThe warnings as a JSON array of Polish messages, UTF-8 percent-encoded (decodeURIComponent, then JSON.parse)
X-Oomplo-Fonts-SubstitutedFonts 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)
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
413More than 16 MiB transferred, 160 MiB after gzip decompression or a DOCX above 20 MB
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
415Unsupported Content-Encoding
errorstringrequiredwarningsarray of stringIn 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)
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
503The render queue is full; retry later
errorstringrequiredwarningsarray of stringIn 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
Exactly one template, docx (with an optional title) or document.
docxstring (byte)requiredThe DOCX template in base64 (at most 20 MB decoded)
titlestringDocument title (PDF metadata and file name); default "dokument"
dataanyTemplate 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)
strictbooleanRefuse a template whose PDF would have simplifications (422 with the warnings)
falsemissingstringA 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
"error", "empty" · default "error"formatstringDocx returns the filled Word document (application/vnd.openxmlformats-officedocument.wordprocessingml.document) instead of the PDF
"pdf", "docx" · default "pdf"fieldsstringWith 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
"text", "keep" · default "text"responsestringJson answers { file (base64), contentType, fileName, pages, warnings, fontsSubstituted } instead of the file (low-code tools); the headers stay
"file", "json" · default "file"pdfastringArchival 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)
"2b", "2u", "2a", "3b", "3u", "3a"pdfuabooleanAccessible 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)
falseattachDatabooleanThe 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)
falsedataXmlstring (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)
markupbooleanThe PDF with markup: comments and tracked changes in balloons beside the scaled page, as Word exports a document shown with all markup
falsedocumentobjectrequiredDocumentSource in format 3
dataanyTemplate data replacing the document's own (a plain JSON object is the source json.dane1, as above)
strictbooleanRefuse a template whose PDF would have simplifications (422 with the warnings)
falsemissingstringA 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
"error", "empty" · default "error"formatstringDocx returns the filled Word document (application/vnd.openxmlformats-officedocument.wordprocessingml.document) instead of the PDF
"pdf", "docx" · default "pdf"fieldsstringWith 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
"text", "keep" · default "text"responsestringJson answers { file (base64), contentType, fileName, pages, warnings, fontsSubstituted } instead of the file (low-code tools); the headers stay
"file", "json" · default "file"pdfastringArchival 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)
"2b", "2u", "2a", "3b", "3u", "3a"pdfuabooleanAccessible 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)
falseattachDatabooleanThe 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)
falsedataXmlstring (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
qualifiedbooleanrequiredNo warnings (strict mode accepts the template)
pagesintegerrequiredfontsarray of objectrequiredFields
namestringrequiredFont name in the document
familystringrequiredBundled family that draws it
alternatestringThe font table's alternative (w:altName) drawn in place of a missing font, as Word draws it; only when used
statusstringrequiredembedded 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)
"embedded", "organization", "bundled", "sameWidths", "sameLetterWidths", "otherWidths"elementsarray of objectrequiredWord elements kept in the document but not shown as in Word (bookmarks and other elements Word does not draw are left out)
Fields
namestringrequiredcountintegerrequiredwarningsarray of stringrequirednotesarray of stringrequired400As for /api/render
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
413As for /api/render
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
422The DOCX cannot be read, or the template cannot be filled or laid out
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
503The render queue is full; retry later
errorstringrequiredwarningsarray of stringIn 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
documentsarray of objectrequired2 · max items 20Fields
namestringrequiredThe document's name (its data set's name), at most 100 characters
docxstring (byte)requiredThe filled document in base64
Responses
200The template, the data sets and the report
templatestring (byte)requiredThe template as DOCX in base64 (fields as Word content controls
titlestringrequireddatasetsarray of objectrequiredFields
namestringdataobjectThe document's data for the template (fields, arrays of repeated rows, true/false of conditional blocks)
reportobjectrequiredFields
documentsintegerfieldsarray of objectFields
namestringpathstringlabelstringvaluesarray of stringtablesarray of objectFields
namestringpathstringcolumnsarray of stringrowsarray of integerconditionsarray of objectFields
namestringpathstringtextstringpresentarray of booleanreproducedarray of objectFields
namestringsamebooleandifferencestringwarningsarray of string400Not JSON, not base64, or more than 20 documents
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
422A document cannot be read, or fewer than two documents
errorstringrequiredwarningsarray of stringIn 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
| Name | In | Type | Description |
|---|---|---|---|
template | query | string | |
user | query | string | |
kind | query | string | one of "render", "job" |
status | query | string | one of "ok", "error" |
from | query | integer | Unix time from (inclusive) |
to | query | integer | Unix time to (exclusive) |
limit | query | integer | min 1 · max 10000 |
Responses
200The entries
daysintegerrequiredHow long entries are kept
entriesarray of objectrequiredFields
timeintegerrequiredUnix time
userstringrequiredkindstringrequired"render", "job"templatestringrequiredversioninteger | nullpagesintegerrequiredrowsintegerrequireddurationMsintegerrequiredwarningsintegerrequirederrorstring | null400An unknown filter
errorstringrequiredwarningsarray of stringIn 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
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
originstringrequiredThe host page's origin, e.g. https://crm.firma.pl
templatestringThe template to open: its id or API name; none: a new template
titlestringThe title of a new template
200ttlintegerSeconds the token lasts
3600 · min 60 · max 28800Responses
200The token and the address of the editor's page
tokenstringrequiredoomplo_embed_…
urlstringrequiredThe iframe's src: <OOMPLO_PUBLIC_URL>/?embed=<token>
templatestringoriginstringrequiredexpiresintegerrequiredUnix time
403Embedding is off or the origin is not allowed
errorstringrequiredwarningsarray of stringIn strict mode, the warnings that refused the template
404No such template
errorstringrequiredwarningsarray of stringIn 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
statusstringrequired"ok", "unavailable"versionstringrequiredVersion of the server
librarybooleanrequiredThe library of templates is open
storagestringrequiredWhere the files are: a directory or s3://bucket
flowbooleanrequiredDocumentFlow
503The library could not be opened (the reason is in the server's log)
statusstringrequired"ok", "unavailable"versionstringrequiredVersion of the server
librarybooleanrequiredThe library of templates is open
storagestringrequiredWhere the files are: a directory or s3://bucket
flowbooleanrequiredDocumentFlow