---
title: "Search Knowledge Chunks"
method: POST
path: "/v2/KnowledgeBases/{kbId}/Search"
tags: ["Knowledge"]
---

# Search Knowledge Chunks

`POST /v2/KnowledgeBases/{kbId}/Search`

Perform semantic search across knowledge sources within a knowledge base to find the most relevant content
chunks based on a natural language query.  Returns ranked chunks with similarity scores, allowing you to retrieve
contextually relevant information for AI applications, chatbots, or  information retrieval systems. You can filter
results by specific knowledge sources.

## Request body

- KnowledgeSearch — Request payload for performing semantic search across knowledge sources within the knowledge base.. Allows querying with natural language text and filtering by specific knowledge sources to find the most relevant content chunks.
  - `query` string, required — The query to search the knowledge source.
  - `top` integer, required — The top K results to return.
  - `knowledgeIds` KnowledgeId[] — The list of knowledge IDs to search.

## Response `200`

OK

- object
  - `chunks` KnowledgeChunkResult[]
    - `content` string — The chunk content.
    - `createdAt` string, date-time — The date and time in GMT when the Chunk was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
    - `chunkIndex` integer — 0-based position of this chunk within its source document for a single ingestion run.
    - `documentTitle` string — Human-readable title of the source document. Web: HTML <title> from the crawled page. File: filename from Unstructured metadata. Text: knowledge name from the knowledge source.
    - `documentUrl` string, uri — Specific page URL this chunk was crawled from. Web sources only; null for File and Text sources.
    - `documentNumber` integer — Physical page number (1-based). PDF sources only; omitted for all other source types.
    - `score` number, float — The score associated with the chunk.
    - `knowledgeId` string — The unique identifier of knowledge source.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `429` — This error indicates that you have sent too many requests to the API. You should retry according to the `Retry-After` response header.
- `500` — Internal Server Error
- `503` — Service Unavailable

## Changes

- **2026-08-11** (v2) `59909e2b8833` — 7 breaking, 4 info
  - the `code` response property's max was increased from `99999.00` to `999999.00` for the response status `400`
  - the `code` response property's max was increased from `99999.00` to `999999.00` for the response status `401`
  - the `code` response property's max was increased from `99999.00` to `999999.00` for the response status `403`
  - the `code` response property's max was increased from `99999.00` to `999999.00` for the response status `404`
  - …7 more

[Change history](https://skmtc.dev/twilio/apis/knowledge-v2/changes/v2/KnowledgeBases/:kbId/Search/post.md)

---

[API](https://skmtc.dev/twilio/apis/knowledge-v2.md) · [All operations](https://skmtc.dev/twilio/apis/knowledge-v2/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/twilio/knowledge-v2/revisions/36dc1dbda0b4/schema)
