How to Capture Call Failure Reasons Using VAPI Web...
# support
a
Hi everyone, Some of our calls are failing, and we would like to capture the failure reason and store it in our database using a webhook. Is there a webhook event or payload field that provides the call failure reason (for example: no answer, invalid number, call rejected, etc.)? Could you please share the correct webhook event name or payload field that contains this information? An example payload or documentation link would also be very helpful. Thanks!
d
Hey! Yes there's a built-in field for this. In your webhook's end-of-call report payload, look for the endedReason field. It tells you exactly why the call ended — values like no-answer, customer-did-not-pick-up, invalid-number, call-rejected and more. Here's a quick example of what the payload looks like: json{ "message": { "type": "end-of-call-report", "endedReason": "customer-did-not-pick-up", "call": { ... } } } You can store this endedReason value directly in your database on every call. Full list of ended reasons here: https://docs.vapi.ai/calls/call-ended-reason For setting up the webhook to receive end-of-call reports, check assistant hooks: https://docs.vapi.ai/assistants/assistant-hooks
k
to echo what @Dharun Karthick said, use the
end-of-call
webhook which is under the messages section of the assistant page (all the way at the bottom). configure your webhook URL under
server
and add any auth your webhook might need. the
endedReason
will show up in the EOC report.