# POST /knowledge-bases/:kb_id/attach

**Resource:** [Knowledge Bases](./knowledge-bases.md)  
**MCP tool:** `attach_knowledge_base`  
**Scopes:** `knowledge:write`  
**Write operation:** yes

Attach a knowledge base to an agent so the agent's searches are grounded in it. agent_type is 'voice' or 'workflow'; agent_id is the voice agent or workflow agent UUID.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `kb_id` | path | string | yes |  |
| `agent_type` | body | string | yes |  |
| `agent_id` | body | string | yes |  |
| `require_approval` | body | boolean | no | Optional. Set true to route this write into the approval queue for human review instead of executing it immediately (returns 202 + an approval_id). Works even when your key/token has permission to execute directly. |

## Request example

```bash
curl -X POST   "https://api.trustpager.com/functions/v1/api/v1/knowledge-bases/:kb_id/attach"   -H "Authorization: Bearer YOUR_API_KEY"   -H "Content-Type: application/json"   -d '{"agent_type":"...","agent_id":"..."}'
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`