---
title: "Detect Mappings"
method: POST
path: "/api/excel/detect-mappings"
tags: ["Excel Processing"]
---

# Detect Mappings

`POST /api/excel/detect-mappings`

Intelligently detect the best cell mappings for fields in an Excel template.

Uses OpenAI to analyze the Excel structure and suggest optimal cell placements
for each field based on existing labels and template structure.

Args:
    request: Contains base64-encoded workbook and list of fields to map

Returns:
    DetectMappingsResponse with suggested field-to-cell mappings

## Request body

- ExcelRoutesDetectMappingsRequest — Request model for mapping detection
  - `workbook` string, required
  - `fields` string[], required
  - `field_data` object

## Response `200`

Successful Response

- ExcelRoutesDetectMappingsResponse — Response model for mapping detection
  - `mappings` FieldMapping[], required
    - `field` string, required
    - `cell` string, required
    - `sheet` string, required
    - `value` string, nullable
    - `type` string

## 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/versions/718de1c0d866/schema)
