incredible_swan_16923
08/21/2025, 2:23 AMAI Evy
08/21/2025, 2:23 AMAI Evy
08/21/2025, 2:23 AMAI Evy
08/21/2025, 2:23 AMretell_llm_dynamic_variables in the payload [(1) ]() . Here's how the webhook payload structure looks:
json
{
"event": "call_ended",
"call": {
"call_type": "phone_call",
"from_number": "+12137771234",
"to_number": "+12137771235",
"direction": "inbound",
"call_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
"agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"call_status": "registered",
"metadata": {},
"retell_llm_dynamic_variables": {
"customer_name": "John Doe"
},
"start_timestamp": 1714608475945,
"end_timestamp": 1714608491736,
"disconnection_reason": "user_hangup",
"transcript": "...",
"transcript_object": [ [Object], [Object], [Object], [Object] ],
"transcript_with_tool_calls": [ [Object], [Object], [Object], [Object] ],
"opt_out_sensitive_data_storage": false
}
}
For outbound calls specifically, you can pass dynamic variables using the retell_llm_dynamic_variables parameter in the create phone call API [(2) ]() . This allows you to set fixed variables that will then be included in the webhook payload when webhook events are triggered [(1) ]() .
The webhook payload will include these dynamic variables, and if metadata and retell_llm_dynamic_variables are not provided, they will be omitted from the webhook event payload .AI Evy
08/21/2025, 2:23 AMincredible_swan_16923
08/21/2025, 2:24 AMAI Evy
08/21/2025, 2:24 AMAI Evy
08/21/2025, 2:24 AMjson
{
"call_inbound": {
"override_agent_id": "agent_12345",
"override_agent_version": 1,
"dynamic_variables": {
"customer_name": "John Doe"
},
"metadata": {
"random_id": "12345"
}
}
}
The dynamic variables you set in the webhook response will be available throughout the call and can be referenced in your agent's prompt using the {{variable_name}} syntax [(2) ]() . For example, if you set "customer_name": "John Doe", you can reference it in your prompt as {{customer_name}} .
You can also set default values for dynamic variables at the agent level, which will serve as fallbacks when specific variables aren't provided in the webhook response .
All values in dynamic_variables must be strings - numbers, booleans, or other data types are not supported .AI Evy
08/21/2025, 2:24 AMAI Evy
08/21/2025, 2:24 AM