---
title: "Search for raw text chunks"
method: POST
path: "/v1/knowledge-models/{knowledge_model_id}/chunks/search"
---

# Search for raw text chunks

`POST /v1/knowledge-models/{knowledge_model_id}/chunks/search`

Returns raw, unprocessed text chunks from the knowledge model based on the embedded query.

## Path parameters

- `knowledge_model_id` string, required

## Request body

- ChunkSearchRequest
  - `query` string, required — The search query
  - `top_k` integer, nullable — Maximum number of chunks to retrieve
  - `included_document_ids` string[], nullable — List of document IDs to include in the search

## Response `200`

Successful Response

- ChunkSearchResponseSchema
  - `results` ChunkSearchResult[], required
    - `id` string, required — ID of the chunk
    - `document_id` string, required — ID of the document
    - `text` string, required — Full, unaltered chunk content
    - `content_type` 'text' | 'json' | 'table' | 'image' | 'transcript' | 'dataframe', required
    - `document_page` integer, required — Page number in the document
    - `chunk_index` integer, required — Index of the chunk in the document
    - `similarity_score` number, required — Similarity score between the query and chunk
  - `total` integer, required — Total count of available records. It can be larger than results count.

## Other responses

- `401` — User token is not present in cookies or has incorrect value.
- `421` — Various errors, see examples
- `422` — Validation Error

---

[API](https://skmtc.dev/constructor-tech/apis/constructorknowledgemodel.md) · [All operations](https://skmtc.dev/constructor-tech/apis/constructorknowledgemodel/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/constructor-tech/constructorknowledgemodel/revisions/989f1fae00de/schema)
