Retrieve a stored message

GET/api/v1/domains/{domain}/messages/{messageId}
Requires anorganization API keywith the scopeevents:read

The archived copy of a message, which is what a webhook's storage.url points at.

messageId is the id exactly as it arrived, angle brackets included. Stripping them returns 404: the archive stores the id as it was received, and a bridge that helpfully removed < and > is why every inbound message 404'd here until 2026-09-14.

Parameters

NameInTypeDescription
domainrequiredpathstringThe domain id, or the domain name itself.
messageIdrequiredpathstringThe message id exactly as it arrived, angle brackets included.

Request

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

Response

Success.

  • dataobject
    • objectstringarchived_message | archived_message_preview

      Which of the two shapes you got. archived_message is the default and carries raw; archived_message_preview is ?format=html and carries the parsed fields instead. Branch on this, never on the presence of a key.

    • message_idstring

      The Message-ID, angle brackets included, as the send returned it.

    • domainstring

      The domain this copy is archived under.

    • archived_atstring

      When the message was archived. Null if the stored copy has no date.

    • legal_holdboolean

      Default shape only. True means retention cannot expire this copy.

    • rawstring

      The raw message (message/rfc822) exactly as stored: headers, body and attachments. It is not made safe, so do not show it in a browser; use ?format=html for that. Not present with ?format=html.

    • headersobject

      ?format=html only. The parsed headers, name to value.

    • htmlstring

      With ?format=html only: the HTML body, made safe to display, with scripts and remote content removed. Null when the message has no HTML part; show text instead.

    • textstring

      With ?format=html only: the plain-text body. Null when the message has no plain-text part. html and text can both be null.

    • attachmentsarray<object>

      With ?format=html only: each attachment's name, type and size, not the file itself.

    • blocked_remote_countinteger

      With ?format=html only: how many remote images or other content were blocked, so you can tell the reader.

Returned inside the standard envelope.

Errors

StatusWhen
401The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist.
403The key is valid but may not do this: it lacks the required scope, its IP allowlist does not include you, or this endpoint does not accept API keys.
404No such resource in this organization.
422The request was understood but the values were not acceptable.
429Too many requests, or the organization has spent its sending allowance. `Retry-After` says how long to wait.

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