---
title: "Generate Excel"
method: POST
path: "/api/excel/generate"
tags: ["Excel Processing"]
---

# Generate Excel

`POST /api/excel/generate`

Generate Excel file from JSON data using MCP server.

This is the ONLY way to handle JSON to Excel conversions. The workflow is:
1. User's document data is provided as JSON
2. MCP service converts JSON to CSV
3. If template provided, map fields to Excel template
4. Return base64-encoded Excel file for download

Args:
    request: Contains json_data, optional mappings, and optional template_workbook or template_id

Returns:
    GenerateExcelResponse with base64-encoded Excel file

## Request body

- GenerateExcelRequest — Request model for Excel generation
  - `json_data` object, required
  - `mappings` object[], nullable
  - `template_workbook` string, nullable
  - `template_id` string, nullable

## Response `200`

Successful Response

- GenerateExcelResponse — Response model for Excel generation
  - `success` boolean, required
  - `excel` string, required
  - `filename` string, required
  - `error` string, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/qomplement/apis/fastapi.md) · [All operations](https://skmtc.net/qomplement/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/qomplement/fastapi/revisions/718de1c0d866/schema)
