https://retellai.com/?utm_source=discord&utm_medium=seo logo
"I am making a server-side API call to transfer an...
# ❓・ai-evy-support
f
@AI Evy "I am making a server-side API call to transfer an active call to a phone number. POST /v2/calls/{call_id}/transfer is returning 404. What is the correct cURL command or API endpoint to warm transfer a call using the latest API?"
a
Thanks for tagging me @fiery_papaya_33507. I'll look through relevant sources and get back to you shortly.
### Answer I don't have information about a direct API endpoint like
POST /v2/calls/{call_id}/transfer
in the available sources for programmatically triggering call transfers. Based on the documentation, call transfers in Retell AI are configured through the agent's setup rather than triggered via a direct API call during an active call [(1) ]() . The transfer functionality is implemented using the
transfer_call
tool within your agent configuration . To set up call transfers: 1. Add the
transfer_call
tool to your agent 2. Configure whether you want a cold transfer or warm transfer 3. For warm transfers specifically, you can configure settings like on-hold music, human detection, whisper messages, and three-way messages 4. Update your agent's prompt to include conditions for when to trigger the transfer (e.g., "If the user is angry or frustrated, use the transfer_call tool to transfer the conversation to a human agent") The LLM then decides when to invoke the transfer based on the conversation context, rather than being triggered by an external API call . If you need to programmatically control transfers during an active call, you might need to explore the LLM WebSocket interface [(2) ]() , though the available documentation doesn't show a specific transfer command in that interface either. Could you provide more context about your use case? I can try to offer a general approach if you'd like, though it wouldn't be based on the official documentation.
​ To learn more, see the sources I considered: [[1] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) [[2] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
a
hellp
whats up
f
@AI Evy If I am using Twilio and I want to use the warm transfer feature from Retell, how do I have to set that up? Also, what happens if I set up the transfer through Twilio itself while using Retell?
a
Thanks for the follow-up, @fiery_papaya_33507. I'll get back to you soon.
The documentation doesn't explicitly address what happens if you configure transfers through Twilio's interface while using Retell. However, since Retell manages the call flow and uses its own transfer mechanisms (including warm transfer features like human detection, whisper messages, and three-way handoffs) , setting up transfers directly in Twilio would likely bypass Retell's warm transfer capabilities [(1) ]() [(3) ]() . For the best experience with Retell's warm transfer features—including automatic human detection, context delivery via whisper messages, and on-hold music—you should configure transfers within Retell AI rather than through Twilio directly [(3) ]() . **
​ To learn more, see the sources I considered: [[1] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) [[2] Set & parse custom SIP headers](https://docs.retellai.com/build/telephony/sip-headers) [[3] Warm Transfer vs Cold Transfer - The AI Advantage in Call Centers | Retell AI](https://www.retellai.com/blog/effortless-handoffs-with-retell-ais-warm-transfer-feature) ​
### Answer To set up warm transfer with Retell AI when using Twilio, you configure it directly within Retell's agent settings, not through Twilio's interface [(1) ]() . ## Setting Up Warm Transfer in Retell AI 1. Add the Transfer Call Tool to your agent by clicking "+ Add" in the tools section and selecting "Transfer Call" . 2. Configure the Transfer Type by choosing "warm transfer" instead of cold transfer . 3. Set the Transfer Number to either a number in e.164 format or a SIP URI (e.g.,
sip:user@retellai.com
) . 4. Configure Warm Transfer Specific Settings : - **On-hold music**: Audio played while the caller waits - **Navigate IVR**: Prompt to help navigate IVR systems at the transfer destination - **Enable human detection**: The agent checks if a human answers before connecting the caller - **Auto-greet**: Agent says "Hello" immediately when transfer target picks up - **Agent detection timeout**: Maximum time to wait for human detection (default 30 seconds) - **Whisper message (optional) **: Private message to the transfer target before connecting the caller - **Three-way message (optional) **: Message spoken to both parties once connected 5. Update Your Agent's Prompt with transfer conditions, such as: "If the user is angry or frustrated, use the transfer_call tool to transfer the conversation to a human agent" . ## Twilio-Specific Considerations Retell Twilio numbers support showing the user's number on both warm and cold transfers . However, for cold transfers using SIP REFER, different telephony providers may handle custom SIP headers differently—Twilio, for example, does not honor custom SIP headers in REFER requests [(2) ]() . ## What Happens If You Set Up Transfer Through Twilio Directly
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
f
@AI Evy Question 1: The Trigger Mechanism "I am building a Voice Agent using a Custom LLM (via WebSocket) and the Node.js SDK. I need to perform a Warm Transfer. Since I control the logic, how do I signal Retell to initiate the warm transfer? Is there a specific REST API endpoint (e.g., /v2/calls/{call_id}/transfer)? Or should I send a specific JSON Event over the WebSocket? Please provide the exact JSON payload or API cURL command for a warm transfer." Question 2: The SDK Error "I tried using retellClient.call.transfer(callId, { transfer_number: '...' }) in the Node.js SDK, but I received a retellClient.call.transfer is not a function error. What is the minimum SDK version required for this method? Is there a different method name (e.g., update or transferCall) I should be using?" Question 3: The BYON Factor "I am using Twilio BYON (Bring Your Own Number) with Retell. Does Retell's Warm Transfer feature (whisper, human detection) work natively with BYON numbers, or do I need to configure specific SIP Headers in my Twilio Trunk?"
a
Thanks for the follow-up, @fiery_papaya_33507. I'll get back to you soon.
### Answer --- ## Question 1: The Trigger Mechanism When using a Custom LLM via WebSocket, you trigger a warm transfer by sending a response event over the WebSocket connection [(1) ]() . The JSON payload should include
transfer_number
in the response event . Here's the exact JSON structure for triggering a transfer via the WebSocket:
Copy code
json
{
  "response_type": "response",
  "response_id": <matching_response_id>,
  "content": "Let me transfer you now.",
  "content_complete": true,
  "transfer_number": "+14155551234"
}
ses SIP DIAL, and Retell sets
from
and
P-Asserted-Identity
headers to the user's number - For cold transfer, it uses SIP REFER, and it's up to the telephony provider to support caller ID override for SIP REFER - Retell Twilio numbers support showing user's number on both warm and cold transfer - If caller ID override is not supported, the transfer would fail Custom SIP Headers: You can add custom SIP headers for outbound calls . These headers are forwarded to your SIP provider on the SIP INVITE and can be used for custom routing, tagging, or metadata . All header names must start with
X-
. Based on community discussions, users have encountered permission issues with Twilio when attempting warm transfers with custom telephony [(4) ]() . The warm transfer feature requires more permissions from Twilio compared to cold transfers . If you encounter issues, you may need to contact Twilio support to enable the necessary permissions for warm transfer functionality . --- **
The
transfer_number
field should be set to either a number in e.164 format or a SIP URI in the format
sip:username@domain
(e.g.,
sip:user@retellai.com
) [(2) ]() . Important: There is no direct REST API endpoint like
/v2/calls/{call_id}/transfer
documented in the available sources for triggering transfers programmatically during an active call. The transfer is triggered through the WebSocket response event when using Custom LLM [(1) ]() . --- ## Question 2: The SDK Error Based on the available SDK documentation, the Node.js SDK examples focus on creating calls using
retellClient.call.createPhoneCall()
[(3) ]() . The documentation does not show a
transfer()
method on the call object . The SDK is primarily used for: - Creating phone calls - Managing agents - Handling webhooks For Custom LLM implementations, call transfers are handled through the WebSocket interface (as described in Question 1) , not through SDK method calls [(1) ]() . If you're looking to trigger transfers programmatically with a Custom LLM, you should use the WebSocket response event with the
transfer_number
field rather than an SDK method . --- ## Question 3: The BYON Factor For Twilio BYON (Bring Your Own Number) setups, there are some important considerations: Caller ID Display: You can configure which caller ID shows up to the transfer destination [(2) ]() : 1. **Retell Agent's number**: The transfer destination will see the Retell agent's number 2. **User's Number**: The transfer destination will see the number of the user Important BYON Limitations: - For warm transfer, it u
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.