# POST /voice-agent-kbs/:kb_id/attach/:agent_id

**Resource:** [Agent Knowledge Bases](./voice-agent-kbs.md)  
**Scopes:** `voice-kbs:write`  
**Write operation:** yes

Attach a knowledge base to a voice agent conversation flow. Reads the current flow from Retell, adds the KB ID to knowledge_base_ids (deduped), and saves the updated draft. The agent must be published separately for the change to go live. Returns already_attached:true if already linked.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `kb_id` | path | uuid | yes | Knowledge base UUID |
| `agent_id` | path | uuid | yes | Voice agent UUID |

## Request example

```bash
{}
```

## Response example

```json
{"success": true, "already_attached": false, "knowledge_base_ids": ["kb_abc123"]}
```

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