https://retellai.com/?utm_source=discord&utm_medium=seo logo
How do I ensure a PUT request custom function fill...
# ❓・ai-evy-support
b
@AI Evy How do I ensure a PUT request custom function fills with the proper payload/request body? I already wrote my schema, but I'm not sure where to actually tell the custom function which dynamic variables to fill with
a
Thanks for tagging me @bohraz. I'll look through relevant sources and get back to you shortly.
### Answer To ensure a PUT request custom function uses the correct dynamic variables in the payload, you should define your parameters using a JSON schema when setting up the custom function in the dashboard. The mapping of dynamic variables happens during this configuration—Retell will substitute dynamic variables in the request body based on the schema and the values collected during the conversation. When defining your parameters, set them up using the JSON schema format. For example:
Copy code
json
{
  "type": "object",
  "properties": {
    "city": {
      "type": "string",
      "description": "The city of the weather"
    }
  },
  "required": [
    "city"
  ]
}
[(1) ]() , [(2) ]() During the function setup, you can specify dynamic variables as the values for each property, so when the function is called, Retell fills the request body with the current values of those dynamic variables. There is no separate step to "map" variables—Retell automatically injects the values if the schema properties match the dynamic variables' names. If you want to extract specific values from the API response for later use, you can configure response variables so they are saved as dynamic variables for subsequent steps [(1) ]() . For PUT requests, ensure that your JSON schema defines all required fields and that the variable names in your schema match the names of the dynamic variables you expect to use , [(2) ]() .
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
b
@AI Evy So is there no way to do like "custNo": {{cust_id}}
a
Thanks for the follow-up, @bohraz. I'll get back to you soon.
### Answer Yes, you can use dynamic variables like "custNo": {{cust_id}} in your custom function's payload. When you define your JSON schema for the function parameters, Retell will automatically substitute any dynamic variable (such as {{cust_id}}) with its current value at runtime, as long as the variable is set in the conversation or passed in the call context. You just need to make sure the property name in your schema (e.g., "custNo") matches the key you want, and the value is set to the dynamic variable (e.g., {{cust_id}}) when configuring or invoking the function [(1) ]() [(2) ]() [(3) ]() .
​ To learn more, see the sources I considered: [[1] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) [[3] 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.
b
@AI Evy So when I am trying to do like "custNo": {custNo} in my custom function for the payload, how can I do that? and give an example and tell me where to put it
a
Thanks for the follow-up, @bohraz. I'll get back to you soon.
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] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Dynamic Variables](https://docs.retellai.com/build/dynamic-variables) ​
### Answer To use a dynamic variable like "custNo": {{custNo}} in your custom function payload, you should: 1. Define your function parameters using a JSON schema in the custom function setup. 2. When configuring the function (e.g., in the Conversation Flow editor) , set the value for the "custNo" parameter to the dynamic variable syntax: {{custNo}}. Example schema for your custom function:
Copy code
json
{
  "type": "object",
  "properties": {
    "custNo": {
      "type": "string",
      "description": "Customer number"
    }
  },
  "required": [
    "custNo"
  ]
}
[(1) ]() When you configure the function node in the Flow UI, you'll set the value for "custNo" to {{custNo}}. At runtime, Retell will replace {{custNo}} with the actual value of the dynamic variable from the conversation context or call payload [(2) ]() . You put the dynamic variable reference (e.g., {{custNo}}) in the parameter value field in the function node's configuration—not in the schema itself, but in the value that will be sent with the request , [(1) ]() .
b
@AI Evy where is this parameter value field in the function node's configuration? I'm only seeing the schema
a
Thanks for the follow-up, @bohraz. I'll get back to you soon.
### Answer Based on the available documentation, when configuring a custom function in Retell AI, you define the parameter schema (JSON schema) in the function node configuration, but the field to assign dynamic variable values (like {{custNo}}) is not directly shown in the schema editor itself [(1) ]() [(2) ]() . Instead, the documented process is: 1. Define your parameters using the JSON schema in the custom function node (this is the schema editor you see) . 2. When you later use this function node within your conversation flow (such as in the visual Flow editor or similar interface) , you assign the values for each parameter. This is where you would enter {{custNo}} as the value for the "custNo" parameter. The documentation does not show a screenshot or explicit UI label for this "parameter value field," but it clearly separates the schema definition (which describes the structure) from the place where you map actual values (which is done when you add or configure the function node within your flow) . If you are only seeing the schema editor and not a place to assign parameter values, it's likely that the value assignment happens in the Flow or Prompt builder interface, not in the schema definition screen itself .
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] Custom Function](https://docs.retellai.com/build/conversation-flow/custom-function) [[2] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​