Who this message is with, and the shape of its conversation
/api/v1/mailbox/messages/{message_id}/contextHeader-only context for one message: the history with its correspondent and the thread it belongs to. Always available — no AI is involved and none is required. A message with no identifiable correspondent (a bounce, a self-note) omits the correspondent block.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
message_idrequired | path | string |
Request
/api/v1/mailbox/messages/{message_id}/contextcurl -X GET 'https://courier.mailyte.com/api/v1/mailbox/messages/01JBT8XQ2M9WYC3K4F6R7S8T9V/context' \
-H 'Authorization: Bearer MAILBOX_TOKEN'const response = await fetch('https://courier.mailyte.com/api/v1/mailbox/messages/01JBT8XQ2M9WYC3K4F6R7S8T9V/context', {
method: 'GET',
headers: {
Authorization: 'Bearer MAILBOX_TOKEN',
},
});
const { data } = await response.json();import requests
response = requests.get(
"https://courier.mailyte.com/api/v1/mailbox/messages/01JBT8XQ2M9WYC3K4F6R7S8T9V/context",
headers={"Authorization": "Bearer MAILBOX_TOKEN"},
)
data = response.json()["data"]<?php
$response = Http::withToken('MAILBOX_TOKEN')
->get('https://courier.mailyte.com/api/v1/mailbox/messages/01JBT8XQ2M9WYC3K4F6R7S8T9V/context');
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://courier.mailyte.com/api/v1/mailbox/messages/01JBT8XQ2M9WYC3K4F6R7S8T9V/context")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer MAILBOX_TOKEN"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
The history with this message’s correspondent, and the shape of its thread.
dataobjectContext for the message.
correspondentis left out for a message with no other person (a bounce, a note to yourself) or a first message from that address;threadis left out when no message in the conversation has a usable date.message_idstringrequiredThe message this context is for, as
Folder:UID— echoed back so a late response can be matched to the message still on screen. Example:INBOX:4821.correspondentobjectYour history with the other party, counted across INBOX and Sent only. Archived or filed mail is not searched, so these are floors, not totals.
emailstringThe other party, lower-cased. On a message you sent this is the recipient, not you.
messages_exchangedintegerMessages from them plus messages to them, in both directions and over all time. 1 means this is the only one.
first_contactstringISO 8601 with offset. The oldest message either way.
last_contactstringISO 8601 with offset. The newest message either way, which is usually the one you are looking at.
you_replied_to_lastbooleanWhether you answered their latest message. Null when they have never written to you.
unanswered_from_themintegerHow many of their messages you have never replied to. Matched by In-Reply-To/References, never by subject.
median_reply_minutesintegerYour median turnaround to this person, in whole minutes. null when you have never replied to them — there is no median of nothing, and 0 would read as "instantly".
threadobjectThe conversation this message sits in, threaded on Message-ID/In-Reply-To/References and deduplicated, so a message you sent is counted once and not twice for its copy in Sent.
messagesintegerDistinct messages in the thread, including this one. Always at least 1.
spans_daysintegerWhole days from the oldest message to the newest. 0 for a conversation that happened within one day.
your_last_replystringWhen you last wrote in this thread, ISO 8601 with offset. null if you have not.
application/json{
"type": "success",
"msg": "Context retrieved successfully",
"data": {
"message_id": "INBOX:4821",
"correspondent": {
"email": "ada@example.com",
"messages_exchanged": 37,
"first_contact": "2025-02-11T09:14:00+00:00",
"last_contact": "2026-09-18T07:41:00+00:00",
"you_replied_to_last": false,
"unanswered_from_them": 2,
"median_reply_minutes": 94
},
"thread": {
"messages": 6,
"spans_days": 12,
"your_last_reply": "2026-09-14T16:02:00+00:00"
}
}
}Returned inside the standard envelope.
Errors
| Status | When |
|---|---|
422 | Validation Error |
Every status, with what causes it and what to do, is on the error reference.