Overview
Useanswer with assistant.id when an AI assistant should handle an inbound call from pickup. Telnyx attempts to prepare the assistant before answering, reducing the work left to do after pickup. Use ai_assistant_start to attach an assistant to a call that is already answered, such as after an IVR or human interaction.
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
- A Telnyx account and a Call Control application receiving calls. Follow the Voice API getting started guide if you haven’t set that up.
- An AI assistant. You can create one:
- No-code via the Portal: AI Assistants guide
- Via the API: Create an assistant
id (format: assistant-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
Answer an inbound call with an assistant
For an inbound call that is still unanswered, sendPOST /v2/calls/{call_control_id}/actions/answer with the assistant configuration in the request body:
assistant.id is required within the assistant object. The other fields override the stored assistant for this call. See the Answer call reference for the complete request schema.
The call follows this sequence:
- Telnyx accepts the command and attempts to warm up the assistant configuration and dependencies while the call remains unanswered.
- Telnyx answers the call and emits
call.answered. The HTTP success response can arrive before this webhook. - The assistant starts automatically on the answered call. Do not send a second
ai_assistant_startcommand from thecall.answeredhandler.
Reuse one assistant with per-call settings
A single stored assistant can supply defaults for many businesses or call-by-call experiments. Send each call’s greeting, instructions, tools, voice, and transcription overrides insideassistant; a separate stored assistant per voice or business is not required.
When migrating from ai_assistant_start, use these locations in the answer request:
The two commands use different voice-settings schemas. Select the supported assistant voice options from the Answer call reference rather than copying the start command’s entire
voice_settings object unchanged.
Omitted assistant fields retain stored values. A supplied voice_settings or transcription object replaces that entire stored object: include all settings that the call needs, including provider credentials where applicable. dynamic_variables merge with stored variables, with request values taking precedence. The top-level answer.transcription boolean controls standalone call transcription; it does not configure assistant speech recognition.
Understand and measure the remaining delay
Warm-up moves preparation before answer; it does not guarantee a shorter total time from the incoming call to the greeting. It does not wait for greeting audio to be synthesized or guarantee zero silence after pickup. If warm-up fails, Telnyx answers and starts the assistant without the warmed configuration. Compare the same voice and assistant configuration using the time from actual answer to the first audible greeting. Also track the total time from the incoming call to the greeting so that a later answer is visible in the results. Usecall.answered for the answer event, rather than the HTTP response time, and verify the greeting onset from call audio. A playback-start event alone does not establish that speech was audible; the playback may contain silence.
Start an AI Assistant on an answered call
Send aPOST request to ai_assistant_start with the call_control_id of the active 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. Setsend_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.
Control It From the Assistant Instead
The same setting exists on the assistant itself, astelephony_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 usingai_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. Theconversation_idis returned in the200response ofai_assistant_start.
Example: Dial a new participant and add them to the conversation
Step 1 — Dial the new destination: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 newcall_control_id:
id must be the call_control_id of the call being added. The only supported role is "user".
Optional Participant Fields
Next Steps
- Explore the full AI Assistant API reference
- Configure your assistant in the Portal
- Collect structured data mid-call with Gather using AI