---
title: "Search Documents"
method: POST
path: "/search"
tags: ["rag"]
---

# Search Documents

`POST /search`

## Request

- Base URL: `https://api.agent4.io` (the document declares no server; this is the origin it was published from)
- URL: `https://api.agent4.io/search`
- Auth: none declared

## Request body

- SearchIn
  - `query` string, required
  - `k` integer, nullable

## Response `200`

Successful Response

- SearchHit[]
  - `chunk_id` string, required
  - `document_id` string, required
  - `content` string, nullable, required
  - `distance` number, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/agent4/apis/chatagent-platform.md) · [All operations](https://skmtc.dev/agent4/apis/chatagent-platform/llms.txt) · [OpenAPI document](https://skmtc.dev/agent4/apis/chatagent-platform/revisions/18e58f082ce3?raw)
