Who this message is with, and the shape of its conversation

GET/api/v1/mailbox/messages/{message_id}/context
Requires amailbox token— it acts as one mailbox holder, not as the organization.

Header-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

NameInTypeDescription
message_idrequiredpathstring

Request

GET/api/v1/mailbox/messages/{message_id}/context
curl -X GET 'https://app.mailyte.com/api/v1/mailbox/messages/01JBT8XQ2M9WYC3K4F6R7S8T9V/context' \
  -H 'Authorization: Bearer MAILBOX_TOKEN'
The key names its own organization, so no X-Organization-ID header is needed.

Response

The history with this message’s correspondent, and the shape of its thread.

  • dataobject

    Both blocks are OMITTED rather than nulled when there is nothing to say, so branch on their presence — `correspondent` is absent for a message with no identifiable other party (a bounce, a note to yourself) or for the first message ever exchanged with that address, and `thread` is absent when no message in the conversation carries a usable date.

    • message_idstringrequired

      The 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`.

    • correspondentobject

      Your history with the other party, counted across INBOX and Sent only. Archived or filed mail is not searched, so these are floors, not totals.

      • emailstring

        The other party, lower-cased. On a message you sent this is the recipient, not you.

      • messages_exchangedinteger

        Messages from them plus messages to them, in both directions and over all time. 1 means this is the only one.

      • first_contactstring

        ISO 8601 with offset. The oldest message either way.

      • last_contactstring

        ISO 8601 with offset. The newest message either way, which is usually the one you are looking at.

      • you_replied_to_lastboolean

        Whether their most recent message has an answer from you. **null means "not applicable", not "no"** — it is null when they have never written to you, so rendering null as "unanswered" accuses someone of ignoring a message that does not exist.

      • unanswered_from_theminteger

        How many of their messages you have never replied to. Matched by In-Reply-To/References, never by subject.

      • median_reply_minutesinteger

        Your 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".

    • threadobject

      The 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.

      • messagesinteger

        Distinct messages in the thread, including this one. Always at least 1.

      • spans_daysinteger

        Whole days from the oldest message to the newest. 0 for a conversation that happened within one day.

      • your_last_replystring

        When you last wrote in this thread, ISO 8601 with offset. null if you have not.

200application/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

StatusWhen
422Validation Error

Every status, with what causes it and what to do, is on the error reference.