Skip to main content

Overview

The ai_assistant_start command lets you attach a pre-configured AI assistant to an active call. The assistant takes over the conversation, handles speech recognition, and responds using a voice of your choice — no additional infrastructure required. This is different from Gather using AI, which is purpose-built for collecting structured data. ai_assistant_start is for open-ended, conversational AI experiences.

Prerequisites

Once you have an assistant, note its id (format: assistant-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

Start an AI Assistant on a Call

Send a POST request to ai_assistant_start with the call_control_id of the active call:
That’s it. The assistant is now live on the call.

Webhooks

Once started, the assistant emits the following webhooks:

Stream Message History Updates

By default you only learn what was said once the conversation ends. Set send_message_history_updates to true on ai_assistant_start to receive a call.ai_gather.message_history_updated webhook every time the conversation history changes — useful for live transcripts, agent-assist screens, or supervisor dashboards.
Each webhook carries the full message history so far, not just the new message:

Control It From the Assistant Instead

The same setting exists on the assistant itself, as telephony_settings.send_message_history_updates. When it is set, it overrides whatever the start command asked for, so an assistant can turn the webhooks on for every call it takes — or opt out of them entirely:
Messages exchanged privately with a transfer destination during warm transfer acceptance are never included in these webhooks unless the transfer tool is configured with end_user_target_context_mode: "shared".

Stop the Assistant

To stop the assistant and return control to your application:

Add a Participant to an Existing Conversation

Once an AI assistant conversation is running, you can bring additional call legs into it using ai_assistant_join. For example, you can dial out to a new destination, wait for the person to answer, then add them to the ongoing conversation.

Prerequisites

  • An active AI assistant conversation with a known conversation_id. The conversation_id is returned in the 200 response of ai_assistant_start.

Example: Dial a new participant and add them to the conversation

Step 1 — Dial the new destination:
This returns a new call_control_id for the outbound leg. Step 2 — Wait for the call.answered webhook: When Telnyx sends a call.answered event for the new call leg, extract its call_control_id. Step 3 — Add the participant to the conversation:

Join the Conversation

Once you have the new call_control_id:
The participant’s id must be the call_control_id of the call being added. The only supported role is "user".

Optional Participant Fields

Next Steps