When using Vapi, there are two main approaches to retrieving call summaries and transcripts.
### Option 1: Using the Client SDK with Server Events
The Vapi Web SDK does provide the call ID in the response when starting a call.
const call = await vapi.start(assistantId);
// { "id": "bd2184a1-bdea-4d4f-9503-b09ca8b185e6", ... }
The call object returned from vapi.start() includes the call ID and other information. You can store this ID to retrieve additional information later.
For real-time transcripts during the call, you can configure your assistant to send transcript updates to the client:
// In your assistant configuration:
clientMessages: [
"transcript",
"conversation-update",
// other message types
]
// Then listen for these messages:
vapi.on("message", (message) => {
if (message.type === "transcript") {
// Handle transcript update
console.log(message.transcript);
}
});
### Option 2: Server API (Recommended for Post-Call Analysis)
For comprehensive post-call analysis including summaries and complete transcripts, the server API is the recommended approach:
1. First, create your assistant with the appropriate configuration:
serverMessages: [
"end-of-call-report",
"conversation-update"
]
2. Configure a server URL endpoint to receive these events
3. After a call is completed, you can also use the server API to retrieve call details:
GET
https://api.vapi.ai/call/:id
This endpoint will return detailed information about the call, including:
- Complete transcript
- Call metadata
- Cost information
- Recording URLs (if enabled)
The call object returned from the GET endpoint includes a transcript field with the full conversation and a messages array with each utterance.
For the most robust solution:
1. Use the client SDK to start calls and capture the call ID
2. Set up a server endpoint to receive server events including "end-of-call-report"
3. Store call IDs associated with your user IDs
4. After the call ends, use the server API to retrieve the complete transcript and summary
This approach ensures you have complete information for post-call analysis while maintaining the association between your users and their Vapi interactions.
Would you like me to elaborate on any specific part of this process or provide code examples for a particular integration pattern?