Dynamic Call Transfers
Before you start
Prerequisites:
- Access to a server or cloud function that can receive requests from Vapi
Overview
Dynamic call transfers let your assistant transfer calls to different destinations (phone numbers, SIP, or other assistants) based on real-time context. This guide shows you how to set up a custom transfer tool, connect it to your assistant, handle transfer requests with your server, and respond with the right destination or error.
Create a custom transfer tool
Create a transfer tool with an empty destinations
array. This acts as a placeholder so you can define destinations dynamically at runtime.
Link the tool to your assistant
After creating the tool, link it to your assistant. This enables the assistant to trigger the tool during calls.
Configure the server event
In your assistant settings, select the transfer-destination-request
server event. This event sends a webhook to your server whenever a transfer is requested, so you can dynamically determine the destination.
Set up your server to handle transfer requests
Update your assistant’s server URL to point to your server. Your server will receive a webhook with call details whenever a transfer is triggered, and should respond with the appropriate destination or an error.
Conclusion
Dynamic call transfers empower your assistant to route calls efficiently based on real-time data. By implementing this flow, you can ensure seamless interactions and provide a better experience for your users.