Multi-turn email conversations depend on threads. When a human replies to an agent's email, the reply has to arrive in the same thread, or the agent loses the context of the conversation.
How Email Threading Works
Email clients use three headers to link messages into threads:
Message-ID: A unique ID assigned to each emailIn-Reply-To: The Message-ID of the email being replied toReferences: A list of all Message-IDs in the thread
When Gmail, Outlook, or any email client receives a message with In-Reply-To set, it groups the new message with the original in the same thread view.
Sending a Reply with Lumbox
POST /v1/inboxes/{id}/reply
{
"email_id": "eml_abc123", // The email being replied to
"text": "Thanks for your message. Here is what I found...",
"html": "<p>Thanks for your message...</p>"
}
Lumbox automatically sets the correct In-Reply-To and References headers so the reply appears in the same thread for the recipient.
Receiving Replies
When a human replies to the agent's email, Lumbox receives the message on your domain's mail server, detects the threading headers, links the reply to the original thread, and fires a webhook. Your agent can then read the thread:
GET /v1/threads/{thread_id}
Building a Conversational Agent
With threading, an agent can:
- Send an initial email
- Receive a reply from the human
- Process the reply with an LLM
- Send a follow-up reply in the same thread
- Repeat until the task is complete
This is the foundation for agents that handle support tickets, negotiate via email, or conduct research interviews autonomously.