Qper
12/10/2025, 7:48 PMQper
12/10/2025, 7:49 PMVapi Support Bot
12/10/2025, 7:50 PMpreviousChatId from the last response when sending follow-up messages. Here’s a code snippet:
js
await sendChatMessage("Tell me more", firstMessage.chatId); // Links to previous chat
This way, you only create a new chat for the first message, and all follow-ups are linked, keeping costs down and context intact.
See the [Vapi session management docs](https://docs.vapi.ai/chat/session-management) for more details.
Source:
- [Session management](https://docs.vapi.ai/chat/session-management)Vapi Support Bot
12/10/2025, 7:51 PMpreviousChatId parameter in your API request to link messages together.
Here’s a code snippet example:
js
await fetch('https://api.vapi.ai/chat', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
assistantId: 'your-assistant-id',
input: 'Your message here',
previousChatId: 'last-chat-id'
})
});
This way, you keep the conversation in the same context without starting a new billable chat each time. For more details, see the [Vapi session management documentation](https://docs.vapi.ai/chat/session-management).
Source:
- [Session management](https://docs.vapi.ai/chat/session-management)Vapi Support Bot
12/10/2025, 7:52 PMVapi Support Bot
12/10/2025, 7:52 PM