https://retellai.com/?utm_source=discord&utm_medium=seo logo
<@1145576664366055464> how to structure inbound ca...
# ❓・ai-evy-support
e
@AI Evy how to structure inbound call webhook response for only one dynamic variable
a
Thanks for tagging me @emanuelkr. I'll look through relevant sources and get back to you shortly.
### Answer To structure an inbound call webhook response with a single dynamic variable, you need to return a JSON response with the
call_inbound
object containing the
dynamic_variables
field [(1) ]() . Here's the structure for one dynamic variable:
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
        "customer_name": "John Doe"
    }
  }
}
The key points for the response structure : - Use a successful status code (2xx) - Group fields under
call_inbound
- Place your dynamic variable inside the
dynamic_variables
object - All dynamic variable values must be strings [(2) ]() For example, if you want to pass the caller's phone number as a dynamic variable, your response would look like:
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
        "caller_phone": "+12137771234"
    }
  }
}
[(7) ]()
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
e
@AI Evy { "call_inbound": { "dynamic_variables": { "name": "{{2.firstName}}", } } } is this right then
a
Thanks for the follow-up, @emanuelkr. I'll get back to you soon.
### Answer [(1) ]() , [(2) ]() , [(3) ]() , [(4) ]() , [(5) ]() , [(6) ]() Your JSON structure is correct for the webhook response format [(1) ]() . However, there's an issue with the dynamic variable value you're using. The value
"{{2.firstName}}"
appears to be a reference to data from your webhook processing system (like Make.com) , but for the webhook response to Retell AI, you need to provide the actual string value, not a template reference [(2) ]() . Your structure should be:
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "name": "John Smith"
    }
  }
}
[(1) ]() Instead of
"{{2.firstName}}"
, you need to resolve that reference in your webhook processing system first, then pass the actual name value to Retell AI [(2) ]() . All dynamic variable values must be strings . If you're using Make.com (as mentioned in the Discord discussion [(6) ]() ) , you'll need to configure your scenario to extract the actual value from
{{2.firstName}}
and pass that resolved string value in the webhook response to Retell AI.
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
e
@AI Evy { "call_inbound": { "dynamic_variables": { "name": "emanuella", } } } i gave it like this and it doesnt work.
a
Thanks for the follow-up, @emanuelkr. I'll get back to you soon.
### Answer Your JSON structure is almost correct, but there's a syntax error - you have a trailing comma after
"emanuella"
which makes it invalid JSON [(1) ]() . The correct format should be:
Copy code
json
{
  "call_inbound": {
    "dynamic_variables": {
      "name": "emanuella"
    }
  }
}
To troubleshoot why it's not working, check these common issues: 1. **Webhook endpoint configuration**: Ensure your inbound webhook URL is properly configured in your phone number settings 2. **Response timing**: The webhook has a 10-second timeout, so your endpoint must respond within that timeframe 3. **Status code**: Make sure you're returning a successful status code (2xx) 4. **Agent configuration**: Verify that your agent's prompt includes the dynamic variable
{{name}}
where you want it to appear [(2) ]() The webhook will retry up to 3 times if it doesn't receive a successful response [(1) ]() . If all attempts fail and your number has an inbound agent ID set, it will connect to that agent without the dynamic variables . To use the dynamic variable in your agent, include
{{name}}
in your agent's prompt, begin message, or other supported fields [(2) ]() .
​ To learn more, see the sources I considered: [[1] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.