Skip to navigation

Get Message

CLI:

agentmail inboxes messages get --inbox-id <inbox_id> --message-id <message_id>

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

inbox_idstringRequired
The ID of the inbox.
message_idstringRequired
ID of message.

Response

This endpoint returns an object.
inbox_idstring
The ID of the inbox.
thread_idstring
ID of thread.
message_idstring
ID of message.
labelslist of strings
Labels of message.
timestampdatetime
Time at which message was sent or drafted.
fromstring

Address of sender. In format username@domain.com or Display Name <username@domain.com>.

tolist of strings

Addresses of recipients. In format username@domain.com or Display Name <username@domain.com>.

sizeinteger
Size of message in bytes.
updated_atdatetime
Time at which message was last updated.
created_atdatetime
Time at which message was created.
reply_tolist of stringsOptional

Reply-to addresses. In format username@domain.com or Display Name <username@domain.com>.

cclist of stringsOptional

Addresses of CC recipients. In format username@domain.com or Display Name <username@domain.com>.

bcclist of stringsOptional

Addresses of BCC recipients. In format username@domain.com or Display Name <username@domain.com>.

subjectstringOptional
Subject of message.
previewstringOptional
Text preview of message.
textstringOptional
Plain text body of message.
htmlstringOptional
HTML body of message.
extracted_textstringOptional
Extracted new text content.
extracted_htmlstringOptional
Extracted new HTML content.
attachmentslist of objectsOptional
Attachments in message.
in_reply_tostringOptional
ID of message being replied to.
calendar_event_idstringOptional

The calendar event this email’s invitation was applied to: set when the email’s calendar invitation, update, cancellation or attendee reply changed the inbox’s calendar, a few seconds after the email arrives. For an email about one date of a recurring event, it is that date’s event ID. Absent on other emails, and on invitations that were not imported. The message.received event for an email with a calendar attachment waits until this is set, at most 20 seconds, so it usually arrives with it. Calendar is available in US production.

track_opensbooleanOptional

true on a sent message that carried the open tracking pixel: it was sent with track_opens and an HTML body. Absent on every other message; it is never false.

opened_atdatetimeOptional

Time at which this message was first opened, the same time the message.opened event reports as open.timestamp. Set together with the opened label, and absent until the first open. Present only on messages with track_opens.

referenceslist of stringsOptional
IDs of previous messages in thread.
headersmap from strings to stringsOptional

Headers in message. Authentication-Results is never included, on received or sent messages: the header is unsigned, so a sender can plant a forged copy. Read authentication_results for the verdicts instead. Get Raw Message still returns every copy of the header.

authentication_resultsobjectOptional

Per-mechanism SPF, DKIM, and DMARC verdicts for a received message, each with the domain it is about, kept only where they speak for the sender’s From identity. A verdict that could not be computed is absent, so the field can be {}. The field is absent on sent messages and on messages received before 2026-09-09; the *_domain and arc_sealer keys appear on messages received after they were introduced.

The verdicts are the ones Amazon SES computed when the message reached AgentMail, with one exception. Forwarded mail fails DMARC at the receiving hop by construction. When AgentMail delivers a forwarded message as authenticated because a trusted forwarder (such as Google or Microsoft) sealed a valid ARC chain vouching for the original, the field reports the verdicts that forwarder recorded for the original message, and arc_sealer names it.

  • spf is about the envelope MAIL FROM (Return-Path) domain, named in spf_domain. It is present only when that domain is aligned with the sender’s domain (the From mailbox, or the Sender header when From spans domains), meaning the two share an organizational domain: mail.example.com is aligned with example.com. An unaligned SPF result is withheld whatever its value.
  • dkim is the DKIM verdict, and dkim_domain the signing domain (the d= tag). On directly received mail the domain is named only when every DKIM signature on the message is from the same domain; a message signed by more than one domain (a sender and its email provider, for instance) keeps the verdict and omits the domain. dkim_domain is the signing domain as written, so compare it with the From domain before relying on it.
  • dmarc is the DMARC verdict for the From domain, named in dmarc_domain.
  • dkim and dmarc are withheld when the From list spans more than one domain or could not be fully parsed.
  • On forwarded mail each sealed verdict is reported only when the domain the forwarder recorded it for matches the message’s current From domain. If the forwarder rewrote From, or vouched for nothing, the field is {}.

The unauthenticated label, not this field, is AgentMail’s acceptance decision, and it uses a looser rule, so the two can disagree: a single-From message whose only pass is an unaligned envelope SPF is delivered without the label while this field shows no pass. Use the label to tell whether AgentMail accepted the message as legitimate, and this field to see which domain each mechanism authenticated. Do not reject mail on dmarc: fail alone.

agent_armorobjectOptionalBeta

Agent Armor’s result for this message. Present only on messages received while Agent Armor was on for your organization. A scan starts pending and usually completes within seconds. message.security.completed is sent only for complete results, so a message still pending at deadline_at reads unavailable with no event.

Errors

404
Not Found Error