Variable Value is not Passed to API Request URL
# support
m
I've been troubleshooting this error for some time now, and i'm not sure where to go from here, i've set a server URL in my phone number and I return a session_uuid variable so that I can see it in my prompt (which is now {{session_uuid}} and as an example i've set that as 1234abcd), which I can see, but I am still unable to add it into the API Request URL for some reason, why is this happening? @User if its needed here is my call id as an example: 1db52f15-1a7e-4a37-94b9-96c99d748c2d https://cdn.discordapp.com/attachments/1419633093538615336/1419633094805422092/Screenshot_2025-09-22_at_11.31.18.png?ex=68d277d9&is=68d12659&hm=c6dcc8ee1363eb35d61affe743c8197e436723322dbe190d105e6809e0568f11& https://cdn.discordapp.com/attachments/1419633093538615336/1419633095241498717/Screenshot_2025-09-22_at_11.30.44.png?ex=68d277d9&is=68d12659&hm=302c40ee9ce7996607bbe9da763e3bc6746db78c4ad2c518682a11c9b3bbe424&
v
Suggestion: Make sure the
session_uuid
variable is extracted and available before the API request node runs. In your workflow, add a variable extraction step or validation prompt prior to the API request, and confirm in your Call Logs that
session_uuid
is present in the variables list at that point. Example node prompt for extraction:
Copy code
yaml
Extract the session UUID from the server response and store it as `session_uuid` before the API request node.
Then, use the URL:
https://your-endpoint/answer/{{session_uuid}}
Check the Call Logs to verify the variable is set before the API call—if not, adjust the workflow order accordingly. [See debugging steps](https://docs.vapi.ai/debugging#check-logs) Source: - [Debugging voice agents](https://docs.vapi.ai/debugging)
m
But it's already coming through the variableValues in the assistantOverrides
c
Hi mm, To use dynamic variables in your Vapi assistant, you need to incorporate them into your phone call setups or API requests by including them in double curly braces, e.g.,
{{name}}
. Here's a quick guide on how to include dynamic variables in API requests: 1. Prepare Your JSON Payload: - Include these key-value pairs:
Copy code
json
     {
       "assistantId": "your-assistant-id",
       "assistantOverrides": {
         "variableValues": {
           "name": "John"
         }
       },
       "customer": {
         "number": "+1xxxxxxxxxx"
       },
       "phoneNumberId": "your-phone-id"
     }
- Replace
"your-assistant-id"
,
"+1xxxxxxxxxx"
, and
"your-phone-id"
with your actual assistant ID, customer's phone number, and registered phone number ID. 2. Send the Request: - Use the JSON payload to make a call to the
/call/phone
endpoint through your preferred method, like an HTTP POST request. Ensure that you set the necessary headers for authorization. You can find detailed instructions in the [Vapi Documentation on using dynamic variables](https://docs.vapi.ai/assistants/dynamic-variables). Let me know if you need further clarification or assistance with specific issues in your setup.