Chiranjeet Mishra
09/22/2025, 12:47 AMBishal Paul
09/22/2025, 12:47 AMVapi Support Bot
09/22/2025, 12:48 AMchat.id from each chat response and then use the /chat/{id} API endpoint to fetch the message history.
Here’s a quick example in TypeScript:
typescript
// Fetch chat log by chat ID
const response = await fetch('https://api.vapi.ai/chat/your-chat-id', {
method: 'GET',
headers: { 'Authorization': 'Bearer YOUR_API_KEY' }
});
const chat = await response.json();
console.log(chat.messages); // This contains the chat history
Make sure you are capturing and storing the chat ID after each interaction, as this is required to retrieve the logs later.
[See API reference for details](https://docs.vapi.ai/api-reference/chats/get?explorer=true)
Sources:
- [GET Get Chat](https://docs.vapi.ai/api-reference/chats/get?explorer=true)
- [Non-streaming chat documentation](https://docs.vapi.ai/chat/non-streaming)