> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pathors.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Query Chunks

> Semantic search over a knowledgebase

## Request

```bash theme={null}
GET https://api.pathors.com/v1/projects/{projectId}/knowledgebases/{knowledgebaseId}/query
```

### Path Parameters

<ParamField path="projectId" type="string" required>The project ID</ParamField>
<ParamField path="knowledgebaseId" type="string" required>The knowledgebase ID to query</ParamField>

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token using your developer key
</ParamField>

### Query Parameters

<ParamField query="q" type="string" required>The search query</ParamField>
<ParamField query="topK" type="number">Maximum number of results to return. Defaults to `5`.</ParamField>
<ParamField query="scoreThreshold" type="number">Minimum relevance score (0–1) for chunks to be included. Defaults to `0.3`.</ParamField>

## Response

Returns an array of chunks ordered by relevance.

<ResponseField name="id" type="string">Unique identifier for the chunk</ResponseField>
<ResponseField name="content" type="string">Chunk text content</ResponseField>
<ResponseField name="contentLength" type="number">Length of the chunk content in characters</ResponseField>
<ResponseField name="isEnabled" type="boolean">Whether the chunk participates in search</ResponseField>

### Example

```bash theme={null}
curl "https://api.pathors.com/v1/projects/{projectId}/knowledgebases/kb_abc123/query?q=search_term&topK=5&scoreThreshold=0.3" \
  -H "Authorization: Bearer dk_your_key"
```

```json theme={null}
[
  {
    "id": "chunk_abc123",
    "content": "The product features include real-time analytics...",
    "contentLength": 82,
    "isEnabled": true
  }
]
```
