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

# Detect Mappings Stream

`POST /api/excel/detect-mappings-stream`

Stream Excel column mappings in real-time using Server-Sent Events.

Supports two modes:
1. template_id mode: Columns are fetched from KB (scalable for large templates)
2. workbook mode: Columns are parsed from base64-encoded workbook (fallback)

As each column is filled by the parallel agents, events are sent to the client.

## Request body

- DetectMappingsStreamRequest — Request model for streaming mapping detection - uses IDs, not raw data
  - `template_id` string, nullable
  - `workbook` string, nullable
  - `document_ids` string[], nullable
  - `documents` ExcelRoutesDocumentData[], nullable
    - `id` string, required
    - `name` string, required
    - `extracted_data` object, nullable
  - `field_data` object
  - `fill_mode` string, nullable
  - `retry_columns` string[], nullable
  - `retry_context` object, nullable
  - `schema_fields` string[], nullable
  - `schema_field_definitions` object[], nullable

## Response `200`

Successful Response

- unknown

## 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)
