extended-salmon
extended-salmon2w ago

Urgent: send custom parameters to dynamic transfer call vapi

If I use parameters that I need to receive at my webhook when creating my dynamicTransfer function, the “transfer-destination-request” is not executed. { "id": "dfba02bd-765a-4d1f-8e8a-97e9785ac369", "createdAt": "2025-08-19T12:14:02.599Z", "updatedAt": "2025-08-19T12:18:59.918Z", "type": "transferCall", "function": { "name": "dynamicTransfer", "description": "dynamic transfer call", "parameters": { "type": "object", "properties": { "reason": { "type": "string", "enum": [ "accounting", "commercial", "general", "incident_urgency" ] }, "postal_code": { "description": "5-digit postal code (ZIP code) ", "type": "string" } }, "required": [] } }, "messages": [ { "type": "request-start", "blocking": true } ], "orgId": "**" } If I don't use parameters and leave everything blank, the “transfer-destination-request” is executed, but I can't receive the variables I need. { "id": "4f3132bb-a995-4cea-9fba-45e7dc53d528", "createdAt": "2025-08-19T09:33:37.189Z", "updatedAt": "2025-08-19T09:36:29.338Z", "type": "transferCall", "function": { "name": "dynamicTransfer", "description": "dynamic transfer call", "parameters": { "type": "object", "properties": {}, "required": [] } }, "messages": [ { "type": "request-start", "blocking": true } ], "orgId": **" }
4 Replies
Sahil
Sahil2w ago
Hi Ignacio, To ensure that the transfer-destination-request webhook is triggered correctly when using parameters in your dynamicTransfer function, make sure that the destination is not predetermined and that your webhook URL is configured to handle these requests properly. Here’s a brief guide on setting up dynamic call transfers with parameters: Example webhook logic:
app.post('/webhook', (req, res) => {
// Verify signature and process request
const { type, callContext, parameters } = req.body;

if (type !== 'transfer-destination-request') {
return res.status(200).send({ received: true });
}

// Determine routing based on parameters
const { reason } = parameters;
let destination;

if (reason === 'urgent') {
destination = { number: "+1234567890", message: "Urgent support requested." };
} else {
destination = { number: "+0987654321", message: "General support." };
}

res.json({ destination });
});
app.post('/webhook', (req, res) => {
// Verify signature and process request
const { type, callContext, parameters } = req.body;

if (type !== 'transfer-destination-request') {
return res.status(200).send({ received: true });
}

// Determine routing based on parameters
const { reason } = parameters;
let destination;

if (reason === 'urgent') {
destination = { number: "+1234567890", message: "Urgent support requested." };
} else {
destination = { number: "+0987654321", message: "General support." };
}

res.json({ destination });
});
Following this approach should help in successfully triggering the webhook and processing transfers dynamically using parameters. For more detailed guidance, refer to Vapi's dynamic call transfers documentation. /simple and bit short
absent-sapphire
absent-sapphire5d ago
This is also not working for us following that same documentation
Sahil
Sahil3d ago
What problem are you facing? Can you provide more details?
absent-sapphire
absent-sapphire3d ago
We setup a transferCall function for a dynamic routing. But our webhook that we have setup never sees request come in for that transfer.

Did you find this page helpful?