Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sam-ayo/recall_sdk/llms.txt

Use this file to discover all available pages before exploring further.

Retrieves all chat messages that were sent during the meeting. This includes messages from all participants.

Method Signature

bot.listChatMessages(params: ListChatMessagesParams): Promise<ChatMessagesResponse>

Parameters

id
string
required
The unique identifier of the bot
cursor
string
Pagination cursor for retrieving the next page of results
ordering
string
Sort order for messages. Use "created_at" for ascending or "-created_at" for descending.

Response

Returns a paginated response with chat messages:
results
array
Array of chat message objects
id
string
Unique identifier for the chat message
sender
string
Name of the message sender
message
string
Content of the chat message
created_at
string
ISO 8601 timestamp when the message was sent
timestamp
number
Timestamp in seconds from the start of the recording
next
string | null
URL or cursor for the next page of results, or null if no more pages
previous
string | null
URL or cursor for the previous page of results, or null if on first page

Example

import { Recall } from '@recall.ai/sdk';

const client = new Recall({
  apiKey: 'your-api-key',
  region: 'us-west-2'
});

// Get chat messages
const chatMessages = await client.bot.listChatMessages({
  id: 'bot_1234567890'
});

console.log(`Total messages: ${chatMessages.results.length}`);

for (const message of chatMessages.results) {
  console.log(`[${message.timestamp}s] ${message.sender}: ${message.message}`);
}

Example: With Ordering

// Get messages in reverse chronological order (newest first)
const recentMessages = await client.bot.listChatMessages({
  id: 'bot_1234567890',
  ordering: '-created_at'
});

console.log('Recent messages:');
for (const message of recentMessages.results.slice(0, 5)) {
  console.log(`${message.sender}: ${message.message}`);
}

Example: Pagination

async function getAllChatMessages(botId: string) {
  const allMessages = [];
  let cursor: string | undefined;
  
  while (true) {
    const response = await client.bot.listChatMessages({
      id: botId,
      cursor
    });
    
    allMessages.push(...response.results);
    
    if (!response.next) {
      break;
    }
    
    // Extract cursor from next URL or use it directly
    cursor = response.next;
  }
  
  console.log(`Retrieved ${allMessages.length} total messages`);
  return allMessages;
}

const allMessages = await getAllChatMessages('bot_1234567890');

Example: Search Chat Messages

async function searchChatMessages(botId: string, searchTerm: string) {
  const chatMessages = await client.bot.listChatMessages({ id: botId });
  
  const matches = chatMessages.results.filter(msg =>
    msg.message.toLowerCase().includes(searchTerm.toLowerCase())
  );
  
  console.log(`Found ${matches.length} messages containing "${searchTerm}"`);
  
  for (const match of matches) {
    console.log(`[${match.timestamp}s] ${match.sender}: ${match.message}`);
  }
  
  return matches;
}

await searchChatMessages('bot_1234567890', 'link');

Example: Export Chat to File

import { writeFile } from 'fs/promises';

async function exportChatToFile(botId: string, filename: string) {
  const chatMessages = await client.bot.listChatMessages({ id: botId });
  
  let content = 'Meeting Chat Export\n';
  content += '='.repeat(50) + '\n\n';
  
  for (const message of chatMessages.results) {
    const time = new Date(message.created_at).toLocaleString();
    content += `[${time}] ${message.sender}:\n${message.message}\n\n`;
  }
  
  await writeFile(filename, content);
  console.log(`Chat exported to ${filename}`);
}

await exportChatToFile('bot_1234567890', 'meeting-chat.txt');

Example: Get Messages by Sender

async function getMessagesBySender(botId: string, senderName: string) {
  const chatMessages = await client.bot.listChatMessages({ id: botId });
  
  const messages = chatMessages.results.filter(msg => 
    msg.sender.toLowerCase().includes(senderName.toLowerCase())
  );
  
  console.log(`Messages from ${senderName}: ${messages.length}`);
  
  for (const message of messages) {
    console.log(`[${message.timestamp}s] ${message.message}`);
  }
  
  return messages;
}

await getMessagesBySender('bot_1234567890', 'John Smith');

Notes

  • Chat messages are available after the meeting ends and the bot status reaches done
  • Not all meeting platforms support chat message capture
  • The timestamp field indicates when the message was sent relative to the recording start
  • Messages are returned in chronological order by default

Build docs developers (and LLMs) love