Dynamic call transfers
Route calls to different destinations based on real-time conversation context and external data.
Overview
Dynamic call transfers enable intelligent routing by determining transfer destinations in real-time based on conversation context, customer data, or external system information. Unlike static transfers with predefined destinations, dynamic transfers make routing decisions on-the-fly during the call.
Key capabilities:
- Real-time destination selection based on conversation analysis
- Integration with CRM systems, databases, and external APIs
- Conditional routing logic for departments, specialists, or geographic regions
- Context-aware transfers with conversation summaries
- Custom business logic execution before completing the transfer
- Programmatic transfer control via Vapi’s Call Control API
Prerequisites
- A Vapi account
- A server or cloud function that can receive webhooks from Vapi
- (Optional) CRM system or customer database for enhanced routing logic
How It Works
Dynamic transfers with live call control use a server-controlled pattern that gives you maximum flexibility:
- User initiates transfer: The user requests a transfer in natural language during the conversation
- Vapi triggers custom tool: Vapi fires your custom tool to your HTTP server
- Server receives control URL: The tool payload includes
message.call.monitor.controlUrlfor live call control - Execute business logic: Your server performs any necessary operations:
- Update CRM records with call summaries
- Extract and store conversation data
- Query databases for routing decisions
- Enrich destination systems with context
- Complete transfer: Your server makes a POST request to the
controlUrlwith the transfer destination - Call connected: Vapi transfers the call to the specified SIP or PSTN destination
Available context: Your server receives the full conversation transcript, custom parameters, call metadata, and the control URL, allowing you to make informed routing decisions and execute the transfer programmatically.
Parameters for custom tools are fully customizable. You can name and structure them however you like to guide routing (for example department, reason, urgency, customerId, etc.).
Sequence diagram
Quick Implementation Guide
Create a custom tool for dynamic transfers
Create a custom tool that will receive the transfer request and provide you with the control URL to execute the transfer.
Dashboard
TypeScript (Server SDK)
Python (Server SDK)
cURL
- Navigate to Tools in your dashboard
- Click Create Tool
- Select Custom as the tool type
- Set function name:
transfer_call - Add a description: “Transfer the call to the appropriate department or agent”
- Define custom parameters based on your routing needs (e.g.,
department,reason,urgency,customerId) - Set your server URL to receive the tool call
Create an assistant with the transfer tool
Dashboard
TypeScript (Server SDK)
Python (Server SDK)
cURL
- Navigate to Assistants
- Create a new assistant or edit an existing one
- Add your custom transfer tool to the assistant
- Configure the system prompt to guide when transfers should occur
Build your webhook server with Live Call Control
Your server will receive the tool call with message.call.monitor.controlUrl and use it to execute the transfer via Live Call Control.
Node.js (Express)
Python (FastAPI)
SIP transfers: To transfer to a SIP endpoint, use "type": "sip" with "sipUri" instead:
Test your dynamic transfer system
Dashboard
TypeScript (Testing)
Python (Testing)
- Create a phone number and assign your assistant
- Call the number and request a transfer to different departments
- Monitor your webhook server logs to see the tool calls and control URL
- Verify transfers are executing to the correct destinations
Assistant-based routing
Route customers to appropriate support tiers based on conversation analysis and customer data
Squad-based routing
Direct tenant calls to the right department with automated verification
Routing Patterns
Common Use Cases
-
Customer support routing - Route based on issue type, customer tier, agent availability, and interaction history. Enterprise customers and critical issues get priority routing to specialized teams.
-
Geographic routing - Direct calls to regional offices based on customer location and business hours. Automatically handle time zone differences and language preferences.
-
Load balancing - Distribute calls across available agents to optimize wait times and agent utilization. Route to the least busy qualified agent.
-
Escalation management - Implement intelligent escalation based on conversation tone, issue complexity, and customer history. Automatically route urgent issues to senior agents.
Transfer Configuration
-
Warm transfers provide context to receiving agents with AI-generated conversation summaries, ensuring smooth handoffs with full context.
-
Cold transfers route calls immediately with predefined context messages, useful for simple departmental routing.
-
Conditional transfers apply different transfer modes based on routing decisions, such as priority handling for enterprise customers.
-
Destination types include phone numbers for human agents, SIP endpoints for VoIP systems, and Vapi assistants for specialized AI agents.
Security considerations: Always verify webhook signatures to ensure requests come from Vapi. Never log sensitive customer data, implement proper access controls, and follow privacy regulations like GDPR and CCPA when handling customer information in routing decisions.
Troubleshooting
- Tool call not received: Verify your server URL is correctly configured in the custom tool and is publicly accessible. Check your server logs for incoming requests.
- Transfer not executing: Make sure that you are sending a valid destination object (type number or sip). See API reference here.
- Invalid destination format: For phone numbers, use
"type": "number"with E.164 format. For SIP, use"type": "sip"with a valid SIP URI. - Transfer fails silently: Check your server logs for errors in the axios/httpx request.
Related Documentation
- Call Forwarding - Static transfer options and transfer plans
- Webhooks - Webhook security and event handling patterns
- Custom Tools - Build custom tools for advanced routing logic