Threaded conversations
How myagentmail assembles a thread, and how to stay in one when you reply.
How threading works
When a message arrives — inbound or outbound — we look at the RFC 5322 Message-ID, In-Reply-To, and References headers to decide which thread it belongs to:
- If
In-Reply-Tomatches a known message, the new message joins that message's thread. - Otherwise, if any
Referencesheader entry matches, join that thread. - Otherwise, start a new thread with a fresh UUID.
Every message we store has a threadId. You can fetch a whole thread with GET /v1/inboxes/{id}/threads/{threadId}.
Replying inside a thread
Always use the reply endpoints. They do the header plumbing for you:
POST /v1/inboxes/{id}/reply/{messageId}
{
"plainBody": "Thanks — scheduling that call now."
}
The endpoint looks up the original message's Message-ID and References, sets In-Reply-To on the outgoing mail, appends to the References chain, and re-uses the same threadId. The recipient's mail client sees a proper continuation of the same conversation.
If you send with POST /send instead of POST /reply, you start a new thread. Always reach for /reply (or /reply-all, /forward) when the agent is continuing an existing conversation.
Reply-all
POST /reply-all/{messageId} sends to the original sender plus every address in the original To list, with any of your own inbox's accepted addresses filtered out to avoid echoing yourself.
Forward
POST /forward/{messageId} prepends a "Forwarded message" header block and sends the combined body to new recipients. Forwards start a new thread by design.