Discrepancy Between Call ID in Webhook Payload and...
# support
s
Hi @Vapi Support Bot @Vapi Team, I'm encountering a discrepancy between the call ID I receive in my webhook payload and the call ID shown in the Vapi dashboard. When using the Web SDK to start a call, the webhook sends the call ID as req.body.message?.call?.id (used for handling tool calls). However, this ID doesn't match the one displayed in the Vapi dashboard for the same call session. Could you clarify why there's a difference and whether there's a consistent way to extract the top-level call ID (the one shown in the dashboard) from the webhook payload? This would help with logging and correlating call data accurately across systems.
v
To consistently extract the top-level call ID (the one shown in the dashboard), use the
end-of-call-report
server event:
Copy code
javascript
// In your assistant configuration
serverMessages: ['end-of-call-report']

// In your webhook handler
const callId = req.body.message.call?.id;
This method is more reliable than client-side events because it's sent after all processing is complete and includes additional metadata. Source: - [Discord conversation about end-of-call-report](https://discord.com/channels/1211482211119796234/1342410769232302122)
s
can you explain where and how to put this // In your assistant configuration serverMessages: ['end-of-call-report']
k
The call ID in req.body.message?.call?.id refers to a subevent, while the toplevel call Id at the root of the webhook payload matches the dashboard and should be used for consistent call tracking..
Add serverMessages: ['end-of-call-report'] to your assistant config (e.g., in the Web SDK) to receive call summaries like transcripts via webhook or WebSocket after each call.
s
Hi this is the payload i am recieving in the body fo rthe webhook request. I dont see any call id here except req.body.message?.call?.id Could you please help me locate it https://cdn.discordapp.com/attachments/1364526704311271434/1366998753323520070/message.txt?ex=6812fc4c&is=6811aacc&hm=c09bd6be51ad8ee22f9430b69c75ffe21926f4e0d52e6d528101ae8ab8f78558&
k
To locate the top-level call ID, subscribe to the end-of-call-report event in your assistant’s configuration, which provides the call ID matching the dashboard for consistent tracking.
s
can you tell me how can i subscribe to that ?
k
Go to your assistant’s advanced settings, add your server URL under server messages, and enable the end-of-call-report event to receive call data including the top-level call ID.
s
I dont have any assistant created in the vapi i am using web sdk and creating real time assistant by passing the vapi.start(assistantOptions) so do i need to add this field here in assistantOptions ?
if yes can you show me sample payload for assistantOptions that contains this ['end-of-call-report'] ?
k
Yes, you need to include the server field in assistantOptions with your webhook URL and messages: ['end-of-call-report'] to receive end-of-call data in real-time via the Web SDK.