---
title: "Index Document"
method: POST
path: "/api/kb/index"
tags: ["Knowledge Base"]
---

# Index Document

`POST /api/kb/index`

Index a document's extracted data into the Knowledge Base.

This is typically called automatically after document processing,
but can be called manually to re-index a document.

Args:
    request: Document data to index

Returns:
    Index result with count of indexed fields

## Request body

- IndexDocumentRequest — Request to index a document's extracted data
  - `batch_id` string, required
  - `document_id` string, required
  - `document_name` string, required
  - `page_number` integer, required
  - `structured_data` object, required

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