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

List Messages

GET
/v0/inboxes/:inbox_id/messages
GET
/v0/inboxes/:inbox_id/messages
1from agentmail import AgentMail
2
3client = AgentMail(
4 api_key="YOUR_TOKEN_HERE",
5)
6
7client.inboxes.messages.list(
8 inbox_id="inbox_id",
9)
1{
2 "count": 1,
3 "messages": [
4 {
5 "inbox_id": "inbox_id",
6 "thread_id": "thread_id",
7 "message_id": "message_id",
8 "labels": [
9 "labels",
10 "labels"
11 ],
12 "timestamp": "2024-01-15T09:30:00Z",
13 "from": "from",
14 "to": [
15 "to",
16 "to"
17 ],
18 "size": 1,
19 "updated_at": "2024-01-15T09:30:00Z",
20 "created_at": "2024-01-15T09:30:00Z",
21 "cc": [
22 "cc",
23 "cc"
24 ],
25 "bcc": [
26 "bcc",
27 "bcc"
28 ],
29 "subject": "subject",
30 "preview": "preview",
31 "attachments": [
32 {
33 "attachment_id": "attachment_id",
34 "size": 1,
35 "filename": "filename",
36 "content_type": "content_type",
37 "content_disposition": "inline",
38 "content_id": "content_id"
39 },
40 {
41 "attachment_id": "attachment_id",
42 "size": 1,
43 "filename": "filename",
44 "content_type": "content_type",
45 "content_disposition": "inline",
46 "content_id": "content_id"
47 }
48 ],
49 "in_reply_to": "in_reply_to",
50 "references": [
51 "references",
52 "references"
53 ],
54 "headers": {
55 "headers": "headers"
56 }
57 },
58 {
59 "inbox_id": "inbox_id",
60 "thread_id": "thread_id",
61 "message_id": "message_id",
62 "labels": [
63 "labels",
64 "labels"
65 ],
66 "timestamp": "2024-01-15T09:30:00Z",
67 "from": "from",
68 "to": [
69 "to",
70 "to"
71 ],
72 "size": 1,
73 "updated_at": "2024-01-15T09:30:00Z",
74 "created_at": "2024-01-15T09:30:00Z",
75 "cc": [
76 "cc",
77 "cc"
78 ],
79 "bcc": [
80 "bcc",
81 "bcc"
82 ],
83 "subject": "subject",
84 "preview": "preview",
85 "attachments": [
86 {
87 "attachment_id": "attachment_id",
88 "size": 1,
89 "filename": "filename",
90 "content_type": "content_type",
91 "content_disposition": "inline",
92 "content_id": "content_id"
93 },
94 {
95 "attachment_id": "attachment_id",
96 "size": 1,
97 "filename": "filename",
98 "content_type": "content_type",
99 "content_disposition": "inline",
100 "content_id": "content_id"
101 }
102 ],
103 "in_reply_to": "in_reply_to",
104 "references": [
105 "references",
106 "references"
107 ],
108 "headers": {
109 "headers": "headers"
110 }
111 }
112 ],
113 "limit": 1,
114 "next_page_token": "next_page_token"
115}
**CLI:** ```bash agentmail inboxes:messages list --inbox-id <inbox_id> ```
Was this page helpful?
Previous

Get Message

Next
Built with

CLI:

$agentmail inboxes:messages list --inbox-id <inbox_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.

Query parameters

limitintegerOptional
Limit of number of items returned.
page_tokenstringOptional
Page token for pagination.
labelslist of stringsOptional
Labels to filter by.
beforedatetimeOptional
Timestamp before which to filter by.
afterdatetimeOptional
Timestamp after which to filter by.
ascendingbooleanOptional
Sort in ascending temporal order.
include_spambooleanOptional
Include spam in results.
include_blockedbooleanOptional
Include blocked in results.
include_unauthenticatedbooleanOptional
Include unauthenticated in results.
include_trashbooleanOptional
Include trash in results.

Response

This endpoint returns an object.
countinteger
Number of items returned.
messageslist of objects

Ordered by timestamp descending.

limitinteger
Limit of number of items returned.
next_page_tokenstring
Page token for pagination.

Errors

404
Not Found Error