stormy-gold
stormy-gold4mo ago

Is it possible to connect a Vapi phone number to a URL?

I am participating in the Vapi hackathon and would like to pass variables into my call configuration before the call starts. For example, I want to load data based on the caller's phone number and populate the dynamic variables in my squad and assistant setup. Can I do this with a Vapi phone number? I was able to get it working with a twilio number but that's only because Twilio lets me point the phone number at a custom URL.
7 Replies
Vapi
Vapi4mo ago
Yes, you can connect a Vapi phone number to a custom URL to dynamically configure your call setup. Set the server.url for your phone number, and Vapi will POST an assistant-request to your endpoint on each call. Your server can then look up the caller and respond with dynamic variables or a full assistant/squad configuration. Example response:
{
"assistantId": "asst_customersupport",
"assistantOverrides": {
"variableValues": {
"customerName": "Alice",
"accountType": "Gold",
"joinDate": "2022-01-01"
}
}
}
{
"assistantId": "asst_customersupport",
"assistantOverrides": {
"variableValues": {
"customerName": "Alice",
"accountType": "Gold",
"joinDate": "2022-01-01"
}
}
}
See the docs for more details. Sources: - Personalization with user information - Setting Server URLs
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
stormy-gold
stormy-goldOP4mo ago
What URL do I use to patch my number? @Vapi
Shubham Bajaj
Shubham Bajaj4mo ago
Hey Joe Muller, Apologies for your bad experience please check this documentation for customizing call experience right before the call starts https://docs.vapi.ai/assistants/personalization
stormy-gold
stormy-goldOP4mo ago
Thanks! How do you recommend developing a phone app? On twilio I was using ngrok and updating a phone number to point at my local machine every time I made changes. Is there an easy way to do this in Vapi? Eg. redirect my Vapi number during development.
Shubham Bajaj
Shubham Bajaj4mo ago
Hey Joey Molo, sorry I couldn't understand when you say "developing a phone app" and then you said "updating a phone number to the point at my local machine". If you could rephrase your statements again and convey with an example, it will be really helpful for me to understand and align with you.
stormy-gold
stormy-goldOP4mo ago
I figured it out. During development I am using ngrok and updating my Vapi number's server URL whenever I make changes. This lets me call the number and see the logs on my local machine.
Shubham Bajaj
Shubham Bajaj4mo ago
Sounds, good.

Did you find this page helpful?