---
title: "Attach an ElevenLabs ConvAI agent to a leg"
method: POST
path: "/legs/{id}/agent/elevenlabs"
tags: ["Legs"]
---

# Attach an ElevenLabs ConvAI agent to a leg

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

Bridges audio bidirectionally with an ElevenLabs conversational AI agent. Standalone legs use direct audio; legs in a room use mixer taps.

## Request body

- ElevenLabsAgentRequest
  - `agent_id` string, required — ElevenLabs agent ID
  - `first_message` string — Override the agent's first message
  - `language` string — Language code (e.g. "en", "es")
  - `dynamic_variables` object — Key-value pairs passed to the agent as dynamic variables
  - `api_key` string — API key override (falls back to ELEVENLABS_API_KEY env var)

## Response `200`

Agent started

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

## Other responses

- `400` — Invalid JSON or missing agent_id
- `404` — Leg not found
- `409` — Leg not connected, agent already attached, or no audio reader/writer
- `503` — No ElevenLabs API key provided

---

[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/revisions/c951ca5dcd08/schema)
