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 Threads
        • GETGet Thread
        • GETGet Attachment
        • PATCHUpdate Thread
        • DELDelete Thread
LogoLogo
contact@agentmail.ccDiscord
API ReferenceInboxesThreads

Get Thread

GET
/v0/inboxes/:inbox_id/threads/:thread_id
GET
/v0/inboxes/:inbox_id/threads/:thread_id
1from agentmail import AgentMail
2
3client = AgentMail(
4 api_key="YOUR_TOKEN_HERE",
5)
6
7client.inboxes.threads.get(
8 inbox_id="inbox_id",
9 thread_id="thread_id",
10)
1{
2 "inbox_id": "inbox_id",
3 "thread_id": "thread_id",
4 "labels": [
5 "labels",
6 "labels"
7 ],
8 "timestamp": "2024-01-15T09:30:00Z",
9 "senders": [
10 "senders",
11 "senders"
12 ],
13 "recipients": [
14 "recipients",
15 "recipients"
16 ],
17 "last_message_id": "last_message_id",
18 "message_count": 1,
19 "size": 1,
20 "updated_at": "2024-01-15T09:30:00Z",
21 "created_at": "2024-01-15T09:30:00Z",
22 "messages": [
23 {
24 "inbox_id": "inbox_id",
25 "thread_id": "thread_id",
26 "message_id": "message_id",
27 "labels": [
28 "labels",
29 "labels"
30 ],
31 "timestamp": "2024-01-15T09:30:00Z",
32 "from": "from",
33 "to": [
34 "to",
35 "to"
36 ],
37 "size": 1,
38 "updated_at": "2024-01-15T09:30:00Z",
39 "created_at": "2024-01-15T09:30:00Z",
40 "reply_to": [
41 "reply_to",
42 "reply_to"
43 ],
44 "cc": [
45 "cc",
46 "cc"
47 ],
48 "bcc": [
49 "bcc",
50 "bcc"
51 ],
52 "subject": "subject",
53 "preview": "preview",
54 "text": "text",
55 "html": "html",
56 "extracted_text": "extracted_text",
57 "extracted_html": "extracted_html",
58 "attachments": [
59 {
60 "attachment_id": "attachment_id",
61 "size": 1,
62 "filename": "filename",
63 "content_type": "content_type",
64 "content_disposition": "inline",
65 "content_id": "content_id"
66 },
67 {
68 "attachment_id": "attachment_id",
69 "size": 1,
70 "filename": "filename",
71 "content_type": "content_type",
72 "content_disposition": "inline",
73 "content_id": "content_id"
74 }
75 ],
76 "in_reply_to": "in_reply_to",
77 "references": [
78 "references",
79 "references"
80 ],
81 "headers": {
82 "headers": "headers"
83 }
84 },
85 {
86 "inbox_id": "inbox_id",
87 "thread_id": "thread_id",
88 "message_id": "message_id",
89 "labels": [
90 "labels",
91 "labels"
92 ],
93 "timestamp": "2024-01-15T09:30:00Z",
94 "from": "from",
95 "to": [
96 "to",
97 "to"
98 ],
99 "size": 1,
100 "updated_at": "2024-01-15T09:30:00Z",
101 "created_at": "2024-01-15T09:30:00Z",
102 "reply_to": [
103 "reply_to",
104 "reply_to"
105 ],
106 "cc": [
107 "cc",
108 "cc"
109 ],
110 "bcc": [
111 "bcc",
112 "bcc"
113 ],
114 "subject": "subject",
115 "preview": "preview",
116 "text": "text",
117 "html": "html",
118 "extracted_text": "extracted_text",
119 "extracted_html": "extracted_html",
120 "attachments": [
121 {
122 "attachment_id": "attachment_id",
123 "size": 1,
124 "filename": "filename",
125 "content_type": "content_type",
126 "content_disposition": "inline",
127 "content_id": "content_id"
128 },
129 {
130 "attachment_id": "attachment_id",
131 "size": 1,
132 "filename": "filename",
133 "content_type": "content_type",
134 "content_disposition": "inline",
135 "content_id": "content_id"
136 }
137 ],
138 "in_reply_to": "in_reply_to",
139 "references": [
140 "references",
141 "references"
142 ],
143 "headers": {
144 "headers": "headers"
145 }
146 }
147 ],
148 "received_timestamp": "2024-01-15T09:30:00Z",
149 "sent_timestamp": "2024-01-15T09:30:00Z",
150 "subject": "subject",
151 "preview": "preview",
152 "attachments": [
153 {
154 "attachment_id": "attachment_id",
155 "size": 1,
156 "filename": "filename",
157 "content_type": "content_type",
158 "content_disposition": "inline",
159 "content_id": "content_id"
160 },
161 {
162 "attachment_id": "attachment_id",
163 "size": 1,
164 "filename": "filename",
165 "content_type": "content_type",
166 "content_disposition": "inline",
167 "content_id": "content_id"
168 }
169 ]
170}
**CLI:** ```bash agentmail inboxes:threads get --inbox-id <inbox_id> --thread-id <thread_id> ```
Was this page helpful?
Previous

Get Attachment

Next
Built with

CLI:

$agentmail inboxes:threads get --inbox-id <inbox_id> --thread-id <thread_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.
thread_idstringRequired
ID of thread.

Response

This endpoint returns an object.
inbox_idstring
The ID of the inbox.
thread_idstring
ID of thread.
labelslist of strings
Labels of thread.
timestampdatetime
Timestamp of last sent or received message.
senderslist of strings

Senders in thread. In format username@domain.com or Display Name <username@domain.com>.

recipientslist of strings

Recipients in thread. In format username@domain.com or Display Name <username@domain.com>.

last_message_idstring
ID of last message in thread.
message_countinteger
Number of messages in thread.
sizeinteger
Size of thread in bytes.
updated_atdatetime
Time at which thread was last updated.
created_atdatetime
Time at which thread was created.
messageslist of objects

Messages in thread. Ordered by timestamp ascending.

received_timestampdatetime
Timestamp of last received message.
sent_timestampdatetime
Timestamp of last sent message.
subjectstring
Subject of thread.
previewstring
Text preview of last message in thread.
attachmentslist of objects
Attachments in thread.

Errors

404
Not Found Error