Jessica
10/09/2025, 9:58 PMVapi Support Bot
10/09/2025, 9:59 PMjs
app.post('/webhook', (req, res) => {
const { messageHistory } = req.body;
let destination;
// Analyze messageHistory to pick the right number
if (messageHistory.includes('sales')) {
destination = { type: "number", number: "+1234567890" };
} else {
destination = { type: "number", number: "+0987654321" };
}
res.json({ destination });
});
This lets you reuse the same tool and dynamically select the destination based on conversation context, without static parameters or multiple tools.
For more details, see the [Vapi dynamic transfer docs](https://docs.vapi.ai/calls/call-dynamic-transfers).
Source:
- [Dynamic call transfers](https://docs.vapi.ai/calls/call-dynamic-transfers)Vercel
10/10/2025, 8:52 AMChiranjeet Mishra
10/10/2025, 11:36 PMdynamicTransfer) and define any parameters like reason and urgency.
2. **Webhook Handling**:
- Set up a server or cloud function to handle the transfer-destination-request webhook. This webhook helps determine the destination based on call context and external data.
- Incorporate logic to choose the destination based on the input data. For instance, route critical issues to an emergency number.
3. **Configure an Assistant**:
- Create or edit an assistant in the Vapi dashboard.
- Add your dynamic transfer tool to this assistant.
- Enable the transfer-destination-request server event, and set your server URL to handle incoming webhooks.
4. **Testing**:
- Assign a phone number to your assistant and test various transfer scenarios to ensure dynamic routing functions properly.
- Monitor logs to verify correct routing decisions.
For detailed implementation steps, refer to the [dynamic call transfers documentation](https://docs.vapi.ai/calls/call-dynamic-transfers).Jessica
10/12/2025, 4:39 PMJessica
10/12/2025, 4:39 PMVercel
10/12/2025, 5:06 PMJessica
10/12/2025, 5:30 PMChiranjeet Mishra
10/14/2025, 6:46 PMVercel
10/14/2025, 9:13 PMChiranjeet Mishra
10/16/2025, 7:55 PM