Threads group related messages into conversations, making it easy to track email exchanges. Sendook automatically creates and manages threads for both sent and received emails.
Track entire support conversations from initial inquiry to resolution. Display all messages in a thread to support agents for context.
// When a customer repliesconst { payload: message } = webhookData;// Get full conversation historyconst thread = await client.inbox.thread.get( message.inboxId, message.threadId);// Show agent all previous messages for context
Email Thread Analytics
Analyze conversation patterns like average thread length, response times, and resolution rates.
When you reply to a message, it’s automatically added to the thread:
// Original message creates a threadconst originalMessage = await client.inbox.message.send({ inboxId: "inbox_123", to: ["[email protected]"], subject: "Order Confirmation", text: "Your order has been confirmed.", html: "<p>Your order has been confirmed.</p>"});console.log(originalMessage.threadId); // "thread_abc123"// When customer replies, the webhook includes the same threadId// webhookPayload.payload.threadId === "thread_abc123"// Your reply is added to the same threadawait client.inbox.message.reply({ inboxId: "inbox_123", messageId: webhookPayload.payload.id, text: "Thanks for your reply!", html: "<p>Thanks for your reply!</p>"});// All three messages now share the same threadId
Store thread IDs - When building applications, store thread IDs alongside your own data (e.g., support tickets, order IDs) to easily reference conversations.
Use threads for context - When processing webhooks, fetch the thread to understand the full conversation context before responding.
Monitor thread activity - Track the updatedAt timestamp to identify active conversations vs. stale threads.
Display chronologically - The messages array is already in chronological order—use it directly to display conversations.
While there’s no direct “filter by thread” endpoint, you can:
Get the thread to retrieve message IDs
Fetch only the messages you need
// Get specific messages from a threadconst thread = await client.inbox.thread.get("inbox_123", "thread_abc123");// Fetch only the last 3 messagesconst recentMessageIds = thread.messages.slice(-3);const recentMessages = await Promise.all( recentMessageIds.map(id => client.inbox.message.get("inbox_123", id) ));