Overview
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.How Threads Work
Every message in Sendook belongs to a thread:- New conversations automatically create a new thread
- Replies are added to the existing thread
- Each thread contains an ordered list of all messages in the conversation
- Thread detection works automatically using email headers
Threads work similarly to email clients like Gmail, where related messages are grouped together in a conversation view.
Automatic Thread Creation
For Sent Emails
When you send a new email, Sendook automatically creates a thread:For Received Emails
When someone emails your inbox:- First email - Creates a new thread
- Reply to your email - Added to existing thread (detected via email headers)
- New subject - Creates a new thread
Thread Detection Logic
Sendook uses email headers to detect replies and maintain threads:- References header - Contains the message ID of the original email
- In-Reply-To header - References the direct parent message
- Subject matching - Checks for “Re:” prefix and subject similarity
- The message is added to the existing thread
- The thread’s
messagesarray is updated - The
threadIdremains the same
Thread detection works automatically—you don’t need to manually specify thread IDs when sending replies.
Retrieving Threads
List All Threads
Get all threads for an inbox:Get a Specific Thread
Retrieve a thread with all its messages:Reconstructing Conversations
To display a full conversation, combine thread and message data:Thread Properties
Each thread has the following properties:Use Cases
Customer Support Conversations
Customer Support Conversations
Track entire support conversations from initial inquiry to resolution. Display all messages in a thread to support agents for context.
Email Thread Analytics
Email Thread Analytics
Analyze conversation patterns like average thread length, response times, and resolution rates.
Conversation State Management
Conversation State Management
Track the status of conversations (open, pending, resolved) by associating metadata with thread IDs in your database.
Auto-Reply Context
Auto-Reply Context
Use thread history to generate contextual auto-replies with AI.
Working with Replies
When you reply to a message, it’s automatically added to the thread:Thread Lifecycle
- Creation - A new message creates a new thread
- Growth - Replies are added to the thread’s
messagesarray - Persistence - Threads exist permanently (not automatically deleted)
- No deletion endpoint - Currently, threads cannot be manually deleted
Threads are created and updated automatically. There’s no API to manually create or delete threads.
Best Practices
Filtering Messages by Thread
While there’s no direct “filter by thread” endpoint, you can:- Get the thread to retrieve message IDs
- Fetch only the messages you need
Thread Metadata
Threads themselves don’t store metadata like subject, participants, or status. To add custom metadata:Next Steps
Sending Emails
Learn how replies create and update threads
Receiving Emails
Understand thread detection for incoming emails
Webhooks
Use webhooks to track thread activity
API Reference
View complete thread API documentation