Skip to main content
The document JSON is the core data structure used by the Render endpoint (POST /render) and Bulk Render endpoint (POST /bulk-render) to generate PDF, DOCX, and ODT documents.

Top-level structure

A document JSON object has the following top-level keys:
{
  "document": { ... },
  "sections": [ ... ],
  "variables": { ... },
  "abbreviations": { ... },
  "citations": [ ... ],
  "defaults": { ... }
}
PropertyTypeRequiredDescription
documentobjectYesPage settings: output format, size, margins, orientation, and metadata.
sectionsarrayYesArray of content sections. Each section contains an array of elements. Min: 0, Max: 500.
variablesobjectNoTemplate variables for {{varName}} text substitution and variableRef elements.
abbreviationsobjectNoMap of abbreviation short forms to their full text (e.g., "API": "Application Programming Interface").
citationsarrayNoArray of citation entries in CSL-JSON format for bibliography generation. Max: 1000.
defaultsobjectNoGlobal styling defaults: fonts, colors, spacing, element styles, header/footer, citation style, and more.

Strict validation mode

The render endpoints (POST /render and POST /render/markdown) support an optional ?strict=true query parameter that enables strict validation. In strict mode, the API performs additional checks that go beyond schema validation:
  • Broken internal references — references to non-existent anchors (e.g., [see here](#missing-anchor)) cause an error
  • Undefined citations@[citeKey] references to citation IDs not present in the citations array cause an error
  • Undefined abbreviations~ABK~ references to abbreviation keys not present in the abbreviations object cause an error
  • Duplicate anchors — multiple elements defining the same anchor ID cause an error (this is always checked, even without strict mode)
Without strict mode, broken references, undefined citations, and undefined abbreviations are treated as warnings and do not block rendering. With strict mode enabled, they become errors and the render request is rejected with a 400 Bad Request response containing the list of validation errors.
Strict mode is recommended for production workflows to catch issues early. In the Autype editor, these same checks are shown as warnings in the sidebar.

Document settings

The document object configures the page layout and document metadata.
{
  "document": {
    "type": "pdf",
    "filename": "invoice-2024",
    "title": "Invoice #1234",
    "author": "Acme Inc",
    "subject": "Monthly Invoice",
    "keywords": ["invoice", "billing"],
    "size": "A4",
    "orientation": "portrait",
    "marginTop": 2.5,
    "marginRight": 2.5,
    "marginBottom": 2,
    "marginLeft": 2.5
  }
}

Properties

PropertyTypeRequiredDefaultDescription
typestringYesOutput format: "pdf", "docx", or "odt"
filenamestringNoOutput filename without extension. Only a-z, A-Z, 0-9, _, - allowed. Max: 100 chars.
titlestringNoDocument title (PDF/DOCX metadata). Max: 200 chars.
authorstringNoDocument author (PDF/DOCX metadata). Max: 100 chars.
subjectstringNoDocument subject (PDF/DOCX metadata). Max: 200 chars.
keywordsstring[]NoDocument keywords for metadata. Max: 10 items, 50 chars each.
sizestringNo"A4"Page size: "A4", "A3", "A5", "Letter", "Legal"
orientationstringNo"portrait"Page orientation: "portrait" or "landscape"
marginTopnumberNoTop margin in cm (0–10)
marginRightnumberNoRight margin in cm (0–10)
marginBottomnumberNoBottom margin in cm (0–10)
marginLeftnumberNoLeft margin in cm (0–10)

Sections

Sections are the content containers of your document. There are two types:

Flow section

Flowing content that spans multiple pages automatically. This is the most common section type.
{
  "type": "flow",
  "newPage": true,
  "columns": { "count": 2, "space": 1.27, "separate": true },
  "content": [
    { "type": "h1", "text": "Introduction" },
    { "type": "text", "text": "This is a paragraph." }
  ]
}
PropertyTypeRequiredDefaultDescription
typestringYesMust be "flow"
idstringNoOptional unique identifier. Max: 100 chars.
newPagebooleanNotrueStart this section on a new page.
columnsobjectNoMulti-column layout configuration.
contentarrayYesArray of content elements. Max: 5000 elements.

Columns

PropertyTypeRequiredDefaultDescription
countnumberYesNumber of columns (1–4)
spacenumberNo1.27Space between columns in cm (0–5)
separatebooleanNofalseShow separator line between columns

Page section

A single positioned page — useful for cover pages, title pages, or any content that needs precise vertical positioning.
{
  "type": "page",
  "align": "center",
  "content": [
    { "type": "h1", "text": "My Document", "align": "center" },
    { "type": "text", "text": "A subtitle", "align": "center" }
  ]
}
PropertyTypeRequiredDefaultDescription
typestringYesMust be "page"
idstringNoOptional unique identifier. Max: 100 chars.
alignstringNo"top"Vertical alignment: "top", "center", "bottom"
startYnumberNoY position in cm from top (0–100). Overrides align.
contentarrayYesArray of content elements. Max: 200 elements.

Complete example

{
  "document": {
    "type": "pdf",
    "filename": "certificate",
    "title": "Certificate of Completion",
    "size": "A4",
    "orientation": "landscape",
    "marginTop": 2,
    "marginRight": 2.5,
    "marginBottom": 2,
    "marginLeft": 2.5
  },
  "variables": {
    "recipientName": "Max Mustermann",
    "courseName": "Advanced Document Automation",
    "completionDate": "15. Januar 2026"
  },
  "defaults": {
    "fontFamily": "Arial",
    "fontSize": 12,
    "color": "#333333"
  },
  "sections": [
    {
      "type": "flow",
      "content": [
        { "type": "h1", "text": "Certificate of Completion", "align": "center" },
        { "type": "spacer", "height": 2 },
        { "type": "text", "text": "This is to certify that", "align": "center" },
        { "type": "h2", "text": "{{recipientName}}", "align": "center" },
        { "type": "text", "text": "has successfully completed the course", "align": "center" },
        { "type": "h3", "text": "{{courseName}}", "align": "center" },
        { "type": "spacer", "height": 2 },
        { "type": "text", "text": "Date: {{completionDate}}", "align": "center" }
      ]
    }
  ]
}

Next steps