---
title: "Search Knowledge Base"
method: POST
path: "/v1/knowledge-bases/{knowledge_base_id}/search"
tags: ["Knowledge bases"]
---

# Search Knowledge Base

`POST /v1/knowledge-bases/{knowledge_base_id}/search`

Search a knowledge base and return matching snippets or pages.

## Path parameters

- `knowledge_base_id` string, uuid, required — Unique knowledge base ID.

## Query parameters

- `organization_id` string, uuid, nullable — Organization scope for API keys that can access multiple organizations.

## Request body

- SearchKnowledgeBaseRequest
  - `query` string, required — Search query.
  - `top_k` integer, required — Maximum number of results to return.
  - `return_full_page` boolean — Return full page content instead of snippets.
  - `filters` SearchKnowledgeBaseFilters
    - `tags` string[], nullable — Optional tags to match. Documents with any matching tag are included.
    - `folders` string[], nullable — Optional folder paths to search within. Currently limited to one folder.

## Response `200`

Successful Response

- KnowledgeBaseSearchResponse
  - `data` KnowledgeBaseSearchResult[], required — Knowledge base search results.
    - `id` string, required — Document or chunk path.
    - `score` number, required — Relevance score.
    - `metadata` object, required — Result metadata, including folder path.
    - `content` string, required — Matched content.
  - `pagination` CursorPagination — Cursor-based pagination metadata.
    - `limit` integer — Maximum number of results to return. Default is 10,000, maximum is 50,000.
    - `next_cursor` string, nullable — Token for the next page, if more results are available.

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/cooper-square-technologies/apis/external-api.md) · [All operations](https://skmtc.net/cooper-square-technologies/apis/external-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cooper-square-technologies/external-api/revisions/ab03b3c80494/schema)
