https://retellai.com/?utm_source=discord&utm_medium=seo logo
How does the transfer started webhook work
# ❓・ai-evy-support
k
@AI Evy How does the transfer started webhook work. What is the exact format of the body that will be recieved
a
Thanks for tagging me @katlovetom. I'll look through relevant sources and get back to you shortly.
### Answer The
transfer_started
webhook is triggered when a transfer is initiated [(1) ]() . The webhook will POST the payload to your endpoint with a 10-second timeout . The exact format includes the following structure :
Copy code
json
{
  "event": "transfer_started",
  "call": {
    "call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6"
  },
  "transfer_destination": {
    "number": "+12137771235",
    "extension": "1234"
  },
  "transfer_option": {
    "type": "warm_transfer",
    "showTransfereeAsCaller": true,
    "publicHandoffOption": {
      "type": "static_message",
      "message": "Hi, I am transferring the caller now."
    },
    "agentDetectionTimeoutMs": 15000,
    "onHoldMusic": {
      "type": "default"
    },
    "enableBridgeAudioCue": true
  }
}
The payload includes full call data plus
transfer_destination
and
transfer_option
(if available) . Fields may vary by transfer type . To enable this webhook event for your agent, include
transfer_started
in the
webhook_events
field when creating or updating an agent [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Update Voice Agent](https://docs.retellai.com/api-references/update-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
k
@AI Evy would the transfer started JSON include the call transcript of the call until that point, or could it include specific details gathered during the call
a
Thanks for the follow-up, @katlovetom. I'll get back to you soon.
### Answer Based on the available sources, the
transfer_started
webhook payload includes "Full call data plus
transfer_destination
and
transfer_option
(if available) " [(1) ]() . This means it should include the transcript up to that point. Looking at the call object structure in the sources, when full call data is included, it contains fields like
transcript
,
transcript_object
, and
transcript_with_tool_calls
[(2) ]() [(3) ]() [(4) ]() . The
transcript_with_tool_calls
field specifically "precisely captures when (at what utterance, which word) the tool was invoked and what was the result" [(2) ]() . Additionally, if you're using
retell_llm_dynamic_variables
to collect information during the call, those would be included in the call object [(2) ]() [(3) ]() [(4) ]() . The call object can also contain
collected_dynamic_variables
which stores "Dynamic variables collected from the call" . So yes, the
transfer_started
webhook should include both the transcript up to that point and any specific details gathered during the call through dynamic variables or metadata [(1) ]() [(2) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
​ To learn more, see the sources I considered: [[1] Webhook Overview](https://docs.retellai.com/features/webhook-overview) [[2] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) [[3] Update Call](https://docs.retellai.com/api-references/update-call) [[4] List Calls](https://docs.retellai.com/api-references/list-calls) ​
k
@AI Evy If I use a tool call with my first agent to lookup customer data and then do an agent transfer, would the next agent also be able to see the callers data from the tool_call response (from previous agent)
a
Thanks for the follow-up, @katlovetom. I'll get back to you soon.
### Answer Based on the available sources, tool call results from the first agent are not automatically passed to the transferred agent [(1) ]() . The
transcript_with_tool_calls
field captures tool invocations and results from the first agent [(2) ]() , but to make this data available to the second agent, you need to explicitly pass it as dynamic variables [(1) ]() . One approach mentioned in the community is to store the customer data retrieved from the tool call in a database, then use an inbound webhook to retrieve it when the second agent receives the call . This allows you to inject the data as
dynamic_variables
for the receiving agent [(1) ]() [(3) ]() . For inbound webhooks specifically, the response structure should nest dynamic variables under
call_inbound
[(3) ]() :
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "customer_name": "John Doe",
      "customer_email": "john@example.com"
    }
  }
}
Alternatively, when initiating the transfer via a custom function, you could pass the customer data as custom dynamic variables in the transfer function arguments, though you'd need to configure the receiving agent to accept those variables [(1) ]() . The key point: tool call responses don't automatically carry over—you must explicitly bridge the data between agents using dynamic variables or webhooks [(1) ]() [(3) ]() .
​ To learn more, see the sources I considered: [[1] {{user_number}} - system dynamic value is not working after chat transferred another agent](https://community.retellai.com/t/user-number-system-dynamic-value-is-not-working-after-chat-transferred-another-agent/730) [[2] List Calls](https://docs.retellai.com/api-references/list-calls) [[3] Inbound webhook returns retell_llm_dynamic_variables but agent doesn't receive them](https://community.retellai.com/t/inbound-webhook-returns-retell-llm-dynamic-variables-but-agent-doesnt-receive-them/733) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
k
@AI Evy How do I set up the extract key values in my tool call. If my webhook returns JSON like this { "caller_name":"John", "address":"main street" }
a
Thanks for the follow-up, @katlovetom. I'll get back to you soon.
### Answer To extract values from your custom function's JSON response, you need to configure response variables in your custom function setup [(1) ]() . Here's how to set it up: ## Steps to Extract Response Variables 1. In your custom function configuration, scroll to the "Set response variables" section 2. Click to add response variables and specify the JSON path to extract each value 3. For your JSON response structure:
Copy code
json
{
  "caller_name": "John",
  "address": "main street"
}
You would configure: - **Variable Name**:
caller_name
- **JSON Path**:
caller_name
(or
$.caller_name
depending on the path format) - **Variable Name**:
address
- **JSON Path**:
address
(or
$.address
) ## Using the Extracted Variables Once extracted, these values become dynamic variables that you can reference later in the conversation using double curly braces : -
{{caller_name}}
-
{{address}}
The response variables feature allows you to "extract values from the API response and save them as dynamic variables for use later in the conversation" . For example, you could then use
{{caller_name}}
in subsequent prompts or pass it to other custom functions .
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
k
@AI Evy How do I make sure that dynamic variables get passed from one agent to another using the Agent transfer within retell. I am using a tool and trying to store the respond, and I want the next agent to have access to the info from the tool call as well
a
Thanks for the follow-up, @katlovetom. I'll get back to you soon.
### Answer Based on the available sources, dynamic variables and tool call data do not automatically transfer between agents during an agent transfer [(1) ]() . You need to explicitly pass this information using one of these approaches: ## Option 1: Use Inbound Webhook (Recommended) When the transfer occurs, set up an inbound webhook on the receiving agent's phone number to inject the dynamic variables [(2) ]() [(3) ]() : 1. Store your tool call response data (caller_name, address, etc.) in a database or external system 2. Configure an inbound webhook on the phone number 3. When the webhook fires, return the data in this format :
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "caller_name": "John",
      "address": "main street"
    }
  }
}
The key is nesting dynamic variables under
call_inbound
, not at the top level [(3) ]() . ## Option 2: Extract and Store During the Call Use the Extract Dynamic Variable feature to capture tool call responses as dynamic variables during the conversation [(4) ]() : 1. After your custom function returns the JSON response, extract the values as response variables 2. These become dynamic variables like
{{caller_name}}
and
{{address}}
[(5) ]() 3. However, you'll still need to pass these to the next agent using the inbound webhook approach above ## Important Notes - The
retell_llm_dynamic_variables
field is used when creating outbound calls [(5) ]() [(6) ]() , not for agent transfers - For inbound scenarios (including transfers) , you must use
call_inbound.dynamic_variables
format [(2) ]() [(3) ]() - Ensure the receiving agent has these dynamic variables defined in its configuration [(5) ]() The sources confirm that tool call data doesn't automatically carry over—you must explicitly bridge it between agents using webhooks and dynamic variables [(1) ]() .
​ To learn more, see the sources I considered: [[1] Discord message from @preetvadaliya on 2025-09-16](https://discord.com/channels/1186424376300679209/1186462578310910112/1417422411950850159) [[2] Inbound webhook](https://docs.retellai.com/features/inbound-call-webhook) [[3] Inbound webhook returns retell_llm_dynamic_variables but agent doesn't receive them](https://community.retellai.com/t/inbound-webhook-returns-retell-llm-dynamic-variables-but-agent-doesnt-receive-them/733) [[4] Platform Changelogs | Retell AI](https://www.retellai.com/changelog) [[5] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[6] Register Phone Call](https://docs.retellai.com/api-references/register-phone-call) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.