Issue with userid Not Propagating to API Request i...
# support
v
Dear Vapi Support Team, I'm facing an issue where the userid variable passed from my frontend (Next.js) via assistantOverrides.variableValues isn't being received in the “API Request” step of my Vapi workflow. Although console logs confirm that userid is correctly set on the frontend, it consistently shows up as an empty string in my backend request. Hardcoding userid directly in the workflow works fine, which suggests that dynamic interpolation of {{userid}} in the API Request step isn’t functioning as expected. Could you help identify why {{userid}} isn’t being passed through correctly? Thanks,
c
Hey! To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) - What response you expected to get - What response you actually got instead This would really help us figure out what went wrong!
c
I am marking this ticket as solved, as we discussed over DMs.
o
Hello, @VS893 @Shubham Bajaj could you please provide the solution because im facing the same problem ( its being passed as userId : "{{ userId }}" in the database )
c
Hey! To help track down this issue, could you share: - The call ID - When exactly this happened (the timestamp) This would really help us figure out what went wrong!
o
In my web app, I’m using VAPI with an assistant that calls an API Request tool to generate interview questions. I pass userId from the frontend when starting the assistant. The problem is that in the database, I see the literal string {{ userId }} instead of the actual user ID. It looks like the variable isn’t being replaced properly in the API Request tool payload. I’m sure the userId is correct before the call, but it’s not sent right to the API. this is my assistant ID : 9f902725-7f74-4a5b-adb4-3d71a7b975d7 and this is the api request tool id : e31aa610-285f-41e5-bd57-b742d88839b9 please check it and thank you.
this from the code : const handleCall = async () => { console.log("Starting call with userId:", userId); console.log("Starting call with userName:", userName); setCallStatus(CallStatus.CONNECTING); await vapi.start(ASSISTANT, { variableValues: { userId: userId, username: userName, }, }); }; and it's logging the id and username successfully
c
Hey, we're looking into this and will get back to you soon.
2 Views