dd_131313
08/08/2025, 12:46 AMAI Evy
08/08/2025, 12:46 AMAI Evy
08/08/2025, 12:47 AMretell_llm_dynamic_variables field .
Here's the proper format based on the documentation:
json
{
"retell_llm_dynamic_variables": {
"user_name": "John Smith",
"product_name": "Premium Plan",
"account_status": "active"
}
}
Important notes:
- All values in retell_llm_dynamic_variables must be strings
- Numbers, booleans, or other data types are not supported
- The webhook should return a successful status code (2xx) [(3) ]()
If you're still having issues, check that:
1. Your webhook is configured at the phone number level (not agent level) [(1) ]()
2. Your response returns a 200 status code
3. All dynamic variable values are strings [(2) ]()
Could you share the specific JSON structure you're returning so I can help identify any formatting issues?AI Evy
08/08/2025, 12:47 AMAI Evy
08/08/2025, 12:47 AMdd_131313
08/08/2025, 12:49 AMdd_131313
08/08/2025, 12:49 AMAI Evy
08/08/2025, 12:49 AMAI Evy
08/08/2025, 12:49 AMretell_llm_dynamic_variables field . Your current structure is nested too deeply and uses the wrong field names.
Here's the correct format based on the documentation:
json
{
"retell_llm_dynamic_variables": {
"patient_found": "true",
"patient_name": "Patient Name",
"patient_id": "9676525491",
"verification_ready": "true",
"clinic_found": "true",
"clinic_name": "Clinic Name",
"clinic_provider": "Dr. Name",
"clinic_address": "Address",
"clinic_hours": "Monday to Friday: 9am to 5pm",
"clinic_id": "9701380486",
"lookup_completed": "true"
}
}
The key changes needed:
1. Remove the outer status, headers, and body wrapper
2. Replace call_inbound.dynamic_variables with retell_llm_dynamic_variables
3. All values must be strings (which you already have correct)
This matches the expected format shown in the documentation for inbound call webhooks . The error in the Discord thread you saw earlier shows exactly this issue - when the webhook response doesn't include the call_inbound field in the expected format, it causes dynamic variables to not work properly [(2) ]() .AI Evy
08/08/2025, 12:49 AMAI Evy
08/08/2025, 12:49 AMdd_131313
08/08/2025, 12:54 AMAI Evy
08/08/2025, 12:54 AMAI Evy
08/08/2025, 12:54 AMretell_llm_dynamic_variables is not just for outbound calls [(1) ]() . According to the documentation, you can use dynamic variables for both inbound and outbound calls .
For outbound calls, you set the variables in the Create Phone Call API using the retell_llm_dynamic_variables field :
json
{
"user_name": "John Smith",
"product_name": "Premium Plan",
"account_status": "active"
}
For inbound calls, you supply dynamic variables in the Inbound Call Webhook using the same retell_llm_dynamic_variables field . The documentation specifically states: "You can supply dynamic variables in the Inbound Call Webhook" .
So your corrected JSON structure should be:
json
{
"retell_llm_dynamic_variables": {
"patient_found": "true",
"patient_name": "Patient Name",
"patient_id": "9676525491",
"verification_ready": "true",
"clinic_found": "true",
"clinic_name": "Clinic Name",
"clinic_provider": "Dr. Name",
"clinic_address": "Address",
"clinic_hours": "Monday to Friday: 9am to 5pm",
"clinic_id": "9701380486",
"lookup_completed": "true"
}
}
The key point is that retell_llm_dynamic_variables is the standard field name for dynamic variables in both inbound and outbound scenarios .AI Evy
08/08/2025, 12:54 AMAI Evy
08/08/2025, 12:54 AMdd_131313
08/08/2025, 1:05 AMAI Evy
08/08/2025, 1:05 AMAI Evy
08/08/2025, 1:05 AMcall_inbound :
json
{
"call_inbound": {
"dynamic_variables": {
"customer_name": "John Doe"
},
"metadata": {
"random_id": "12345"
}
}
}
Your corrected response should be:
json
{
"call_inbound": {
"dynamic_variables": {
"patient_found": "true",
"patient_name": "Patient NAme",
"patient_id": "9676525491",
"verification_ready": "true",
"clinic_found": "true",
"clinic_name": "Clinic NAme",
"clinic_provider": "Dr. Name",
"clinic_address": "Address",
"clinic_hours": "Monday to Friday: 9am to 5pm",
"clinic_id": "9701380486",
"lookup_completed": "true",
"call_id": "call_d7361c41e043bc0ecc896ebebd2"
}
}
}
The key differences:
1. Remove the outer status, headers, and body wrapper
2. Use call_inbound.dynamic_variables instead of retell_llm_dynamic_variables
3. The webhook expects a JSON response with a successful status code (2xx)
The retell_llm_dynamic_variables field is used when creating outbound calls via the API, but for inbound call webhooks, you need to use the call_inbound.dynamic_variables structure .AI Evy
08/08/2025, 1:05 AMAI Evy
08/08/2025, 1:05 AMdd_131313
08/08/2025, 1:06 AMAI Evy
08/08/2025, 1:06 AMAI Evy
08/08/2025, 1:06 AMjson
{
"call_inbound": {
"dynamic_variables": {
"caller_name": " "
}
}
}
Your original structure with call_inbound.dynamic_variables appears to be correct based on this community feedback . I should not have suggested switching to retell_llm_dynamic_variables for inbound webhooks.
The retell_llm_dynamic_variables field is specifically documented for outbound calls when using the Create Phone Call API [(3) ]() :
json
{
"user_name": "John Smith",
"product_name": "Premium Plan",
"account_status": "active"
}
I apologize for the conflicting guidance. Your original approach with the call_inbound.dynamic_variables structure should be the correct format for inbound call webhooks.AI Evy
08/08/2025, 1:06 AMAI Evy
08/08/2025, 1:06 AMdd_131313
08/08/2025, 1:07 AMdd_131313
08/08/2025, 1:07 AMAI Evy
08/08/2025, 1:07 AMAI Evy
08/08/2025, 1:08 AMjson
{
"call_inbound": {
"override_agent_id": "agent_12345",
"override_agent_version": 1,
"dynamic_variables": {
"customer_name": "John Doe"
},
"metadata": {
"random_id": "12345"
}
}
}
So your JSON should be structured like this :
json
{
"call_inbound": {
"dynamic_variables": {
"patient_found": "true",
"patient_name": "Patient Name",
"patient_id": "9676525491",
"verification_ready": "true",
"clinic_found": "true",
"clinic_name": "Clinic Name",
"clinic_provider": "Dr. Name",
"clinic_address": "Address",
"clinic_hours": "Monday to Friday: 9am to 5pm",
"clinic_id": "9701380486",
"lookup_completed": "true",
"call_id": "call_d7361c41e043bc0ecc896ebebd2"
}
}
}
The documentation clearly states that the webhook expects a JSON response with fields grouped under call_inbound, and dynamic_variables is one of the allowed fields . The webhook has a timeout of 10 seconds and expects a successful status code (2xx) .
If this structure isn't working, there might be an issue with your webhook configuration or the webhook URL itself. Make sure the webhook is properly configured at the phone number level .AI Evy
08/08/2025, 1:08 AMAI Evy
08/08/2025, 1:08 AMdd_131313
08/08/2025, 1:14 AMAI Evy
08/08/2025, 1:14 AMAI Evy
08/08/2025, 1:14 AMpublic_log_url that contains details about all the requests and responses received, including webhook interactions .
You can access this information through:
1. Get Call API - Use the call ID call_b9e07fee92a8a34aa665c3a8383 to retrieve call details [(3) ]() :
- The response will include a public_log_url field
- Example: `"
2. List Calls API - Filter by the specific call ID to get the same information [(2) ]()
3. Retell Dashboard - The call history should show the public log URL for that call
The public log contains details about all webhook requests and responses, latency tracking for each turn-taking, and is helpful for debugging and tracing [(1) ]() [(2) ]() [(3) ]() [(4) ]() [(5) ]() . This will show you exactly what webhook response Retell received from your endpoint for the call_started event, which should help you debug why your dynamic variables aren't working properly.AI Evy
08/08/2025, 1:14 AMAI Evy
08/08/2025, 1:14 AMdd_131313
08/08/2025, 1:20 AMAI Evy
08/08/2025, 1:20 AMAI Evy
08/08/2025, 1:20 AMcollected_dynamic_variables field is different from the dynamic variables you send in your webhook response [(1) ]() [(2) ]() [(3) ]() . The collected_dynamic_variables field contains dynamic variables that were collected during the call, not the ones you initially provided .
From the documentation, collected_dynamic_variables are "Dynamic variables collected from the call. Only available after the call ends" . This means they contain variables that the agent extracted or collected during the conversation, not the initial variables you passed in through your webhook.
The dynamic variables you're sending via call_inbound.dynamic_variables should appear in the retell_llm_dynamic_variables field of the call object instead [(4) ]() [(1) ]() [(2) ]() . This field shows the dynamic variables that were injected into your Response Engine prompt and tool description .
To troubleshoot why your variables aren't working:
1. Check the retell_llm_dynamic_variables field in the call object to see if your variables were received [(1) ]() [(2) ]()
2. Verify your prompt references the variables exactly as they appear (case-sensitive) [(5) ]()
3. Ensure all values in your webhook response are strings [(6) ]()
4. Check the public log URL for detailed webhook request/response information [(1) ](AI Evy
08/08/2025, 1:20 AMAI Evy
08/08/2025, 1:20 AMdd_131313
08/08/2025, 1:21 AMdd_131313
08/08/2025, 1:21 AMAI Evy
08/08/2025, 1:21 AMAI Evy
08/08/2025, 1:21 AMretell_llm_dynamic_variables field is only showing the default Twilio headers, not your custom variables from the webhook. This indicates your webhook response isn't being processed correctly [(1) ]() .
Based on the documentation, for inbound calls you can supply dynamic variables in the Inbound Call Webhook . However, looking at the sources available, I don't have the specific webhook response format for the inbound call webhook documented.
From what I can see in the thread history and your testing, it appears your call_inbound.dynamic_variables structure isn't being recognized properly. The fact that only the Twilio system variables are appearing in retell_llm_dynamic_variables suggests the webhook response format may be incorrect.
A few things to check:
1. **Webhook Configuration**: Ensure your webhook is configured at the phone number level in the Retell dashboard
2. **Response Format**: Your webhook should return a successful HTTP status code (200) with proper JSON
3. **All Values Must Be Strings**: The documentation states that all values in dynamic variables must be strings
Since I don't have access to the complete inbound webhook documentation format in my sources, I'd recommend:
Check out these potentially useful sources: [Dynamic Variables]() , [Get Call]() , [List Calls]()
Would you like me to try to provide a general answer based on my knowledge of how webhook responses typically work, or would you prefer to check the public log URL from your call to see exactly what Retell received from your webhook?AI Evy
08/08/2025, 1:21 AMAI Evy
08/08/2025, 1:21 AMdd_131313
08/08/2025, 1:23 AMAI Evy
08/08/2025, 1:23 AMAI Evy
08/08/2025, 1:23 AMcall_started, call_ended, and call_analyzed [(3) ]() [(4) ]() [(5) ]() . These webhooks receive call events but don't allow you to set dynamic variables for inbound calls [(6) ]() .
To fix your setup:
1. Move your webhook from the agent level to the phone number level in the Retell dashboard
2. Keep using the call_inbound.dynamic_variables structure as documented [(1) ]() :
json
{
"call_inbound": {
"dynamic_variables": {
"customer_name": "John Doe"
},
"metadata": {
"random_id": "12345"
}
}
}AI Evy
08/08/2025, 1:23 AMAI Evy
08/08/2025, 1:23 AM