For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
contact@agentmail.ccDiscord
DocumentationAPI ReferenceKnowledge BaseChangelog
DocumentationAPI ReferenceKnowledge BaseChangelog
  • API Reference
      • GETList Inboxes
      • GETGet Inbox
      • POSTCreate Inbox
      • PATCHUpdate Inbox
      • DELDelete Inbox
        • GETList Messages
        • GETGet Message
        • POSTBatch Get Messages
        • GETGet Attachment
        • GETGet Raw Message
        • PATCHUpdate Message
        • DELDelete Message
        • POSTSend Message
        • POSTReply To Message
        • POSTReply All Message
        • POSTForward Message
LogoLogo
contact@agentmail.ccDiscord
API ReferenceInboxesMessages

Get Message

GET
/v0/inboxes/:inbox_id/messages/:message_id
GET
/v0/inboxes/:inbox_id/messages/:message_id
1from agentmail import AgentMail
2
3client = AgentMail(
4 api_key="YOUR_TOKEN_HERE",
5)
6
7client.inboxes.messages.get(
8 inbox_id="inbox_id",
9 message_id="message_id",
10)
1{
2 "inbox_id": "inbox_id",
3 "thread_id": "thread_id",
4 "message_id": "message_id",
5 "labels": [
6 "labels",
7 "labels"
8 ],
9 "timestamp": "2024-01-15T09:30:00Z",
10 "from": "from",
11 "to": [
12 "to",
13 "to"
14 ],
15 "size": 1,
16 "updated_at": "2024-01-15T09:30:00Z",
17 "created_at": "2024-01-15T09:30:00Z",
18 "reply_to": [
19 "reply_to",
20 "reply_to"
21 ],
22 "cc": [
23 "cc",
24 "cc"
25 ],
26 "bcc": [
27 "bcc",
28 "bcc"
29 ],
30 "subject": "subject",
31 "preview": "preview",
32 "text": "text",
33 "html": "html",
34 "extracted_text": "extracted_text",
35 "extracted_html": "extracted_html",
36 "attachments": [
37 {
38 "attachment_id": "attachment_id",
39 "size": 1,
40 "filename": "filename",
41 "content_type": "content_type",
42 "content_disposition": "inline",
43 "content_id": "content_id"
44 },
45 {
46 "attachment_id": "attachment_id",
47 "size": 1,
48 "filename": "filename",
49 "content_type": "content_type",
50 "content_disposition": "inline",
51 "content_id": "content_id"
52 }
53 ],
54 "in_reply_to": "in_reply_to",
55 "references": [
56 "references",
57 "references"
58 ],
59 "headers": {
60 "headers": "headers"
61 }
62}
**CLI:** ```bash agentmail inboxes:messages get --inbox-id <inbox_id> --message-id <message_id> ```
Was this page helpful?
Previous

Batch Get Messages

Next
Built with

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 strings

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

cclist of strings

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

bcclist of strings

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

subjectstring
Subject of message.
previewstring
Text preview of message.
textstring
Plain text body of message.
htmlstring
HTML body of message.
extracted_textstring
Extracted new text content.
extracted_htmlstring
Extracted new HTML content.
attachmentslist of objects
Attachments in message.
in_reply_tostring
ID of message being replied to.
referenceslist of strings
IDs of previous messages in thread.
headersmap from strings to strings
Headers in message.

Errors

404
Not Found Error