Call redirect to Vapi from Twilio Flow
# support
r
Hi, We have a Twilio Flow that gather DTMF entry from the user and based on the entry, we want to redirect the call to Vapi. We are using the https://api.vapi.ai/twilio/inbound_call URL for the redirect, but that is returning status code 400 with the message "Call is not ringing". Is there a Vapi URL for redirecting the call where the call is already connected and the user has already entered some keypad entries. If not, what other option do I have to redirect the call to Vapi?
c
Hi there, Thank you for your message. Our team is currently out of the office. We operate Monday through Friday, from 9:00 AM to 8:00 PM Pacific Standard Time (PST). We’ll get back to you as soon as possible during our normal business hours. If your message is urgent, please mark it accordingly or include “URGENT” in the subject line, and we’ll do our best to respond promptly. Warm regards, Vapi Customer Support Team
v
You should use the standard
/call
endpoint with
phoneCallProviderBypassEnabled: true
for redirecting already-connected Twilio calls to Vapi.
Here’s a code snippet to do this:
Copy code
javascript
const response = await axios.post(
  "https://api.vapi.ai/call",
  {
    phoneNumberId: PHONE_NUMBER_ID,
    phoneCallProviderBypassEnabled: true,
    customer: { number: caller },
    assistantId: ASSISTANT_ID,
  },
  {
    headers: {
      Authorization: `Bearer ${PRIVATE_API_KEY}`,
      "Content-Type": "application/json",
    },
  }
);
// Use the returned TwiML to update your Twilio call
This approach works for calls that are already connected and have passed through your Twilio Flow. Use the returned TwiML to update the call and connect to Vapi. Reference: Vapi documentation on call handling with Twilio. Source: - [Call Handling with Vapi and Twilio](https://docs.vapi.ai/calls/call-handling-with-vapi-and-twilio)
v
Message marked as helpful by @GIDEON! 🎉
v
I can help you fix this — the 400 error happens because Vapi only accepts calls that are still ringing. To redirect after DTMF input, we’ll need to tweak your Twilio Flow or use a different webhook setup. Could you share how your flow handles the call after collecting digits?
v
Message marked as helpful by @Ramesh Verve! 🎉
r
Was able to redirect the call after DTMF input based on the directions provided by the Vapi Support Bot.
c
Glad you were able to get this resolved. If anything else comes up or you need further assistance, we’re here to help.
4 Views