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

# Knowledge Base API

> Upload and manage knowledge sources for RAG pipelines.

# Knowledge Base API

Base path: `/api/v1/knowledge` · Requires `Authorization: Bearer <jwt>`

## GET /api/v1/knowledge

Returns all knowledge sources for the authenticated user.

## POST /api/v1/knowledge

Rate limit: 5 req/min

```http theme={null}
Content-Type: multipart/form-data
file: <binary>  # .pdf or .txt, max 50MB
name: "Refund Policy"
type: "pdf"     # pdf | txt | url
```

**Response 202:** `{ "id": "uuid", "status": "processing", "message": "File received. Chunking and embedding in progress." }`

Poll `GET /api/v1/knowledge/:id` every 3 seconds until `status === "ready"`.

## GET /api/v1/knowledge/:id

```json theme={null}
{
  "id": "uuid", "name": "Refund Policy PDF", "type": "pdf",
  "status": "ready", "chunk_count": 42,
  "chunks": [{ "id": "uuid", "content": "...", "chunk_index": 0, "token_count": 64 }]
}
```

## DELETE /api/v1/knowledge/:id

> [!WARNING]
>
> Deletes the source and all associated chunks from pgvector. Irreversible.

**Response 200:** `{ "success": true, "message": "Knowledge source and chunks deleted" }`


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.