---
title: "Fill an Excel template with data"
method: POST
path: "/api/excel/fill-template"
tags: ["Excel"]
---

# Fill an Excel template with data

`POST /api/excel/fill-template`

## Request

- Base URL: `https://api.dokmatiq.com`
- URL: `https://api.dokmatiq.com/api/excel/fill-template`
- Auth: API key in header `X-API-Key`

Upload a Base64-encoded Excel template and fill named cells, ranges, and tables with provided values. Formulas are recalculated automatically.

## Request body

- ExcelTemplateRequest: Request to fill an Excel template with data. Named cells and ranges in the template are populated with provided values.
  - `templateBase64` string, required: Base64-encoded Excel template file
  - `values` object: Cell values to set (key = cell reference like 'Sheet1!A1' or named range, value = content)
  - `tables` object: Table data to insert at named ranges (key = range name, value = row data)
  - `recalculate` boolean: Recalculate all formulas after filling
  - `password` string: Password to protect the filled workbook

## Response `200`

Filled XLSX file

## Other responses

- `400`: Invalid request

---

[API](https://skmtc.dev/dokmatiq/apis/docgen-api.md) · [All operations](https://skmtc.dev/dokmatiq/apis/docgen-api/llms.txt) · [OpenAPI document](https://skmtc.dev/dokmatiq/apis/docgen-api/revisions/3fa1a922764d?raw)
