Mahimai Raja
04/13/2025, 4:54 AMTransfer Call
using call control url
sh
curl -X POST 'https://aws-us-west-2-production1-phone-call-websocket.vapi.ai/7420f27a-30fd-4f49-a995-5549ae7cc00d/control'
-H 'content-type: application/json'
--data-raw '{
"type": "transfer",
"destination": {
"type": "number",
"number": "+1234567890"
},
"content": "Transferring your call now"
}'
docs - https://docs.vapi.ai/calls/call-features
How can I make it warm transfer, and make a custom announcement before transfer?Vapi Support Bot
04/13/2025, 4:56 AMcontent
field (as in your example)
Your example already includes the basic structure for a custom announcement with the content
field:
json
{
"type": "transfer",
"destination": {
"type": "number",
"number": "+1234567890"
},
"content": "Transferring your call now"
}
This will speak the message "Transferring your call now" before transferring the call, which is a simple form of warm transfer. [According to Vapi's documentation](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341701224814219274), the content
field is an "Optional message to say before transfer."
## Using transferPlan
with different modes
For more advanced warm transfer options, you can use the transferPlan
object with different modes:
### Warm Transfer with Message
json
{
"type": "transfer",
"destination": {
"type": "number",
"number": "+1234567890",
"transferPlan": {
"mode": "warm-transfer-with-message",
"message": "Hey, this call has been forwarded through Vapi."
}
}
}
### Warm Transfer with TwiML (for more complex announcements)
json
{
"type": "transfer",
"destination": {
"type": "number",
"number": "+1234567890",
"transferPlan": {
"mode": "warm-transfer-with-twiml",
"twiml": "<Say>Hello, transferring a customer to you.</Say><Pause length=\"2\"/><Say>They called about billing questions.</Say>"
}
}
}
Vapi Support Bot
04/13/2025, 4:56 AMPlay
, Say
, Gather
, Hangup
, and Pause
verbs, with a maximum TwiML length of 4096 characters.
### Wait for Operator to Speak First
If you want the announcement to happen after the operator answers but before connecting the customer:
json
{
"type": "transfer",
"destination": {
"type": "number",
"number": "+1234567890",
"transferPlan": {
"mode": "warm-transfer-wait-for-operator-to-speak-first-and-then-say-message",
"message": "This is a customer calling about their recent order."
}
}
}
Would you like me to explain any of these options in more detail?
Sources:
- [Vapi's call forwarding documentation](https://docs.vapi.ai/call-forwarding)
- [Discord discussion on transfer messages](https://discord.com/channels/1211482211119796234/1211483291191083018/threads/1341701224814219274)
- [Vapi's changelog](https://docs.vapi.ai/changelog/2024/10/13)Shubham Bajaj
04/13/2025, 5:52 AMMahimai Raja
04/13/2025, 6:11 AMeach value in destinations.number must be a valid phone number in the E.164 format. Hot tip, you may be missing the country code (Eg. US: +1)