---
title: "Search project context documents"
method: POST
path: "/websiteKnowledge/search"
tags: ["Project Context"]
---

# Search project context documents

`POST /websiteKnowledge/search`

## Request

- Base URL: `https://api.cactal.ai/v1`
- URL: `https://api.cactal.ai/v1/websiteKnowledge/search`
- Auth: HTTP bearer

Find evidence across selected project context documents. Batch independent queries; use passages directly when sufficient. Results merge overlapping text and include source ranges and zero-based queryIndexes into queries. matched reports a hit; truncated means evidence may be omitted, clipped means partial lines, and unavailableResourceIds were not searched. Resolve missing evidence before concluding a fact is absent.

## Request body

- object
  - `websiteId` string, required
  - `resourceIds` string[], required: Selected text resource ids from the project context index, in relevance order.
  - `queries` string[], required: Independent case-insensitive literal terms matched within a line, not questions or regular expressions.
  - `contextLines` integer
  - `maxCharacters` integer: Shared passage character budget across all documents and queries.

## Response `200`

Deduplicated passages, query coverage, and unavailable resource ids.

- object
  - `queries` object[], required
    - `query` string, required
    - `matched` boolean, required
    - `truncated` boolean, required
  - `passages` object[], required
    - `resourceId` string, required
    - `filename` string, required
    - `startLine` integer, required
    - `endLine` integer, required
    - `content` string, required
    - `clipped` boolean, required
    - `queryIndexes` integer[], required
  - `unavailableResourceIds` string[], required

## Other responses

- `400`: Validation failed. The response `message` names the first invalid field.
- `401`: Missing, invalid, expired, or revoked API key.
- `403`: The authenticated principal lacks the required capability.
- `404`: The resource does not exist or is outside the principal’s access scope.
- `429`: Rate limit exceeded. Retry after the number of seconds in the `Retry-After` header.

---

[API](https://skmtc.dev/cactal/apis/cactal-api.md) · [All operations](https://skmtc.dev/cactal/apis/cactal-api/llms.txt) · [OpenAPI document](https://skmtc.dev/cactal/apis/cactal-api/revisions/9cd0fb5eacdd?raw)
