Obtain a callId/chatId on UI side
# support
a
Hi, I'm using a Vapi widget and try to obtain a callId or chatId values on the UI side. I tried to listen to Vapi widget events like "call-start" and "message" but didn't find these ids inside the events, or inside Vapi web socket interaction with the server. Any ideas how can I get these values? I need them for an automation platform to "identify" the user when Vapi calls MCP tools. Thanks in advance.
v
Currently, the Vapi widget's "call-start" and "message" events do not include
callId
or
chatId
in their event payloads on the UI side.
You can try inspecting the
event.detail
object in the "message" event for any available IDs, but if they're not present, this is a platform limitation.
Copy code
js
widget.addEventListener('message', function(event) {
  console.log('Message event detail:', event.detail); // Check for callId/chatId here
});
If the IDs are missing, consider reaching out to Vapi support to request this feature or implement a server-side mapping workaround. Sources: - [Web widget documentation](https://docs.vapi.ai/chat/web-widget) - [MCP integration documentation](https://docs.vapi.ai/tools/mcp)
v
I can help you access the callId or chatId directly from the Vapi SDK once the session or room is created, as these aren’t exposed in widget events. You can capture them from the sessionStarted or callCreated callbacks. Could you share your widget initialization snippet? I’ll show exactly where to extract those IDs. @Alexander
4 Views