Introduction to Transfer Destinations

Transferring calls dynamically based on context is an essential feature for handling user interactions effectively. This guide walks you through creating a custom transfer tool, linking it to your assistant, and handling transfer requests with detailed examples. Whether the destination is a phone number, SIP, or another assistant, you'll learn how to configure it seamlessly.


Step 1: Create a Custom Transfer Tool

To get started, create a transfer tool with an empty destinations array:

curl -X POST <https://api.vapi.ai/tool> \\
     -H "Authorization: Bearer insert-private-key-here" \\
     -H "Content-Type: application/json" \\
     -d '{
  "type": "transferCall",
  "destinations": [],
  "function": {
    "name": "dynamicDestinationTransferCall"
  }
}'

This tool acts as a placeholder, allowing dynamic destinations to be defined at runtime.


Step 2: Link the Tool to Your Assistant

After creating the tool, link it to your assistant. This connection enables the assistant to trigger the tool during calls.


Step 3: Configure the Server Event

Select the transfer-destination-request server event in your assistant settings. This event sends a webhook to your server whenever a transfer is requested, giving you the flexibility to dynamically determine the destination.


Step 4: Set Up Your Server

Ensure your server is ready to handle incoming requests. Update the assistant's server URL to point to your server, which will process transfer requests and respond with the appropriate destination or error.


Step 5: Trigger the Tool and Process Requests

Use the following prompt to trigger the transfer tool: