Is it possible to automatically collect the caller...
# support
v
Yes, you can automatically collect the caller's phone number at the start of the call and have the assistant mention it without asking the customer again. When Vapi sends an
assistant-request
to your server, the caller's phone number is included in the payload. You can inject this value as a variable into your assistant's prompt or messages. Example (Node.js/Express):
Copy code
js
app.post("/api/assistant-selector", (req, res) => {
  const phoneNumber = req.body.message?.call?.from?.phoneNumber;
  res.json({
    assistantId: "your-assistant-id",
    assistantOverrides: {
      variableValues: { callerPhone: phoneNumber }
    }
  });
});
Now, use
{{callerPhone}}
in your assistant's prompt to reference the number during the call. No need to ask the customer for their number again! [See docs for details](https://docs.vapi.ai/assistants/personalization#add-dynamic-variables-to-your-assistant) Source: - [Personalization with user information](https://docs.vapi.ai/assistants/personalization#add-dynamic-variables-to-your-assistant)
c
Hi rocket, You can use dynamic variables in the assistant's prompt to include customer information that will be available during the conversation. Here's how:
Copy code
{
  "model": {
    "messages": [
      {
        "role": "system",
        "content": "You are speaking with {{customer.name}} (phone: {{customer.number}}). Use their name naturally in conversation when appropriate."
      }
    ]
  }
}
You can set these variables when starting the call [1](https://docs.vapi.ai/assistants/dynamic-variables):
Copy code
{
  "assistantId": "your-assistant-id",
  "assistantOverrides": {
    "variableValues": {
      "customer.name": "John Smith",
      "customer.number": "+1234567890"
    }
  }
}
Available dynamic variables include: -
{{customer.name}}
-
{{customer.number}}
-
{{now}}
-
{{date}}
This way, the assistant can naturally reference the customer's information without having to ask for it again .
v
Message marked as helpful by @rocket! 🎉
4 Views