https://retellai.com/?utm_source=discord&utm_medium=seo logo
With the call_inbound, we set dynamic variables
# ❓・ai-evy-support
c
@AI Evy With the call_inbound, we set dynamic variables. { "call_inbound": { "dynamic_variables": { "user_id": "1", "user_name": "Ciaran Jones",.... } } } In functions, can I pass in the user_id?
a
Thanks for tagging me @Ciaran. I'll look through relevant sources and get back to you shortly.
### Answer --- Yes, you can pass
user_id
into custom functions. Dynamic variables set via the inbound webhook can be used in several places within custom function configurations: [(1) ]() In the endpoint URL:
Copy code
<https://your-api.com/users/%7B%7Buser_id%7D%7D/action>
[(2) ]() In query parameters: You can define query parameters with dynamic variables—both the description and const value can include dynamic variables like
{{user_id}}
. In request headers: Header values can be static or include dynamic variables. In the request body (JSON schema) : You can use the
const
field to inject the dynamic variable:
Copy code
json
{
  "type": "object",
  "properties": {
    "user_id": {
      "type": "string",
      "const": "{{user_id}}"
    }
  }
}
Important: All dynamic variable values must be strings. If you're passing booleans or numbers, convert them to strings (e.g.,
"1"
instead of
1
,
"false"
instead of
false
) . [(1) ]() , [(3) ]()
​ To learn more, see the sources I considered: [[1] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[3] Dynamic Variables From Inbound Webhook Not Passed to the Call](https://discord.com/channels/1186424376300679209/1419725903918923920) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.