Hello Retell Team, I am having issue with a tool call not appending the variable into the url. call id - call_1796f2c8361d9e3a0d11c6b9ef8 i have the appointment_id set up as an extracted variable as you advised. I can see the payload the data that we need is there from the list appointments tool call. My url for the rescehdule appointment is 100% correct, however its not passing the appointment Id variable through in the URL.. im saving it both in extracted variables as a custom function and as a response variable from check appointments. this needs to be at the path level so i cannot use it as a query param. Any suggestions on this?
Let me help you with this path variable issue. Based on the sources, here’s what you need to check:
Path Variable Syntax
When using dynamic variables in your custom function URL path, you must use double curly braces {{variable_name}} format(1). For your reschedule appointment URL, it should look like:
/appointments/{{appointment_id}}/reschedule
Variable Setup
Since you’re extracting the appointment_id from a previous tool call, ensure:
- The variable is properly extracted using the Extract Dynamic Variables tool(2)
- The variable name matches exactly what you’re using in the URL (case-sensitive)
- If you’re also setting it as a response variable from the list appointments tool, make sure the response variable name matches(1)
Common Issues from Community
A similar issue was reported where variables weren’t populating in path parameters(3). The resolution involved:
- Using the variable name directly like
{{appointment_id}}rather than dot notation(3) - Ensuring the variable is extracted before the function call that uses it(4)
Verification Steps
- Check that your URL uses
{{appointment_id}}not{appointment_id}(4) - Verify the extract variable tool runs before your reschedule appointment tool call(4)
- Confirm the variable name in your extraction matches exactly what’s in your URL(3)
If you’ve verified all these points and it’s still not working, the call logs should show whether the variable has a value when the tool is invoked. You can check the collected_dynamic_variables field in your call details(5).
The URL has the variable listed correctly as {{appointment_id}}. When I checked the logs I can clearly see the appointment ID was saved properly as a dynamic variable as well. The tool is no invoking the endpoint the error continues to indicate it is passing as appointment_id or empty not as the substituted number.
For the URL you have /reschedule at the end of this. Why? My endpoint doesn’t require this, is this a retell requirement?
No, /reschedule is not a Retell requirement - I used it only as an example.
When you configure a custom function, you simply add your actual endpoint URL in the “Add endpoint URL” field(1)(2). This must be a valid URL(1)(2), but Retell doesn’t impose any specific path structure.
Your endpoint URL should be exactly what your API expects. If your endpoint is:
https://yourapi.com/appointments/{{appointment_id}}
Then that’s what you should use - no need to add /reschedule unless your actual API endpoint requires it.
The key point is that you can use dynamic variables like {{appointment_id}} anywhere in your URL path(1)(2), and Retell will substitute the actual value when making the request.
Hello @Office-Mate-AI
The appointment_id was extracted using the custom function, not using the extract dynamic variables function, so it will be sent in the body, not in the URL. To send it in the URL, you have to extract it before you call the custom function using the extract dynamic variables function, not extract it with the function if you want it in the URL, not in the body.
You’re correct about the distinction between response variables and extracted dynamic variables in Retell AI custom functions(1)(2).
When you save data as a response variable from a custom function, that data is extracted from the API response but isn’t automatically available for use in subsequent function calls’ URL paths or query parameters(1)(2).
To use a variable like appointment_id in the URL path or query parameters of another custom function, you need to:
- Extract it as a dynamic variable using the Extract Dynamic Variable node (in Conversation Flow) or the extract dynamic variables function (in Single/Multi Prompt)(1)(2)
- Then reference it using
{{appointment_id}}in your custom function’s endpoint URL or query parameters(1)(2)
For query parameters, you can define them with dynamic variables, and both the description and const value can include dynamic variables(1)(2). The description will be resolved by the LLM while the const value will be applied directly to the function(1)(2).
For request headers, header values can be static or include dynamic variables(1)(2).
However, parameters defined in the JSON schema (for POST, PATCH, and PUT requests) are sent in the request body, not in the URL(1)(2).
Based on a similar issue in the Discord community, when variables weren’t being substituted in URLs, the solution was to use the variable name directly like {{variable_name}} in both the const value and description fields(3)(4).
**