How to associate multiple phone number to a single...
# support
n
I’m building a multi-business voice assistant for our platform where the same assistant answers calls for multiple phone numbers — each representing a different business. Is there a recommended way to ensure the assistant greets automatically with a dynamic message based on the phone number context?
v
You can achieve dynamic greetings by using a variable in your assistant's greeting (e.g.,
Hello, welcome to {{businessName}}!
). When a call comes in, have your server map the incoming phone number to the correct business name and set the variable in the API request:
Copy code
json
{
  "assistantId": "your-assistant-id",
  "assistantOverrides": {
    "variableValues": {
      "businessName": "Acme Corp"
    }
  },
  "customer": { "number": "+1xxxxxxxxxx" },
  "phoneNumberId": "your-phone-id"
}
This way, the assistant will greet callers with the correct business name based on the number they dialed. Reference: See dynamic variables usage in the [documentation](https://docs.vapi.ai/assistants/dynamic-variables). Source: - [Variables Personalize assistant messages with dynamic and default variables](https://docs.vapi.ai/assistants/dynamic-variables)
n
Cannot find any doc about inboud call dynamic variables - do I able to have a pre-call hook to export a dynamic variable?
c
You can achieve a pre-call webhook by not associating an assistantId to a phone number and configuring a serverUrl on the assistant-level, phone number, or org. When a call starts, it will send a
assistant-request
hook to your serverUrl where your server will be able to assign the assistantId along with assistantOverride.variableValues based on logic you create to differentiate your business names from the phone number they called.
n
Got it , thank you very much! Assume we need a well formed doc for that feature. It took me one week to understand that I should receive a web hook with type
assistant-request
in
body.message.type
. The second point I believe should find place in doc is - DO NOT SELECT ANY assistant/workflow/squad in the phone number config to receive the
assistant-request
hook
One point related to UX!? It's very unclear that a selected assistant/workflow/squad can be unselected by clicking on the selected one again
c
Thank you for that info. We will pass it along to our team to further improve our platform. We appreciate the feedback!
3 Views