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

# Index Document

`POST /api/kb/index`

## Request

- Base URL: `https://api.qomplement.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.qomplement.com/api/kb/index`
- Auth: HTTP bearer

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.dev/qomplement/apis/qomplement-api.md) - [All operations](https://skmtc.dev/qomplement/apis/qomplement-api/llms.txt) - [OpenAPI document](https://skmtc.dev/qomplement/apis/qomplement-api/revisions/6fe617c112ef?raw)
