---
title: "Attach a Pipecat bot to a leg"
method: POST
path: "/legs/{id}/agent/pipecat"
tags: ["Legs"]
---

# Attach a Pipecat bot to a leg

`POST /legs/{id}/agent/pipecat`

Bridges audio bidirectionally with a self-hosted Pipecat bot via WebSocket. Standalone legs use direct audio; legs in a room use mixer taps.

## Request body

- PipecatAgentRequest
  - `websocket_url` string, uri, required — WebSocket URL of the Pipecat bot (e.g. ws://my-bot:8765)

## Response `200`

Agent started

- StatusResponse
  - `instance_id` string — Instance identifier
  - `status` string, required

## Other responses

- `400` — Invalid JSON or missing websocket_url
- `404` — Leg not found
- `409` — Leg not connected, agent already attached, or no audio reader/writer

---

[API](https://skmtc.net/voiceblender/apis/voiceblender-api.md) · [All operations](https://skmtc.net/voiceblender/apis/voiceblender-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/voiceblender/voiceblender-api/versions/ad30827d3b57/schema)
