Dynamic variables inbound call
# support
b
I'm sorry to make this and bother but I have spent 2 embarrassing days in the documentation. I am trying to use variables like {{name}} in prompt but I don't understand how to ping my server for inbound call. Is there suppose to be an option here (see photo) for "assistant-requests"? I have my webhook in the server URL. I just don't know how to make Vapi ping it when a call comes in. Like does the presence of {{ }} make Vapi ping the server? https://cdn.discordapp.com/attachments/1273840495256276992/1273840495621050460/2941c930a780181ebc8b7a0b02039e16.png?ex=66c013e8&is=66bec268&hm=f8e7aff2f9be7ae2c2cd2850e6b04864afda4b8ba942e767043d4e199a2fbab7& https://cdn.discordapp.com/attachments/1273840495256276992/1273840495935750266/dc1579059d1fafbaa2b812cc01232777.png?ex=66c013e9&is=66bec269&hm=6e352e24b83c36fc3ac81fd178170ec7a911818169aa9c2ab0860057179a50c4&
v
@Bryce No need to apologize, I'm here to help you! To have Vapi ping your server when an inbound call comes in, you need to ensure that your webhook is correctly set up in the Server URL field on the Vapi Dashboard. The presence of
{{ }}
in your prompt is for variable substitution within Vapi and does not directly relate to pinging your server. Here's what you need to do: 1. Make sure your endpoint is correctly set up to handle POST requests according to the Assistant Request documentation. 2. Add the endpoint URL to the Server URL field in the Account page on the Vapi Dashboard. 3. When an inbound call is received, Vapi will automatically send a POST request to the endpoint you specified. Variables like
{{name}}
are used within Vapi to dynamically insert data into your prompts. For example, if you have a variable
name
that you want to use in your prompt, you would include
{{name}}
in the prompt text, and Vapi will replace it with the actual name value when the prompt is executed. If you've already set up your webhook and it's not being pinged on an inbound call, please double-check the following: - The Server URL is correctly formatted and accessible from the internet. - Your server is correctly handling POST requests. - There are no errors in the webhook setup that might prevent Vapi from reaching out. If everything seems correct and you're still facing issues, please ask support for more info on this. They can help you troubleshoot the problem further.
You can continue this conversation by mentioning me in the message.
b
1. it is setup correctly 2. endpoint url is in the field. Am i just missing a setting here: "Server Messages These are the messages that will be sent to the Server URL configured." options: "conversation-update", end-of-call-report, function-call, hang, model-output, phone-call-control, speech-update, status-update, transcript, tool-calls"
c
Just to clarify - you are trying to ping your server - or you are trying to have a dynamic assistant? They are not related to each other.
v
@Bryce It sounds like you're on the right track. If you want your server to be pinged when an inbound call comes in, you need to select the appropriate server messages that you want to receive. These messages will trigger a webhook event that your server can respond to. For handling inbound calls, you might want to select the following options: - `status-update`: To get updates about the call status. - `phone-call-control`: To receive events related to controlling the phone call. Make sure to select these options in the "Server Messages" settings. Once these are selected, Vapi will send a POST request to your server URL with the relevant information whenever these events occur. If you're expecting to receive a specific event when a call comes in and you don't see an option for it, please ask support for more info on this. They can provide you with detailed information on which events you can subscribe to and how to set them up.
b
I want to add variables into my promt {{name}}, {{address}}. inbound
c
You dont do that in VAPI. You do that wherever you are making the call. Your automation platform or CRM.
b
for inbound calls...
c
.....lol Once again. You still do that wherever your automation platform when you create the call. (https://api.vapi.ai/call) You can't add dynamic variables without the json for the assistant - regardless if it is inbound or outbound. Even more so if you are hitting your server........
b
wdym "when you create the call" ? Rn my setup is all in Vapi. then I have a post-call-report sent over to n8n where I do a bunch of stuff with.
c
So you are saying a lot of things I dont think you understand. You mentioned "assistant-requests" which have to do with pinging your ACCOUNT server not your ASSISTANT server. You also mentioned variables - which DO NOT work in the dashboard whatsoever for anything. You put that in your JSON whether it is an inbound or outbound. For the end of call report it sounds like you have it set up correct. All you need is it set on the "Server" side. Do a call for 10 seconds and hang up - you shold get your report.
b
thank you for your time to answer. You have steered me in right direction. thank you. Clearly I don't understand so I will go back and do more learning.
c
Just to clarify - add another webhook and only have your end of call report on. Troubleshoot that first.
b
just to clarify, if I put webhook to my server into organization level Server Url... it will ping it the moment a call comes in?
s
This is the wrong place you are putting the webhook url.
put your webhook url here and don't assign any assistant for your phone number
and when you will call any number we will send a assistant request to your server
b
wow ... that's what I was missing. I had my phone number tied to my assistant.
😭
sidenote: the Server Url input here is super buggy for me. It won't accept changes like pasting in a new server url or changing the secret unless I refresh the page. If I put in the server url and then click somewhere else on Vapi, it doesn't save
You can use this as well
well can you make a loom will forward it to team to update it.
b
yes 🫡
found another bug. sent both to your support email.
e
Mine's doing the same thing though I'm not receiving the requests at all so I've still got a ways to go
b
can you get the server url to paste in there?
e
I can paste it in there but it doesn't retain that string the next time I look at it. I've just been using the patch API call to put my url in instead
b
paste in string. refresh page. that's what fixed it for me. wouldn't work if I clicked off into other settings. had to refresh.
e
Oh wow you got it! Thank you so much ahaha
b
lol. glad i'm not the only one
e
Still not getting my endpoint hit but it's progress!
b
make sure your webhook is set to POST not GET
e
yeah I did that... trying something new now! Thanks for the advice
s
thank you!
e
Are there docs specifically for dynamic assistants?
b
I would just start reading around in the docs and get familar with all of the concepts. I spent multiple hours just reading and learning and it helped. Look at sidebar on left and read about concepts. Although the documentation is visually pleasing and easily digestible... it lacks a little on info tbh. https://docs.vapi.ai/assistants/dynamic-variables
I got it to hit my webhook by putting my webhook into the organization level server url spot. Then in settings REMOVING the assistant from my phone number. Then when I call the number, Vapi pings the server.
e
Yeah alright will do! Thank you very much for your help
Right... So just to triple confirm, it's https://myserver.com in vapi dashboard in your server url not https://myserver.com/assistant-request right? I really don't see the bug ahaha
Oh my god... I got it... Thank you for all your help you're a legend
c
It works perfectly fine. You were literally usng it in a place that it's not meant for.
18 Views