Cost not coming through webhook?
# support
v
Hi @Bryce, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Glossary]() * [Server URLs]() * [Get Call]() * [List Calls]() -----------------------------
### Answer It appears there might be an issue with the webhook data not updating correctly in real-time, which could be affecting the cost data in the end-of-call report. This is a known issue where the call object sent in webhooks can be stale from the start of the call, and it may not reflect the most current data, including cost [(1)]() . To fetch the latest details, including the accurate cost of the call, you could use the
GET /call/:id
endpoint to retrieve the most current information directly from Vapi. Here's an example of how to fetch the call data using this endpoint:
Copy code
curl
curl --request GET \
  --url https://api.vapi.ai/call/{id} \
  --header 'Authorization: Bearer <token>'
[(2)]() Ensure that you replace
{id}
with the specific call ID and
<token>
with your authorization token to get the accurate details from the server. This approach should provide the real-time cost and other updated information for the call.
a
the only reson i could think of is that the call didn't go through
prospect didn't pickup
b
That's me testing. All of the other data goes through to airtable. It's only the cost that isn't coming through
s
End-of-call-report are kinda of stale sometimes due to performance issues. Simply, add a wait time of 60 secs and then hit the /call endpoint with the call_id that you receive from the end-call-report and you will get the proper cost.
b
testing this now ❤️
added 60 second delay, still comes through as 0
s
Can you see your call logs from the dashboard and tell me whether there is any cost written properly over there?
b
yes. the cost is written properly in the vapi dashboard call logs
s
can you increase the delay to 180 seconds or 120 seconds?
and give it a try
ill test.
s
are you hitting the /call/{call_id} endpoint to get the result?
b
inbound agent. i have a make webhook setup. I put the URL into the Server URL in vapi dashboard. Under server messages I am sending the End Of Call Report and Function Call.
s
You receive an end-call-report on your webhook correct? Then, you just need to create another HTTP request node to send a request to this endpoint https://docs.vapi.ai/api-reference/calls/get-call but make sure to add a delay of 120 seconds before it.
b
implementing. will get back
s
Cool.
b
is this a new setup? i had this setup as i mentioned above and all of the data came through on the webhook previously. I didn't need to make an additional HTTP request
s
It is not a new setup. The thing is, as I mentioned earlier, sometimes data from the end-call report is stale, which causes some data to not be filled up properly. To fix it, I am suggesting that you make a new call after 120 seconds to the /call/{call_id} endpoint and get the latest data.
Which will not be stale.
b
makes sense. Thank you. I will make it work
worked
thank you for being helpful
s
@Bryce can you please send me your workflow template JSON cause a couple of people have trouble getting that setup? It would be really helpful for the community members.
s
Thank you!
3 Views