Missing Failure Webhook When Outbound Call Cannot ...
# support
s
When I start a call with a request like this: curl --location 'https://api.vapi.ai/call' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer redacted' \ --data '{ "assistantId": "dc5aca0b-8974-427d-86f2-9a007663bff0", "assistantOverrides": { "variableValues": { "firstName": "Steve", "lastName": "Thomas", "fullName": "Steve Thomas", "phoneNumber": "+923464801343", "timeZoneFriendlyName": "Pakistan Time", "timeZone": "Asia/Karachi", "FirstName": "Steve", "LastName": "Thomas" } }, "phoneNumberId": "e8b45f51-2967-4bd1-9c0e-64f802fc2451", "customer": { "number": "+923464801343", "name": "Steve Thomas" } }' I received a 200 status code and a call ID: 019b0a53-24ab-744b-96ba-9b2750c7e8c0 However, this phone number is blocked on my Twilio account, so VAPI is failing to start the call. I am not receiving any status update or notification to let me know that the call failed. Is there any way to receive a webhook or some kind of callback to notify me when a call fails to start? Thanks.
@Shubham Bajaj
v
To receive notifications when an outbound call fails to start (e.g., due to a blocked number), set up a webhook listener for the
call-ended
event and check the
endedReason
field for failure codes like
twilio-failed-to-connect-call
. Here’s a sample Express.js handler:
Copy code
js
app.post('/webhook', (req, res) => {
  if (req.body.type === 'call-ended' && req.body.call.endedReason) {
    console.log('Call failed:', req.body.call.endedReason);
    // Handle failure notification here
  }
  res.sendStatus(200);
});
Update your Vapi webhook URL to point to this endpoint, and you’ll be notified of call failures via webhook events with the relevant reason code. For more details, see the [Call ended reasons documentation](https://docs.vapi.ai/calls/call-ended-reason). Sources: - [Call ended reasons documentation](https://docs.vapi.ai/calls/call-ended-reason) - [Webhook CLI/Webhook Testing Guide](https://docs.vapi.ai/cli/webhook)
@User could you support me pls?
@User
c
Make sure your twilio account status is not in
trial
, then you should receive webhook
status-update
. We are currently seeing this error in the logs for your call id:
Copy code
🔴 22:13:00:688 Couldn't initiate outbound call transport and queue for call 019b0a53-24ab-744b-96ba-9b2750c7e8c0. Error: Couldn't Create Twilio Call. Twilio Error: Account not authorized to call +923464801343. Perhaps you need to enable some international permissions: https://www.twilio.com/console/voice/calls/geo-permissions/low-risk
s
Hey My Twilio is not in trial status why did I not receive the webhook?