Excel

Generate Excel workbook from JSON

Create a fully styled Excel workbook (.xlsx) from a structured JSON definition. Supports multiple sheets, column definitions, formulas, styling, headers/footers, freeze panes, print areas, merged cells, and more.

post/api/excel/generate

Request

  • Base URL: https://api.dokmatiq.com
  • URL: https://api.dokmatiq.com/api/excel/generate
  • Auth: API key in header X-API-Key

Request body

propertiesobject

Document properties (author, title, subject, etc.)

passwordstring

Password to protect the workbook

Example request

{
  "sheets": [
    {
      "name": "Umsatz Q1",
      "columns": [
        {
          "header": "Produkt",
          "width": 25,
          "format": "#,##0.00 €",
          "align": "LEFT",
          "headerStyle": {
            "fontName": "Arial",
            "fontSize": 11,
            "fontColor": "#000000",
            "backgroundColor": "#4472C4",
            "fillPattern": "SOLID_FOREGROUND",
            "borderColor": "#000000",
            "numberFormat": "#,##0.00"
          },
          "dataStyle": {
            "fontName": "Arial",
            "fontSize": 11,
            "fontColor": "#000000",
            "backgroundColor": "#4472C4",
            "fillPattern": "SOLID_FOREGROUND",
            "borderColor": "#000000",
            "numberFormat": "#,##0.00"
          }
        }
      ],
      "rows": [
        {
          "values": [
            "Widget",
            "12500.50",
            "2026-04-12"
          ],
          "cells": [
            {
              "ref": "B3",
              "column": 1,
              "formula": "=SUM(B2:B10)",
              "format": "#,##0.00",
              "style": {
                "fontName": "Arial",
                "fontSize": 11,
                "fontColor": "#000000",
                "backgroundColor": "#4472C4",
                "fillPattern": "SOLID_FOREGROUND",
                "borderColor": "#000000",
                "numberFormat": "#,##0.00"
              },
              "comment": "Includes tax",
              "hyperlink": "https://dokmatiq.com"
            }
          ],
          "height": 20,
          "style": {
            "fontName": "Arial",
            "fontSize": 11,
            "fontColor": "#000000",
            "backgroundColor": "#4472C4",
            "fillPattern": "SOLID_FOREGROUND",
            "borderColor": "#000000",
            "numberFormat": "#,##0.00"
          }
        }
      ],
      "cells": [
        {
          "ref": "B3",
          "column": 1,
          "formula": "=SUM(B2:B10)",
          "format": "#,##0.00",
          "style": {
            "fontName": "Arial",
            "fontSize": 11,
            "fontColor": "#000000",
            "backgroundColor": "#4472C4",
            "fillPattern": "SOLID_FOREGROUND",
            "borderColor": "#000000",
            "numberFormat": "#,##0.00"
          },
          "comment": "Includes tax",
          "hyperlink": "https://dokmatiq.com"
        }
      ],
      "namedRanges": [
        {
          "name": "SalesData",
          "range": "A1:D20"
        }
      ],
      "formulas": [
        {
          "cell": "B11",
          "formula": "=SUM(B2:B10)",
          "label": "Total",
          "format": "#,##0.00 €",
          "style": {
            "fontName": "Arial",
            "fontSize": 11,
            "fontColor": "#000000",
            "backgroundColor": "#4472C4",
            "fillPattern": "SOLID_FOREGROUND",
            "borderColor": "#000000",
            "numberFormat": "#,##0.00"
          }
        }
      ],
      "headerFooter": {
        "header": "&LACME GmbH&RPage &P of &N",
        "footer": "&LConfidential&R&D"
      },
      "printArea": "A1:F20",
      "freezePane": {
        "row": 1
      },
      "headerStyle": {
        "fontName": "Arial",
        "fontSize": 11,
        "fontColor": "#000000",
        "backgroundColor": "#4472C4",
        "fillPattern": "SOLID_FOREGROUND",
        "borderColor": "#000000",
        "numberFormat": "#,##0.00"
      },
      "dataStyle": {
        "fontName": "Arial",
        "fontSize": 11,
        "fontColor": "#000000",
        "backgroundColor": "#4472C4",
        "fillPattern": "SOLID_FOREGROUND",
        "borderColor": "#000000",
        "numberFormat": "#,##0.00"
      },
      "defaultColumnWidth": 12,
      "defaultRowHeight": 15,
      "pageOrientation": "LANDSCAPE",
      "protectionPassword": "readonly"
    }
  ],
  "password": "secret123"
}

Response

Generated XLSX file

Changes

No recorded changes to this operation across all 1 revision of this API.