agentmail 0.1.9 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/apiKeys/client/Client.js +1 -3
  3. package/dist/cjs/api/resources/domains/client/Client.js +1 -3
  4. package/dist/cjs/api/resources/drafts/client/Client.js +1 -6
  5. package/dist/cjs/api/resources/events/types/MessageReceivedEvent.d.ts +1 -0
  6. package/dist/cjs/api/resources/inboxes/client/Client.js +2 -6
  7. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +4 -15
  8. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +15 -0
  9. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +105 -15
  10. package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.js +1 -3
  11. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +1 -6
  12. package/dist/cjs/api/resources/messages/types/Message.d.ts +1 -0
  13. package/dist/cjs/api/resources/messages/types/MessageHeaders.d.ts +4 -0
  14. package/dist/cjs/api/resources/messages/types/MessageHeaders.js +3 -0
  15. package/dist/cjs/api/resources/messages/types/MessageItem.d.ts +1 -0
  16. package/dist/cjs/api/resources/messages/types/ReplyAll.d.ts +4 -0
  17. package/dist/cjs/api/resources/messages/types/ReplyAll.js +3 -0
  18. package/dist/cjs/api/resources/messages/types/ReplyAllMessageRequest.d.ts +9 -0
  19. package/dist/cjs/api/resources/messages/types/ReplyAllMessageRequest.js +3 -0
  20. package/dist/cjs/api/resources/messages/types/ReplyToMessageRequest.d.ts +1 -0
  21. package/dist/cjs/api/resources/messages/types/index.d.ts +3 -0
  22. package/dist/cjs/api/resources/messages/types/index.js +3 -0
  23. package/dist/cjs/api/resources/metrics/client/Client.js +1 -3
  24. package/dist/cjs/api/resources/pods/client/Client.js +1 -3
  25. package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +2 -9
  26. package/dist/cjs/api/resources/pods/resources/drafts/client/Client.js +1 -6
  27. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +2 -9
  28. package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +1 -6
  29. package/dist/cjs/api/resources/threads/client/Client.js +1 -6
  30. package/dist/cjs/api/resources/webhooks/client/Client.js +1 -3
  31. package/dist/cjs/serialization/resources/events/types/MessageReceivedEvent.d.ts +2 -0
  32. package/dist/cjs/serialization/resources/events/types/MessageReceivedEvent.js +2 -0
  33. package/dist/cjs/serialization/resources/messages/types/Message.d.ts +2 -0
  34. package/dist/cjs/serialization/resources/messages/types/Message.js +2 -0
  35. package/dist/cjs/serialization/resources/messages/types/MessageHeaders.d.ts +7 -0
  36. package/dist/cjs/serialization/resources/messages/types/MessageHeaders.js +39 -0
  37. package/dist/cjs/serialization/resources/messages/types/MessageItem.d.ts +2 -0
  38. package/dist/cjs/serialization/resources/messages/types/MessageItem.js +2 -0
  39. package/dist/cjs/serialization/resources/messages/types/ReplyAll.d.ts +7 -0
  40. package/dist/cjs/serialization/resources/messages/types/ReplyAll.js +39 -0
  41. package/dist/cjs/serialization/resources/messages/types/ReplyAllMessageRequest.d.ts +20 -0
  42. package/dist/cjs/serialization/resources/messages/types/ReplyAllMessageRequest.js +52 -0
  43. package/dist/cjs/serialization/resources/messages/types/ReplyToMessageRequest.d.ts +2 -0
  44. package/dist/cjs/serialization/resources/messages/types/ReplyToMessageRequest.js +2 -0
  45. package/dist/cjs/serialization/resources/messages/types/index.d.ts +3 -0
  46. package/dist/cjs/serialization/resources/messages/types/index.js +3 -0
  47. package/dist/cjs/version.d.ts +1 -1
  48. package/dist/cjs/version.js +1 -1
  49. package/dist/esm/BaseClient.mjs +2 -2
  50. package/dist/esm/api/resources/apiKeys/client/Client.mjs +1 -3
  51. package/dist/esm/api/resources/domains/client/Client.mjs +1 -3
  52. package/dist/esm/api/resources/drafts/client/Client.mjs +1 -6
  53. package/dist/esm/api/resources/events/types/MessageReceivedEvent.d.mts +1 -0
  54. package/dist/esm/api/resources/inboxes/client/Client.mjs +2 -6
  55. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +4 -15
  56. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +15 -0
  57. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +105 -15
  58. package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.mjs +1 -3
  59. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +1 -6
  60. package/dist/esm/api/resources/messages/types/Message.d.mts +1 -0
  61. package/dist/esm/api/resources/messages/types/MessageHeaders.d.mts +4 -0
  62. package/dist/esm/api/resources/messages/types/MessageHeaders.mjs +2 -0
  63. package/dist/esm/api/resources/messages/types/MessageItem.d.mts +1 -0
  64. package/dist/esm/api/resources/messages/types/ReplyAll.d.mts +4 -0
  65. package/dist/esm/api/resources/messages/types/ReplyAll.mjs +2 -0
  66. package/dist/esm/api/resources/messages/types/ReplyAllMessageRequest.d.mts +9 -0
  67. package/dist/esm/api/resources/messages/types/ReplyAllMessageRequest.mjs +2 -0
  68. package/dist/esm/api/resources/messages/types/ReplyToMessageRequest.d.mts +1 -0
  69. package/dist/esm/api/resources/messages/types/index.d.mts +3 -0
  70. package/dist/esm/api/resources/messages/types/index.mjs +3 -0
  71. package/dist/esm/api/resources/metrics/client/Client.mjs +1 -3
  72. package/dist/esm/api/resources/pods/client/Client.mjs +1 -3
  73. package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +2 -9
  74. package/dist/esm/api/resources/pods/resources/drafts/client/Client.mjs +1 -6
  75. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +2 -9
  76. package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +1 -6
  77. package/dist/esm/api/resources/threads/client/Client.mjs +1 -6
  78. package/dist/esm/api/resources/webhooks/client/Client.mjs +1 -3
  79. package/dist/esm/serialization/resources/events/types/MessageReceivedEvent.d.mts +2 -0
  80. package/dist/esm/serialization/resources/events/types/MessageReceivedEvent.mjs +2 -0
  81. package/dist/esm/serialization/resources/messages/types/Message.d.mts +2 -0
  82. package/dist/esm/serialization/resources/messages/types/Message.mjs +2 -0
  83. package/dist/esm/serialization/resources/messages/types/MessageHeaders.d.mts +7 -0
  84. package/dist/esm/serialization/resources/messages/types/MessageHeaders.mjs +3 -0
  85. package/dist/esm/serialization/resources/messages/types/MessageItem.d.mts +2 -0
  86. package/dist/esm/serialization/resources/messages/types/MessageItem.mjs +2 -0
  87. package/dist/esm/serialization/resources/messages/types/ReplyAll.d.mts +7 -0
  88. package/dist/esm/serialization/resources/messages/types/ReplyAll.mjs +3 -0
  89. package/dist/esm/serialization/resources/messages/types/ReplyAllMessageRequest.d.mts +20 -0
  90. package/dist/esm/serialization/resources/messages/types/ReplyAllMessageRequest.mjs +16 -0
  91. package/dist/esm/serialization/resources/messages/types/ReplyToMessageRequest.d.mts +2 -0
  92. package/dist/esm/serialization/resources/messages/types/ReplyToMessageRequest.mjs +2 -0
  93. package/dist/esm/serialization/resources/messages/types/index.d.mts +3 -0
  94. package/dist/esm/serialization/resources/messages/types/index.mjs +3 -0
  95. package/dist/esm/version.d.mts +1 -1
  96. package/dist/esm/version.mjs +1 -1
  97. package/dist/llms-full.txt +1683 -317
  98. package/dist/llms.txt +4 -2
  99. package/package.json +1 -1
  100. package/reference.md +65 -0
@@ -2,9 +2,11 @@
2
2
 
3
3
  > Your starting point for building with the AgentMail API.
4
4
 
5
- <Tip title="Welcome to AgentMail!" icon="fa-solid fa-star">
6
- We're excited to have you onboard!
7
- </Tip>
5
+ <Tip title="Welcome to AgentMail!" icon="fa-solid fa-star" />
6
+
7
+ <Frame caption="We're excited to have you onboard!">
8
+ <img src="file:e3f88ce1-e53f-439a-aeac-faf190593e5b" alt="We're excited to have you onboard!" />
9
+ </Frame>
8
10
 
9
11
  AgentMail is an API platform for giving AI agents their own inboxes to send, receive, and act upon emails. This allows agents to assume their own identity and communicate via the universal protocol of email with services, people, and other agents.
10
12
 
@@ -169,7 +171,7 @@ This guide will walk you through installing the AgentMail SDK, authenticating wi
169
171
  <Step title="Create an API Key">
170
172
  Now that you're in the console, you'll need to create an API key to
171
173
  authenticate your requests. Navigate to the API Keys section in your console
172
- dashboard. ![API Key Creation Screenshot](file:b6a2250c-78ed-4c96-ae69-b8601bae53b8) Click
174
+ dashboard. ![API Key Creation Screenshot](file:2fa577e4-6c00-4f62-ae2b-9ba5079d20cb) Click
173
175
  "Create New API Key" and give it a descriptive name. Once created, copy the
174
176
  API key and store it securely. Create a `.env` file in your project's root
175
177
  directory and add your key to it. We recommend using environment variables to
@@ -272,7 +274,7 @@ This guide will walk you through installing the AgentMail SDK, authenticating wi
272
274
  python quickstart.py
273
275
  ```
274
276
 
275
- ```bash title="Node"
277
+ ```bash title="TypeScript"
276
278
  npx ts-node quickstart.ts
277
279
  ```
278
280
  </CodeBlocks>
@@ -320,7 +322,7 @@ Unlike traditional email providers that are designed for human scale, AgentMail
320
322
 
321
323
  As the diagram below illustrates, your `organization` is the top-level container that holds all your resources. You can provision many `Inboxes` within your `organization`, each with its own `Threads`, `Messages`, and `Attachments`, allowing you to manage a large fleet of agents seamlessly.
322
324
 
323
- <img src="file:4479b8d5-647b-428f-9c43-5202aafa5175" alt="AgentMail Organizational Hierarchy" />
325
+ <img src="file:6419a54d-fe30-4f23-b249-ac2842dc7b83" alt="AgentMail Organizational Hierarchy" />
324
326
 
325
327
  <Steps>
326
328
  <Step title="Organization">
@@ -355,7 +357,7 @@ As the diagram below illustrates, your `organization` is the top-level container
355
357
 
356
358
  ## Core Capabilities
357
359
 
358
- Here at AgentMail we've now made an `Inbox` is an API resource, meaning you can perform standard CRUD operations on it. Here are the core capabilities you'll use to manage your `Inboxes`.
360
+ Here at AgentMail we've now made an `Inbox` an API resource, meaning you can perform standard CRUD operations on it. Here are the core capabilities you'll use to manage your `Inboxes`.
359
361
 
360
362
  <CodeBlocks>
361
363
  ```python
@@ -740,7 +742,7 @@ Here is an example of a well-structured and styled HTML header:
740
742
  </CodeBlocks>
741
743
 
742
744
  <Frame caption="Look how pretty this message looks!">
743
- <img src="file:a3eb4249-4892-4a88-b6d3-9bcaa7e79044" alt="rendered css" />
745
+ <img src="file:10d09a4f-c2d8-4127-899a-025a124b54f1" alt="rendered css" />
744
746
  </Frame>
745
747
 
746
748
  ## Receiving `Messages`
@@ -1143,7 +1145,7 @@ This is where `Labels` become truly powerful. You can list `Threads`, `Messages`
1143
1145
 
1144
1146
  ## What are `Attachments`?
1145
1147
 
1146
- An `Attachment` is a file that is associated with a `Message`. This can be anything from a PDF invoice to a CSV report or an image(though we don't recommend sending images in the first email sent. We go more into this in the [deliverability section](/deliverability)). Your agents can both send `Attachments` in outgoing `Messages` and process `Attachments` from incoming `Messages`.
1148
+ An `Attachment` is a file that is associated with a `Message`. This can be anything from a PDF invoice to a CSV report or an image(though we don't recommend sending images in the first email sent. We go more into this in the [deliverability section](/email-deliverability)). Your agents can both send `Attachments` in outgoing `Messages` and process `Attachments` from incoming `Messages`.
1147
1149
 
1148
1150
  ## Sending `Attachments`
1149
1151
 
@@ -1166,15 +1168,15 @@ To send a file, you include it in an `Attachments` array when sending a `Message
1166
1168
  encoded_content = base64.b64encode(file_content.encode()).decode()
1167
1169
 
1168
1170
  sent_message = client.inboxes.messages.send(
1169
- inbox_id="reports@agentmail.to",
1170
- to=["supervisor@example.com"],
1171
- subject="Q4 Financial Report",
1172
- text="Please see the attached report.",
1173
- attachments=[{
1174
- "content": encoded_content,
1175
- "filename": "Q4-report.txt",
1176
- "content_type": "text/plain"
1177
- }]
1171
+ inbox_id="reports@agentmail.to",
1172
+ to=["supervisor@example.com"],
1173
+ subject="Q4 Financial Report",
1174
+ text="Please see the attached report.",
1175
+ attachments=[{
1176
+ "content": encoded_content,
1177
+ "filename": "Q4-report.txt",
1178
+ "content_type": "text/plain"
1179
+ }]
1178
1180
  )
1179
1181
 
1180
1182
  ```
@@ -1215,15 +1217,15 @@ If you know the `Message` an `Attachment` belongs to, you can retrieve it direct
1215
1217
  attachment_id = "attach_789" # From the message object
1216
1218
 
1217
1219
  file_data = client.inboxes.messages.get_attachment(
1218
- inbox_id=inbox_id,
1219
- message_id=message_id,
1220
- attachment_id=attachment_id
1220
+ inbox_id=inbox_id,
1221
+ message_id=message_id,
1222
+ attachment_id=attachment_id
1221
1223
  )
1222
1224
 
1223
1225
  # Now you can save the file
1224
1226
 
1225
1227
  with open("downloaded_file.pdf", "wb") as f:
1226
- f.write(file_data)
1228
+ f.write(file_data)
1227
1229
 
1228
1230
  ```
1229
1231
 
@@ -1979,7 +1981,7 @@ Configuring your domain is a three-step process: add the domain via API, copy th
1979
1981
  After creating your domain in the AgentMail Console, click the "Download BIND Zone File" button to get the complete zone file.
1980
1982
 
1981
1983
  <Frame caption="Downloading BIND zone file from AgentMail Console">
1982
- <img src="file:9be82773-96e6-4707-90e4-049e00ecc897" alt="Download BIND Zone File from Console" />
1984
+ <img src="file:bc58b8c2-8e6f-4282-82ae-d5bab90972e4" alt="Download BIND Zone File from Console" />
1983
1985
  </Frame>
1984
1986
 
1985
1987
  <Tabs>
@@ -1990,13 +1992,13 @@ Configuring your domain is a three-step process: add the domain via API, copy th
1990
1992
  2. Click **"Import zone file"** in the top right corner
1991
1993
 
1992
1994
  <Frame caption="Importing BIND zone file in AWS Route 53">
1993
- <img src="file:52e201a6-6877-492d-8ceb-d68103640c2d" alt="AWS Route 53 BIND Import" />
1995
+ <img src="file:b13c1ad1-3e9a-4673-992c-fb5ef7d689aa" alt="AWS Route 53 BIND Import" />
1994
1996
  </Frame>
1995
1997
 
1996
1998
  3. Paste the CONTENTS of downloaded BIND zone file
1997
1999
 
1998
2000
  <Frame caption="Open the file with text editor and paste the contents. It should look similar to what we have in this image.">
1999
- <img src="file:6afc53aa-83cf-47c5-b751-b2ff42f86fc9" alt="AWS Route 53 BIND Import" />
2001
+ <img src="file:c44a24d3-4c13-4dc0-a0c8-1acbff875faf" alt="AWS Route 53 BIND Import" />
2000
2002
  </Frame>
2001
2003
 
2002
2004
  4. Review the records and click **"Import"**
@@ -2009,13 +2011,13 @@ Configuring your domain is a three-step process: add the domain via API, copy th
2009
2011
  2. Navigate to **DNS > Records**
2010
2012
 
2011
2013
  <Frame caption="This is what the page looks like">
2012
- <img src="file:a5aac2ea-d73e-4931-b5b9-ff49cecc4f1e" alt="Cloudflare BIND Import" />
2014
+ <img src="file:780cb57b-57ac-4019-93e9-56db287eadaa" alt="Cloudflare BIND Import" />
2013
2015
  </Frame>
2014
2016
 
2015
2017
  3. Click **"Import and Export"**
2016
2018
 
2017
2019
  <Frame caption="You should be able to just drop the file in">
2018
- <img src="file:d92b7899-42d5-4622-8a7c-93c3dfde145d" alt="Cloudflare BIND Import" />
2020
+ <img src="file:ff8604b6-bc3f-4665-b21e-35753a033a93" alt="Cloudflare BIND Import" />
2019
2021
  </Frame>
2020
2022
 
2021
2023
  4. Upload the downloaded BIND zone file as is
@@ -2028,13 +2030,13 @@ Configuring your domain is a three-step process: add the domain via API, copy th
2028
2030
  2. Navigate to the **DNS** subtab of the domain you want to send from
2029
2031
 
2030
2032
  <Frame caption="Click on this button!">
2031
- <img src="file:dd25616b-848d-43b5-98da-91f256c8c435" alt="Porkbun DNS Management" />
2033
+ <img src="file:e68ed8f1-092a-40cc-971d-adb5bcd868cc" alt="Porkbun DNS Management" />
2032
2034
  </Frame>
2033
2035
 
2034
2036
  3. Scroll down to the quick upload section
2035
2037
 
2036
2038
  <Frame caption="Upload your BIND zone file here">
2037
- <img src="file:807e2a16-6fe3-4fce-bdf8-cd5333ef8459" alt="Porkbun Zone File Import" />
2039
+ <img src="file:5d596ae8-43ee-4c8a-af62-459f250b7301" alt="Porkbun Zone File Import" />
2038
2040
  </Frame>
2039
2041
 
2040
2042
  4. Upload the downloaded BIND zone file as is
@@ -2118,7 +2120,7 @@ Configuring your domain is a three-step process: add the domain via API, copy th
2118
2120
  * **Value:** Can directly copy paste the `value` from the API response (e.g., `{random_letters_numbers}.dkim.amazonses.com`).
2119
2121
 
2120
2122
  <Frame caption="Example of adding a CNAME record in Route 53. Notice that AWS already appends the root domain (agentmail.cc) to the end of the name value!">
2121
- <img src="file:8f29da71-dcd0-42e2-9d1d-ffd6fbc5fa62" alt="AWS Route 53 Record Configuration" />
2123
+ <img src="file:496e2c29-5f47-4ab0-8f86-752e2b9ee25e" alt="AWS Route 53 Record Configuration" />
2122
2124
  </Frame>
2123
2125
 
2124
2126
  * **TXT (DMARC/SPF):**
@@ -2553,39 +2555,47 @@ When AgentMail sends a webhook, the payload will have the following structure.
2553
2555
 
2554
2556
  # Webhook Events
2555
2557
 
2556
- > A complete reference of the AgentMail webhook event and its payload.
2558
+ As mentioned in the overview, webhooks allow us to create event-driven applications.
2557
2559
 
2558
- When you create a webhook, you subscribe to events from AgentMail. As of now, AgentMail supports a single event type: `message.received`. This event is your primary trigger for all agent-based workflows. We will be adding more event types in the future.
2560
+ AgentMail supports multiple event types that allow you to build comprehensive, event-driven workflows for your email agents.
2559
2561
 
2560
2562
  All webhook payloads follow the same basic structure:
2561
2563
 
2562
2564
  ```json
2563
2565
  {
2564
- "event": "event.name",
2565
- "data": {
2566
- // ... event-specific data object
2567
- }
2566
+ "type": "event",
2567
+ "event_type": "event.name",
2568
+ "event_id": "evt_123abc..."
2569
+ // ... event-specific data object
2568
2570
  }
2569
2571
  ```
2570
2572
 
2571
- ## Message Event
2572
-
2573
- The `message.received` event is triggered whenever a new email is successfully received and processed in one of your `Inboxes`.
2573
+ ## Message Events
2574
2574
 
2575
2575
  ### `message.received`
2576
2576
 
2577
- * **Description:** This is the main trigger to kick off your agent's workflow. Use this event to fetch the full message content, process it, and decide on the next action, such as generating a reply.
2578
- * **Use Case:** Instantly kick off an agent's workflow to process and reply to an incoming email.
2577
+ * **Description:** Triggered whenever a new email is successfully received and processed in one of your `Inboxes`. This is the most common trigger to kick off agent workflows.
2578
+ * **Example use-case:** Kick off a internal workflow when a customer complaint email hits the support inbox
2579
+
2580
+ <Callout>
2581
+ Something here to notice is message.received is the only webhook event that
2582
+ includes both the metadata on the `Thread` and the `Message` in the payload.
2583
+ Other event types send only metadata on the event. Let us know if you need
2584
+ metadata on other event types by emailing `support@agentmail.cc`
2585
+ </Callout>
2579
2586
 
2580
2587
  <CodeGroup>
2581
2588
  ```json
2582
2589
  {
2583
- "event": "message.received",
2584
- "data": {
2585
- "id": "msg_123abc",
2586
- "object": "message",
2590
+ "type": "event",
2591
+ "event_type": "message.received",
2592
+ "event_id": "evt_123abc",
2593
+ "message": {
2587
2594
  "inbox_id": "inbox_456def",
2588
2595
  "thread_id": "thd_789ghi",
2596
+ "message_id": "msg_123abc",
2597
+ "labels": ["received"],
2598
+ "timestamp": "2023-10-27T10:00:00Z",
2589
2599
  "from": [
2590
2600
  {
2591
2601
  "name": "Jane Doe",
@@ -2599,28 +2609,206 @@ The `message.received` event is triggered whenever a new email is successfully r
2599
2609
  }
2600
2610
  ],
2601
2611
  "subject": "Question about my account",
2612
+ "preview": "A short preview of the email text...",
2613
+ "text": "The full text body of the email.",
2614
+ "html": "<html>...</html>",
2602
2615
  "created_at": "2023-10-27T10:00:00Z"
2603
- // ... and other message properties
2616
+ },
2617
+ "thread": {
2618
+ // ... thread properties
2604
2619
  }
2605
2620
  }
2606
2621
  ```
2607
2622
  </CodeGroup>
2608
2623
 
2609
- ## Future Events
2624
+ ### `message.sent`
2610
2625
 
2611
- We are working on expanding our event offerings. In the future, you can expect to see events related to email delivery status, such as:
2626
+ * **Description:** Triggered when a message is successfully sent from one of your `Inboxes`.
2627
+ * **Use Case:** Track outgoing messages, update your database, or trigger follow-up workflows after sending.
2612
2628
 
2613
- * `delivery.success`
2614
- * `delivery.bounced`
2615
- * `delivery.complained`
2616
- * and much more...
2629
+ <CodeGroup>
2630
+ ```json
2631
+ {
2632
+ "type": "event",
2633
+ "event_type": "message.sent",
2634
+ "event_id": "evt_456def",
2635
+ "send": {
2636
+ "inbox_id": "inbox_456def",
2637
+ "thread_id": "thd_789ghi",
2638
+ "message_id": "msg_123abc",
2639
+ "timestamp": "2023-10-27T10:05:00Z",
2640
+ "recipients": [
2641
+ "recipient@example.com"
2642
+ ]
2643
+ }
2644
+ }
2645
+ ```
2646
+ </CodeGroup>
2617
2647
 
2618
- Stay tuned for updates as we roll out these new features!
2648
+ ### `message.delivered`
2619
2649
 
2620
- If you have any specific webhook notifications you would like, please ping us in the `#feature-requests` channel in the [Discord](https://discord.gg/hTYatWYWBc)
2650
+ * **Description:** Triggered when a sent message is successfully delivered to the recipient's mail server.
2651
+ * **Use Case:** Confirm successful delivery, update message status, or trigger delivery confirmation workflows.
2621
2652
 
2622
- ```
2623
- ```
2653
+ <CodeGroup>
2654
+ ```json
2655
+ {
2656
+ "type": "event",
2657
+ "event_type": "message.delivered",
2658
+ "event_id": "evt_789ghi",
2659
+ "delivery": {
2660
+ "inbox_id": "inbox_456def",
2661
+ "thread_id": "thd_789ghi",
2662
+ "message_id": "msg_123abc",
2663
+ "timestamp": "2023-10-27T10:06:00Z",
2664
+ "recipients": [
2665
+ "recipient@example.com"
2666
+ ]
2667
+ }
2668
+ }
2669
+ ```
2670
+ </CodeGroup>
2671
+
2672
+ <AccordionGroup>
2673
+ <Accordion title="What is the difference between `message.sent` and `message.delivered?`" defaultOpen={true}>
2674
+ `message.sent` means the message has succesfully left our servers and is out
2675
+ to travel the network. This is typically happens before `message.delivered`
2676
+ where `message.delivered` means the recieving email server(whether its Gmail
2677
+ or Outlook) gives us the `200 OK` saying the email has been received. What
2678
+ they do with the email after is unknown.
2679
+ </Accordion>
2680
+
2681
+ <Accordion title="Does `message.delivered` mean I landed in their inbox?">
2682
+ Nope. As mentioned `message.delivered` means the receiving email server,
2683
+ whether it's Gmail or Outlook tells us "Hey AgentMail, we got your email,
2684
+ we'll take it from here!". They typically have their own properitary
2685
+ algorithms to determine whether the email is going to end up in the inbox or
2686
+ spam, but rest assured we handle everything needed for providers like Gmail
2687
+ to deem the emails primary inbox worthy
2688
+ </Accordion>
2689
+ </AccordionGroup>
2690
+
2691
+ ### `message.bounced`
2692
+
2693
+ * **Description:** Triggered when a sent message fails to deliver and bounces back. Includes bounce type and sub-type information.
2694
+ * **Use Case:** Handle bounced emails, update recipient status, or trigger bounce handling workflows.
2695
+
2696
+ <CodeGroup>
2697
+ ```json
2698
+ {
2699
+ "type": "event",
2700
+ "event_type": "message.bounced",
2701
+ "event_id": "evt_012jkl",
2702
+ "bounce": {
2703
+ "inbox_id": "inbox_456def",
2704
+ "thread_id": "thd_789ghi",
2705
+ "message_id": "msg_123abc",
2706
+ "timestamp": "2023-10-27T10:07:00Z",
2707
+ "type": "Permanent",
2708
+ "sub_type": "General",
2709
+ "recipients": [
2710
+ {
2711
+ "address": "invalid@example.com",
2712
+ "status": "bounced"
2713
+ }
2714
+ ]
2715
+ }
2716
+ }
2717
+ ```
2718
+ </CodeGroup>
2719
+
2720
+ ### `message.complained`
2721
+
2722
+ * **Description:** Triggered when a recipient marks your message as spam or files a complaint.
2723
+ * **Use Case:** Handle spam complaints, update sender reputation, or trigger complaint handling workflows.
2724
+
2725
+ <CodeGroup>
2726
+ ```json
2727
+ {
2728
+ "type": "event",
2729
+ "event_type": "message.complained",
2730
+ "event_id": "evt_345mno",
2731
+ "complaint": {
2732
+ "inbox_id": "inbox_456def",
2733
+ "thread_id": "thd_789ghi",
2734
+ "message_id": "msg_123abc",
2735
+ "timestamp": "2023-10-27T10:08:00Z",
2736
+ "type": "abuse",
2737
+ "sub_type": "spam",
2738
+ "recipients": [
2739
+ "complainer@example.com"
2740
+ ]
2741
+ }
2742
+ }
2743
+ ```
2744
+ </CodeGroup>
2745
+
2746
+ ### `message.rejected`
2747
+
2748
+ * **Description:** Triggered when a message is rejected before being sent, typically due to validation errors or policy violations.
2749
+ * **Use Case:** Handle rejected messages, log rejection reasons, or trigger validation workflows.
2750
+
2751
+ <CodeGroup>
2752
+ ```json
2753
+ {
2754
+ "type": "event",
2755
+ "event_type": "message.rejected",
2756
+ "event_id": "evt_678pqr",
2757
+ "reject": {
2758
+ "inbox_id": "inbox_456def",
2759
+ "thread_id": "thd_789ghi",
2760
+ "message_id": "msg_123abc",
2761
+ "timestamp": "2023-10-27T10:09:00Z",
2762
+ "reason": "Invalid recipient address"
2763
+ }
2764
+ }
2765
+ ```
2766
+ </CodeGroup>
2767
+
2768
+ <Warning>
2769
+ If you send an email to a `bounced` address, `rejected` address, or
2770
+ `complained` address we prevent you from sending to this email address ever
2771
+ again to keep bounce rates low. Make sure to keep your account bounce rate
2772
+ under 4%, otherwise we will put your account under review.
2773
+ </Warning>
2774
+
2775
+ ## Domain Events
2776
+
2777
+ ### `domain.verified`
2778
+
2779
+ * **Description:** Triggered when a domain is successfully verified and ready to use for sending emails.
2780
+ * **Use Case:** Automatically enable domain-specific features, update domain status, or trigger post-verification workflows.
2781
+
2782
+ <CodeGroup>
2783
+ ```json
2784
+ {
2785
+ "type": "event",
2786
+ "event_type": "domain.verified",
2787
+ "event_id": "evt_901stu",
2788
+ "domain": {
2789
+ "domain_id": "dom_123abc",
2790
+ "status": "verified",
2791
+ "feedback_enabled": true,
2792
+ "records": [
2793
+ // ... DNS verification records
2794
+ ],
2795
+ "created_at": "2023-10-27T09:00:00Z",
2796
+ "updated_at": "2023-10-27T10:00:00Z"
2797
+ }
2798
+ }
2799
+ ```
2800
+ </CodeGroup>
2801
+
2802
+ ## Event Filtering
2803
+
2804
+ When creating a webhook, you can specify which events to subscribe to. This allows you to:
2805
+
2806
+ * Reduce webhook traffic by only subscribing to events you need
2807
+ * Create specialized webhooks for specific workflows
2808
+
2809
+ For example, if you only need to trigger workflows on incoming messages, you can subscribe to just `message.received`. If you're building a delivery tracking system, you might subscribe to `message.sent`, `message.delivered`, and `message.bounced`.
2810
+
2811
+ If you have any specific webhook notifications you would like, please ping us in the `#feature-requests` channel in the [Discord](https://discord.gg/hTYatWYWBc)
2624
2812
 
2625
2813
 
2626
2814
  # Webhook Setup Guide
@@ -2654,13 +2842,13 @@ Ngrok creates a secure tunnel from a public URL to your local development server
2654
2842
 
2655
2843
  Visit [ngrok.com](https://ngrok.com/) and click "Sign up" to create a free account.
2656
2844
 
2657
- <img src="file:3be3ba9b-4849-4adb-85b5-b1dd53489224" alt="Ngrok homepage" />
2845
+ <img src="file:12e912a8-9a87-4eca-bf52-b8b22ca64196" alt="Ngrok homepage" />
2658
2846
 
2659
2847
  ### 1.2 Choose your platform and install
2660
2848
 
2661
2849
  After logging in, ngrok will guide you through the setup process. Select your operating system and follow the installation instructions.
2662
2850
 
2663
- <img src="file:3606f774-41a5-4e9a-b513-8818ded10a21" alt="Ngrok setup instructions" />
2851
+ <img src="file:36deb6da-c444-4272-9156-2afdfe357619" alt="Ngrok setup instructions" />
2664
2852
 
2665
2853
  For macOS, you can install ngrok via Homebrew:
2666
2854
 
@@ -2706,7 +2894,7 @@ ngrok http 3000
2706
2894
 
2707
2895
  You should see output similar to this:
2708
2896
 
2709
- <img src="file:99864be8-6721-4b52-bae1-981cee8bd478" alt="Ngrok terminal output" />
2897
+ <img src="file:f0447993-8b76-4dad-af12-a208a27dba82" alt="Ngrok terminal output" />
2710
2898
 
2711
2899
  Copy the **Forwarding URL** (e.g., `https://your-subdomain.ngrok-free.app`). This is the public URL that AgentMail will use to send webhooks.
2712
2900
 
@@ -2803,7 +2991,7 @@ python webhook_receiver.py
2803
2991
 
2804
2992
  Open your browser and visit `http://127.0.0.1:3000` to see the status page confirming your webhook receiver is running:
2805
2993
 
2806
- <img src="file:65bc3605-d0f1-41cc-bd3c-7c6138eed70c" alt="Webhook receiver status page" />
2994
+ <img src="file:10c88199-7f82-479b-ab0a-eb727623ef3c" alt="Webhook receiver status page" />
2807
2995
 
2808
2996
  ## Testing Your Setup
2809
2997
 
@@ -2871,189 +3059,564 @@ For production deployments:
2871
3059
  </CardGroup>
2872
3060
 
2873
3061
 
2874
- # Email Deliverability
2875
-
2876
- > Learn the strategies and best practices for maximizing your email deliverability with AgentMail.
3062
+ # WebSockets
2877
3063
 
2878
- ## What is Email Deliverability?
3064
+ > Learn how to use WebSockets for instant email notifications without webhooks or polling.
2879
3065
 
2880
- Email deliverability is the art and science of getting your emails into your recipients' inboxes. It's not just about hitting "send"; it's about building a good reputation with email providers like Gmail and Outlook so they trust that you're sending valuable content, not spam.
3066
+ WebSockets provide a persistent, bidirectional connection to AgentMail for receiving email events in real-time. Unlike webhooks, WebSockets don't require a public URL or external tools like ngrok.
2881
3067
 
2882
- High deliverability is the key to successful email automation. This guide will walk you through the best practices for both your sending strategy and your email content.
3068
+ ## Why Use WebSockets?
2883
3069
 
2884
- ### The Technical Foundation: SPF, DKIM, DMARC
3070
+ | Feature | Webhook | WebSocket |
3071
+ | ---------- | --------------------------- | ------------------------ |
3072
+ | Setup | Requires public URL + ngrok | No external tools needed |
3073
+ | Connection | HTTP request per event | Persistent connection |
3074
+ | Direction | AgentMail → Your server | Bidirectional |
3075
+ | Firewall | Must expose port | Outbound only |
3076
+ | Latency | HTTP round-trip | Instant streaming |
2885
3077
 
2886
- Before you send your first email, it's important to have the right technical foundation in place. SPF, DKIM, and DMARC are DNS records that act as a digital signature, proving to email providers that you are who you say you are.
3078
+ ***
2887
3079
 
2888
- <Tip>
2889
- We take care of all of this for you guys, so no need to worry about these.
2890
- Just something to know about(or google).
2891
- </Tip>
3080
+ ## Python SDK
2892
3081
 
2893
- For maximum control and the best deliverability, we strongly recommend using your own custom domains. Setting these records up correctly on your own domain is the single most important step you can take.
3082
+ The Python SDK provides both synchronous and asynchronous WebSocket clients.
2894
3083
 
2895
- <CardGroup>
2896
- <Card title="Guide: Managing Custom Domains" icon="fa-solid fa-shield-alt" href="/custom-domains">
2897
- Learn how to add your own domain and configure SPF, DKIM, and DMARC records.
2898
- </Card>
2899
- </CardGroup>
3084
+ ### Async Usage
2900
3085
 
2901
- ## High-Volume Sending Strategy
3086
+ ```python
3087
+ import asyncio
3088
+ from agentmail import AsyncAgentMail, Subscribe, Subscribed, MessageReceivedEvent
2902
3089
 
2903
- How you send your emails is just as important as what you send. If you're sending a large volume of emails, follow these steps to build and maintain a strong sender reputation.
3090
+ client = AsyncAgentMail(api_key="YOUR_API_KEY")
2904
3091
 
2905
- <Steps>
2906
- <Step title="Warm-Up Your Inboxes">
2907
- Don't go from zero to one thousand emails overnight. Email providers get
2908
- suspicious of new inboxes that immediately send a high volume. Start slow
2909
- and gradually increase your sending volume over several days or weeks. This
2910
- "warm-up" process signals that you're a legitimate sender.
3092
+ async def main():
3093
+ async with client.websockets.connect() as socket:
3094
+ # Subscribe to inboxes
3095
+ await socket.send_subscribe(Subscribe(inbox_ids=["agent@agentmail.to"]))
2911
3096
 
2912
- <Callout intent="info">
2913
- **Example Warm-Up Schedule:**
2914
- <br /> - Day 1: 10 emails/inbox
2915
- <br /> - Day 2: 20 emails/inbox
2916
- <br /> - Day 3: 40 emails/inbox
2917
- <br /> - ...and so on.
2918
- </Callout>
2919
- </Step>
3097
+ # Process events as they arrive
3098
+ async for event in socket:
3099
+ if isinstance(event, Subscribed):
3100
+ print(f"Subscribed to: {event.inbox_ids}")
3101
+ elif isinstance(event, MessageReceivedEvent):
3102
+ print(f"New email from: {event.message.from_}")
3103
+ print(f"Subject: {event.message.subject}")
2920
3104
 
2921
- <Step title="Diversify Your Sending Inboxes">
2922
- Instead of sending 10,000 emails from a single inbox, it's far better to
2923
- send 100 emails from 100 different inboxes. This distributes your sending
2924
- volume, reduces the risk of any single inbox getting flagged, and looks much
2925
- more natural to email providers. AgentMail's ability to create inboxes at
2926
- scale makes this strategy easy to implement.
3105
+ asyncio.run(main())
3106
+ ```
2927
3107
 
2928
- <img src="file:9510cd76-587b-4d97-97d8-d8ed463903ee" alt="Diagram comparing one inbox sending 1000 emails vs. five inboxes sending 200 each." />
2929
- </Step>
3108
+ ### Sync Usage
2930
3109
 
2931
- <Step title="Protect Your Reputation with Multiple Domains">
2932
- An email domain's reputation is its most valuable asset. To protect it, use
2933
- multiple custom domains for your outreach campaigns. If one domain's
2934
- reputation is inadvertently damaged, you can cycle it out without impacting
2935
- the deliverability of your other domains.
2936
- </Step>
2937
- </Steps>
3110
+ ```python
3111
+ from agentmail import AgentMail, Subscribe, Subscribed, MessageReceivedEvent
2938
3112
 
2939
- ## High-Impact Content Strategy
3113
+ client = AgentMail(api_key="YOUR_API_KEY")
2940
3114
 
2941
- The content of your email plays a huge role in whether it's seen as a valuable message or as spam.
3115
+ with client.websockets.connect() as socket:
3116
+ # Subscribe to inboxes
3117
+ socket.send_subscribe(Subscribe(inbox_ids=["agent@agentmail.to"]))
2942
3118
 
2943
- <Steps>
2944
- <Step title="Personalize Everything">
2945
- Address your recipients by name in the subject line and email body. Use
2946
- other data points you have to make the email feel like a one-to-one
2947
- conversation, not a mass blast. Generic emails are a major red flag for spam
2948
- filters.
2949
- </Step>
3119
+ # Process events as they arrive
3120
+ for event in socket:
3121
+ if isinstance(event, Subscribed):
3122
+ print(f"Subscribed to: {event.inbox_ids}")
3123
+ elif isinstance(event, MessageReceivedEvent):
3124
+ print(f"New email from: {event.message.from_}")
3125
+ print(f"Subject: {event.message.subject}")
3126
+ ```
2950
3127
 
2951
- <Step title="Write Like a Human, Not a Marketer">
2952
- Avoid "spammy" keywords (e.g., "free," "buy now," "limited time offer"),
2953
- excessive exclamation points, and using all caps. Write in a natural,
2954
- conversational tone. The goal is to start a conversation, not to close a
2955
- sale in the first email.
2956
- </Step>
3128
+ ### Event Handler Pattern
2957
3129
 
2958
- <Step title="Be Strategic with images">
2959
- Any type of image that isn't an attachment but included in the message body
2960
- actually sets of the spam alarms. Don't do it. Also get rid of your
2961
- open-tracker while your at it because how EVERY service checks if the
2962
- reciepeint of your email opened your message is by encoding a small image
2963
- into the body. Hurts deliverability!!
2964
- </Step>
3130
+ You can also use event handlers instead of iterating:
2965
3131
 
2966
- <Step title="CTA Selection">
2967
- Email providers are wary of emails links, especially in the first message of
2968
- a conversation. A great strategy is to send your initial outreach with no
2969
- links or images. Wait for the recipient to reply, and *then* send your
2970
- call-to-action (CTA) link. This behavior is viewed far more favorably, as
2971
- it's now viewd as a "conversation."
2972
- </Step>
3132
+ ```python
3133
+ import asyncio
3134
+ from agentmail import AsyncAgentMail, Subscribe, EventType
2973
3135
 
2974
- <Step title="HTML + Text">
2975
- Email providers oftentimes flag emails that only include HTML as spam.
2976
- Providing a plain text alternative demonstrates the legitimacy of your
2977
- message to providers like Gmail and increases the chances of it reaching the
2978
- recipient's inbox.
2979
- </Step>
2980
- </Steps>
3136
+ client = AsyncAgentMail(api_key="YOUR_API_KEY")
2981
3137
 
3138
+ async def main():
3139
+ async with client.websockets.connect() as socket:
3140
+ # Register event handlers
3141
+ socket.on(EventType.OPEN, lambda _: print("Connected"))
3142
+ socket.on(EventType.MESSAGE, lambda msg: print("Received:", msg))
3143
+ socket.on(EventType.CLOSE, lambda _: print("Disconnected"))
3144
+ socket.on(EventType.ERROR, lambda err: print("Error:", err))
2982
3145
 
2983
- # Idempotent Requests
3146
+ # Subscribe and start listening
3147
+ await socket.send_subscribe(Subscribe(inbox_ids=["agent@agentmail.to"]))
3148
+ await socket.start_listening()
2984
3149
 
2985
- > A guide to using the client_id parameter in AgentMail to prevent duplicate resources and safely retry API requests.
3150
+ asyncio.run(main())
3151
+ ```
2986
3152
 
2987
- ## What is Idempotency?
3153
+ For sync usage with event handlers, run the listener in a background thread:
2988
3154
 
2989
- In the context of an API, idempotency is the concept that making the same API request multiple times produces the same result as making it just once. If an idempotent `POST` request to create a resource is sent five times, it only creates the resource on the first call. The next four calls do nothing but return the result of that first successful call.
3155
+ ```python
3156
+ import threading
3157
+ from agentmail import AgentMail, Subscribe, EventType
2990
3158
 
2991
- This is a critical feature for building robust, fault-tolerant systems. Network errors, timeouts, and client-side retries are inevitable. Without idempotency, these events could lead to unwanted duplicate resources, like creating multiple identical inboxes or webhooks.
3159
+ client = AgentMail(api_key="YOUR_API_KEY")
2992
3160
 
2993
- ## How AgentMail Handles Idempotency
3161
+ with client.websockets.connect() as socket:
3162
+ socket.on(EventType.OPEN, lambda _: print("Connected"))
3163
+ socket.on(EventType.MESSAGE, lambda msg: print("Received:", msg))
3164
+ socket.on(EventType.CLOSE, lambda _: print("Disconnected"))
3165
+ socket.on(EventType.ERROR, lambda err: print("Error:", err))
2994
3166
 
2995
- AgentMail supports idempotency for all `create` operations via an optional `client_id` parameter.
3167
+ socket.send_subscribe(Subscribe(inbox_ids=["agent@agentmail.to"]))
2996
3168
 
2997
- When you provide a `client_id` with a `create` request, AgentMail checks if a request with that same `client_id` has already been successfully completed.
3169
+ # Start listening in background thread
3170
+ listener = threading.Thread(target=socket.start_listening, daemon=True)
3171
+ listener.start()
3172
+ listener.join()
3173
+ ```
2998
3174
 
2999
- * **If it's the first time** we've seen this `client_id`, we process the request as normal, create the resource, and store the resulting resource `id` against your `client_id`.
3000
- * **If we have seen this `client_id` before**, we do *not* re-process the request. Instead, we immediately return a `200 OK` response with the data from the *original*, successfully completed request.
3175
+ ***
3001
3176
 
3002
- This allows you to safely retry requests without the risk of creating duplicate data.
3177
+ ## TypeScript SDK
3003
3178
 
3004
- ```python
3005
- # The first time this code is run, it creates a new inbox.
3006
- inbox = client.inboxes.create(
3007
- username="idempotent-test",
3008
- client_id="user-123-inbox-primary"
3009
- )
3010
- print(f"Created inbox: {inbox.id}")
3179
+ The TypeScript SDK provides a WebSocket client with automatic reconnection.
3011
3180
 
3012
- # If you run this exact same code again, it will NOT create a second
3013
- # inbox. It will return the same inbox object from the first call.
3014
- inbox_again = client.inboxes.create(
3015
- username="idempotent-test",
3016
- client_id="user-123-inbox-primary"
3017
- )
3018
- print(f"Retrieved same inbox: {inbox_again.id}")
3019
- # The inbox.id will be identical in both calls.
3020
- ```
3181
+ ### Basic Usage
3021
3182
 
3022
- ## Best Practices for `client_id`
3183
+ ```typescript
3184
+ import { AgentMailClient, AgentMail } from "agentmail";
3023
3185
 
3024
- To use idempotency effectively, the `client_id` you generate must be unique and deterministic.
3186
+ const client = new AgentMailClient({
3187
+ apiKey: process.env.AGENTMAIL_API_KEY,
3188
+ });
3025
3189
 
3026
- * **Deterministic:** The same logical resource on your end should always generate the same `client_id`. For example, a `client_id` for a user's primary inbox could be `inbox-for-user-{{USER_ID}}`.
3027
- * **Unique:** Do not reuse a `client_id` for creating different resources. A `client_id` used to create an inbox should not be used to create a webhook.
3190
+ async function main() {
3191
+ const socket = await client.websockets.connect();
3028
3192
 
3029
- A common and highly effective pattern is to generate a UUID (like a `UUID v4`) on your client side for a resource you are about to create, save that UUID in your own database, and then use it as the `client_id` in the API call. This gives you a reliable key to use for any retries.
3193
+ // Handle events
3194
+ socket.on("open", () => {
3195
+ console.log("Connected");
3030
3196
 
3197
+ // Subscribe to inboxes after connection is open
3198
+ socket.sendSubscribe({
3199
+ type: "subscribe",
3200
+ inboxIds: ["agent@agentmail.to"],
3201
+ });
3202
+ });
3031
3203
 
3032
- # Example: Event-Driven Agent
3204
+ socket.on("message", (event: AgentMail.Subscribed | AgentMail.MessageReceivedEvent) => {
3205
+ if (event.type === "subscribed") {
3206
+ console.log("Subscribed to:", event.inboxIds);
3207
+ } else if (event.type === "message_received") {
3208
+ console.log("New email from:", event.message.from_);
3209
+ console.log("Subject:", event.message.subject);
3210
+ }
3211
+ });
3033
3212
 
3034
- > A step-by-step guide to building a sophisticated agent that performs proactive outreach and uses webhooks for inbound message processing.
3213
+ socket.on("close", (event) => {
3214
+ console.log("Disconnected:", event.code, event.reason);
3215
+ });
3035
3216
 
3036
- This tutorial walks you through building a sophisticated, dual-mode agent. It will:
3217
+ socket.on("error", (error) => {
3218
+ console.error("Error:", error);
3219
+ });
3220
+ }
3037
3221
 
3038
- 1. **Proactively monitor** a GitHub repository and send an outreach email when it detects a new "star".
3039
- 2. **Reactively process** and reply to incoming emails in real-time using AgentMail Webhooks.
3222
+ main();
3223
+ ```
3040
3224
 
3041
- We will use Flask to create a simple web server and `ngrok` to expose it to the internet so AgentMail can send it events.
3225
+ ### React/Next.js Usage
3042
3226
 
3043
- ## Prerequisites
3227
+ Using the SDK with React:
3044
3228
 
3045
- Before you start, make sure you have the following:
3229
+ ```typescript
3230
+ import { useEffect, useState } from "react";
3231
+ import { AgentMailClient, AgentMail } from "agentmail";
3046
3232
 
3047
- * Python 3.8+
3048
- * An [AgentMail API Key](https://console.agentmail.to/dashboard/api-keys).
3049
- * An [OpenAI account](https://openai.com/) and API key.
3050
- * An [ngrok account](https://ngrok.com/) and authtoken.
3233
+ function useAgentMailWebSocket(apiKey: string, inboxIds: string[]) {
3234
+ const [lastMessage, setLastMessage] = useState<AgentMail.MessageReceivedEvent | null>(null);
3235
+ const [isConnected, setIsConnected] = useState(false);
3051
3236
 
3052
- ## Step 1: Project Setup
3237
+ useEffect(() => {
3238
+ const client = new AgentMailClient({ apiKey });
3053
3239
 
3054
- First, let's set up your project directory and install the necessary dependencies.
3240
+ let socket: Awaited<ReturnType<typeof client.websockets.connect>>;
3055
3241
 
3056
- 1. **Create a project folder** and navigate into it.
3242
+ async function connect() {
3243
+ socket = await client.websockets.connect();
3244
+
3245
+ socket.on("open", () => {
3246
+ setIsConnected(true);
3247
+ socket.sendSubscribe({
3248
+ type: "subscribe",
3249
+ inboxIds,
3250
+ });
3251
+ });
3252
+
3253
+ socket.on("message", (event) => {
3254
+ if (event.type === "message_received") {
3255
+ setLastMessage(event);
3256
+ }
3257
+ });
3258
+
3259
+ socket.on("close", () => setIsConnected(false));
3260
+ }
3261
+
3262
+ connect();
3263
+ return () => socket?.close();
3264
+ }, [apiKey, inboxIds.join(",")]);
3265
+
3266
+ return { lastMessage, isConnected };
3267
+ }
3268
+ ```
3269
+
3270
+ ***
3271
+
3272
+ ## Subscribe Options
3273
+
3274
+ When subscribing to events, you can filter by inbox, pod, or event type:
3275
+
3276
+ **Python:**
3277
+
3278
+ ```python
3279
+ from agentmail import Subscribe
3280
+
3281
+ # Subscribe to specific inboxes
3282
+ Subscribe(inbox_ids=["inbox1@agentmail.to", "inbox2@agentmail.to"])
3283
+
3284
+ # Subscribe to pods
3285
+ Subscribe(pod_ids=["pod-id-1", "pod-id-2"])
3286
+
3287
+ # Subscribe to specific event types
3288
+ Subscribe(
3289
+ inbox_ids=["agent@agentmail.to"],
3290
+ event_types=["message.received", "message.sent"]
3291
+ )
3292
+ ```
3293
+
3294
+ **TypeScript:**
3295
+
3296
+ ```typescript
3297
+ // Subscribe to specific inboxes
3298
+ socket.sendSubscribe({
3299
+ type: "subscribe",
3300
+ inboxIds: ["inbox1@agentmail.to", "inbox2@agentmail.to"],
3301
+ });
3302
+
3303
+ // Subscribe to pods
3304
+ socket.sendSubscribe({
3305
+ type: "subscribe",
3306
+ podIds: ["pod-id-1", "pod-id-2"],
3307
+ });
3308
+
3309
+ // Subscribe to specific event types
3310
+ socket.sendSubscribe({
3311
+ type: "subscribe",
3312
+ inboxIds: ["agent@agentmail.to"],
3313
+ eventTypes: ["message.received", "message.sent"],
3314
+ });
3315
+ ```
3316
+
3317
+ ***
3318
+
3319
+ ## Event Types
3320
+
3321
+ ### Connection Events
3322
+
3323
+ | Event | Python | TypeScript | Description |
3324
+ | ------------ | ------------ | ---------------------- | ---------------------- |
3325
+ | `subscribed` | `Subscribed` | `AgentMail.Subscribed` | Subscription confirmed |
3326
+
3327
+ ### Message Events
3328
+
3329
+ | Event | Python | TypeScript | Description |
3330
+ | -------------------- | ------------------------ | ---------------------------------- | -------------------- |
3331
+ | `message_received` | `MessageReceivedEvent` | `AgentMail.MessageReceivedEvent` | New email received |
3332
+ | `message_sent` | `MessageSentEvent` | `AgentMail.MessageSentEvent` | Email was sent |
3333
+ | `message_delivered` | `MessageDeliveredEvent` | `AgentMail.MessageDeliveredEvent` | Email was delivered |
3334
+ | `message_bounced` | `MessageBouncedEvent` | `AgentMail.MessageBouncedEvent` | Email bounced |
3335
+ | `message_complained` | `MessageComplainedEvent` | `AgentMail.MessageComplainedEvent` | Email marked as spam |
3336
+ | `message_rejected` | `MessageRejectedEvent` | `AgentMail.MessageRejectedEvent` | Email was rejected |
3337
+
3338
+ ### Domain Events
3339
+
3340
+ | Event | Python | TypeScript | Description |
3341
+ | ----------------- | --------------------- | ------------------------------- | ----------------------------- |
3342
+ | `domain_verified` | `DomainVerifiedEvent` | `AgentMail.DomainVerifiedEvent` | Domain verification completed |
3343
+
3344
+ ***
3345
+
3346
+ ## Message Properties
3347
+
3348
+ The `event.message` object contains:
3349
+
3350
+ | Python | TypeScript | Description |
3351
+ | ------------- | ------------- | ----------------------------- |
3352
+ | `inbox_id` | `inboxId` | Inbox that received the email |
3353
+ | `message_id` | `messageId` | Unique message ID |
3354
+ | `thread_id` | `threadId` | Conversation thread ID |
3355
+ | `from_` | `from_` | Sender email address |
3356
+ | `to` | `to` | Recipients list |
3357
+ | `subject` | `subject` | Subject line |
3358
+ | `text` | `text` | Plain text body |
3359
+ | `html` | `html` | HTML body (if present) |
3360
+ | `attachments` | `attachments` | List of attachments |
3361
+
3362
+ ***
3363
+
3364
+ ## Error Handling
3365
+
3366
+ **Python:**
3367
+
3368
+ ```python
3369
+ from agentmail import AsyncAgentMail, Subscribe, MessageReceivedEvent
3370
+ from agentmail.core.api_error import ApiError
3371
+
3372
+ client = AsyncAgentMail(api_key="YOUR_API_KEY")
3373
+
3374
+ async def main():
3375
+ try:
3376
+ async with client.websockets.connect() as socket:
3377
+ await socket.send_subscribe(Subscribe(inbox_ids=["agent@agentmail.to"]))
3378
+
3379
+ async for event in socket:
3380
+ if isinstance(event, MessageReceivedEvent):
3381
+ await process_email(event.message)
3382
+
3383
+ except ApiError as e:
3384
+ print(f"API error: {e.status_code} - {e.body}")
3385
+ except Exception as e:
3386
+ print(f"Connection error: {e}")
3387
+ ```
3388
+
3389
+ **TypeScript:**
3390
+
3391
+ ```typescript
3392
+ import { AgentMailClient, AgentMail, AgentMailError } from "agentmail";
3393
+
3394
+ const client = new AgentMailClient({
3395
+ apiKey: process.env.AGENTMAIL_API_KEY,
3396
+ });
3397
+
3398
+ async function main() {
3399
+ try {
3400
+ const socket = await client.websockets.connect();
3401
+
3402
+ socket.on("open", () => {
3403
+ socket.sendSubscribe({
3404
+ type: "subscribe",
3405
+ inboxIds: ["agent@agentmail.to"],
3406
+ });
3407
+ });
3408
+
3409
+ socket.on("message", (event: AgentMail.MessageReceivedEvent) => {
3410
+ if (event.type === "message_received") {
3411
+ processEmail(event.message);
3412
+ }
3413
+ });
3414
+
3415
+ socket.on("error", (error) => {
3416
+ console.error("WebSocket error:", error);
3417
+ });
3418
+
3419
+ socket.on("close", (event) => {
3420
+ console.log("Disconnected:", event.code, event.reason);
3421
+ });
3422
+ } catch (err) {
3423
+ if (err instanceof AgentMailError) {
3424
+ console.error(`API error: ${err.statusCode} - ${err.message}`);
3425
+ } else {
3426
+ console.error("Connection error:", err);
3427
+ }
3428
+ }
3429
+ }
3430
+
3431
+ main();
3432
+ ```
3433
+
3434
+ ***
3435
+
3436
+
3437
+ # Email Deliverability
3438
+
3439
+ > Learn the strategies and best practices for maximizing your email deliverability with AgentMail.
3440
+
3441
+ ## What is Email Deliverability?
3442
+
3443
+ Email deliverability is the art and science of getting your emails into your recipients' inboxes. It's not just about hitting "send"; it's about building a good reputation with email providers like Gmail and Outlook so they trust that you're sending valuable content, not spam.
3444
+
3445
+ High deliverability is the key to successful email automation. This guide will walk you through the best practices for both your sending strategy and your email content.
3446
+
3447
+ ### The Technical Foundation: SPF, DKIM, DMARC
3448
+
3449
+ Before you send your first email, it's important to have the right technical foundation in place. SPF, DKIM, and DMARC are DNS records that act as a digital signature, proving to email providers that you are who you say you are.
3450
+
3451
+ <Tip>
3452
+ We take care of all of this for you guys, so no need to worry about these.
3453
+ Just something to know about(or google).
3454
+ </Tip>
3455
+
3456
+ For maximum control and the best deliverability, we strongly recommend using your own custom domains. Setting these records up correctly on your own domain is the single most important step you can take.
3457
+
3458
+ <CardGroup>
3459
+ <Card title="Guide: Managing Custom Domains" icon="fa-solid fa-shield-alt" href="/custom-domains">
3460
+ Learn how to add your own domain and configure SPF, DKIM, and DMARC records.
3461
+ </Card>
3462
+ </CardGroup>
3463
+
3464
+ ## High-Volume Sending Strategy
3465
+
3466
+ How you send your emails is just as important as what you send. If you're sending a large volume of emails, follow these steps to build and maintain a strong sender reputation.
3467
+
3468
+ <Steps>
3469
+ <Step title="Warm-Up Your Inboxes">
3470
+ Don't go from zero to one thousand emails overnight. Email providers get
3471
+ suspicious of new inboxes that immediately send a high volume. Start slow
3472
+ and gradually increase your sending volume over several days or weeks. This
3473
+ "warm-up" process signals that you're a legitimate sender.
3474
+
3475
+ <Callout intent="info">
3476
+ **Example Warm-Up Schedule:**
3477
+ <br /> - Day 1: 10 emails/inbox
3478
+ <br /> - Day 2: 20 emails/inbox
3479
+ <br /> - Day 3: 40 emails/inbox
3480
+ <br /> - ...and so on.
3481
+ </Callout>
3482
+ </Step>
3483
+
3484
+ <Step title="Diversify Your Sending Inboxes">
3485
+ Instead of sending 10,000 emails from a single inbox, it's far better to
3486
+ send 100 emails from 100 different inboxes. This distributes your sending
3487
+ volume, reduces the risk of any single inbox getting flagged, and looks much
3488
+ more natural to email providers. AgentMail's ability to create inboxes at
3489
+ scale makes this strategy easy to implement.
3490
+
3491
+ <img src="file:3417d8c2-94bc-4f35-aaad-c01abf678422" alt="Diagram comparing one inbox sending 1000 emails vs. five inboxes sending 200 each." />
3492
+ </Step>
3493
+
3494
+ <Step title="Protect Your Reputation with Multiple Domains">
3495
+ An email domain's reputation is its most valuable asset. To protect it, use
3496
+ multiple custom domains for your outreach campaigns. If one domain's
3497
+ reputation is inadvertently damaged, you can cycle it out without impacting
3498
+ the deliverability of your other domains.
3499
+ </Step>
3500
+ </Steps>
3501
+
3502
+ ## High-Impact Content Strategy
3503
+
3504
+ The content of your email plays a huge role in whether it's seen as a valuable message or as spam.
3505
+
3506
+ <Steps>
3507
+ <Step title="Personalize Everything">
3508
+ Address your recipients by name in the subject line and email body. Use
3509
+ other data points you have to make the email feel like a one-to-one
3510
+ conversation, not a mass blast. Generic emails are a major red flag for spam
3511
+ filters.
3512
+ </Step>
3513
+
3514
+ <Step title="Write Like a Human, Not a Marketer">
3515
+ Avoid "spammy" keywords (e.g., "free," "buy now," "limited time offer"),
3516
+ excessive exclamation points, and using all caps. Write in a natural,
3517
+ conversational tone. The goal is to start a conversation, not to close a
3518
+ sale in the first email.
3519
+ </Step>
3520
+
3521
+ <Step title="Be Strategic with images">
3522
+ Any type of image that isn't an attachment but included in the message body
3523
+ actually sets of the spam alarms. Don't do it. Also get rid of your
3524
+ open-tracker while your at it because how EVERY service checks if the
3525
+ reciepeint of your email opened your message is by encoding a small image
3526
+ into the body. Hurts deliverability!!
3527
+ </Step>
3528
+
3529
+ <Step title="CTA Selection">
3530
+ Email providers are wary of emails links, especially in the first message of
3531
+ a conversation. A great strategy is to send your initial outreach with no
3532
+ links or images. Wait for the recipient to reply, and *then* send your
3533
+ call-to-action (CTA) link. This behavior is viewed far more favorably, as
3534
+ it's now viewd as a "conversation."
3535
+ </Step>
3536
+
3537
+ <Step title="HTML + Text">
3538
+ Email providers oftentimes flag emails that only include HTML as spam.
3539
+ Providing a plain text alternative demonstrates the legitimacy of your
3540
+ message to providers like Gmail and increases the chances of it reaching the
3541
+ recipient's inbox.
3542
+ </Step>
3543
+ </Steps>
3544
+
3545
+
3546
+ # Idempotent Requests
3547
+
3548
+ > A guide to using the client_id parameter in AgentMail to prevent duplicate resources and safely retry API requests.
3549
+
3550
+ ## What is Idempotency?
3551
+
3552
+ In the context of an API, idempotency is the concept that making the same API request multiple times produces the same result as making it just once. If an idempotent `POST` request to create a resource is sent five times, it only creates the resource on the first call. The next four calls do nothing but return the result of that first successful call.
3553
+
3554
+ This is a critical feature for building robust, fault-tolerant systems. Network errors, timeouts, and client-side retries are inevitable. Without idempotency, these events could lead to unwanted duplicate resources, like creating multiple identical inboxes or webhooks.
3555
+
3556
+ ## How AgentMail Handles Idempotency
3557
+
3558
+ AgentMail supports idempotency for all `create` operations via an optional `client_id` parameter.
3559
+
3560
+ When you provide a `client_id` with a `create` request, AgentMail checks if a request with that same `client_id` has already been successfully completed.
3561
+
3562
+ * **If it's the first time** we've seen this `client_id`, we process the request as normal, create the resource, and store the resulting resource `id` against your `client_id`.
3563
+ * **If we have seen this `client_id` before**, we do *not* re-process the request. Instead, we immediately return a `200 OK` response with the data from the *original*, successfully completed request.
3564
+
3565
+ This allows you to safely retry requests without the risk of creating duplicate data.
3566
+
3567
+ ```python
3568
+ # The first time this code is run, it creates a new inbox.
3569
+ inbox = client.inboxes.create(
3570
+ username="idempotent-test",
3571
+ client_id="user-123-inbox-primary"
3572
+ )
3573
+ print(f"Created inbox: {inbox.id}")
3574
+
3575
+ # If you run this exact same code again, it will NOT create a second
3576
+ # inbox. It will return the same inbox object from the first call.
3577
+ inbox_again = client.inboxes.create(
3578
+ username="idempotent-test",
3579
+ client_id="user-123-inbox-primary"
3580
+ )
3581
+ print(f"Retrieved same inbox: {inbox_again.id}")
3582
+ # The inbox.id will be identical in both calls.
3583
+ ```
3584
+
3585
+ ## Best Practices for `client_id`
3586
+
3587
+ To use idempotency effectively, the `client_id` you generate must be unique and deterministic.
3588
+
3589
+ * **Deterministic:** The same logical resource on your end should always generate the same `client_id`. For example, a `client_id` for a user's primary inbox could be `inbox-for-user-{{USER_ID}}`.
3590
+ * **Unique:** Do not reuse a `client_id` for creating different resources. A `client_id` used to create an inbox should not be used to create a webhook.
3591
+
3592
+ A common and highly effective pattern is to generate a UUID (like a `UUID v4`) on your client side for a resource you are about to create, save that UUID in your own database, and then use it as the `client_id` in the API call. This gives you a reliable key to use for any retries.
3593
+
3594
+
3595
+ # Example: Event-Driven Agent
3596
+
3597
+ > A step-by-step guide to building a sophisticated agent that performs proactive outreach and uses webhooks for inbound message processing.
3598
+
3599
+ This tutorial walks you through building a sophisticated, dual-mode agent. It will:
3600
+
3601
+ 1. **Proactively monitor** a GitHub repository and send an outreach email when it detects a new "star".
3602
+ 2. **Reactively process** and reply to incoming emails in real-time using AgentMail Webhooks.
3603
+
3604
+ We will use Flask to create a simple web server and `ngrok` to expose it to the internet so AgentMail can send it events.
3605
+
3606
+ ## Prerequisites
3607
+
3608
+ Before you start, make sure you have the following:
3609
+
3610
+ * Python 3.8+
3611
+ * An [AgentMail API Key](https://console.agentmail.to/dashboard/api-keys).
3612
+ * An [OpenAI account](https://openai.com/) and API key.
3613
+ * An [ngrok account](https://ngrok.com/) and authtoken.
3614
+
3615
+ ## Step 1: Project Setup
3616
+
3617
+ First, let's set up your project directory and install the necessary dependencies.
3618
+
3619
+ 1. **Create a project folder** and navigate into it.
3057
3620
 
3058
3621
  2. **Create a `requirements.txt` file** with the following content:
3059
3622
 
@@ -4944,7 +5507,7 @@ Done
4944
5507
 
4945
5508
  Go to your AgentMail inbox and filter by labels to organize your emails:
4946
5509
 
4947
- <img src="file:36c999f1-b941-45cb-8f04-1b062610ef6c" alt="Test image" />
5510
+ <img src="file:a6b17d0b-afdd-4747-a4bb-eec153ba7fbc" alt="Test image" />
4948
5511
 
4949
5512
  **Filter by sentiment:**
4950
5513
 
@@ -5766,7 +6329,137 @@ We hope this provides a clear and transparent look into why these DNS records ar
5766
6329
 
5767
6330
  # SOC 2 Compliance
5768
6331
 
5769
- We're almost there....
6332
+ > AgentMail's SOC 2 Type I achievement and Type II certification progress.
6333
+
6334
+ > AgentMail has **achieved SOC 2 Type I compliance** (July 2025) and is currently working toward **Type II certification** (target: Q1 2026).
6335
+
6336
+ ***
6337
+
6338
+ ## Current Status
6339
+
6340
+ <CardGroup cols={2}>
6341
+ <Card title="Type I Achieved" icon="check-circle">
6342
+ **Completed July 2025** - Controls properly designed and in place
6343
+ </Card>
6344
+
6345
+ <Card title="Type II In Progress" icon="spinner">
6346
+ **Target Q1 2026** - Demonstrating operational effectiveness over time
6347
+ </Card>
6348
+ </CardGroup>
6349
+
6350
+ ### Compliance Timeline
6351
+
6352
+ | Phase | Period | Status |
6353
+ | ------------------------------ | ------------------- | ----------- |
6354
+ | **Type I Preparation** | June 2025 | Completed |
6355
+ | **Type I Assessment** | July 2025 | Completed |
6356
+ | **Type II Observation Period** | Aug 2025 - Dec 2025 | In Progress |
6357
+ | **Type II Certification** | Q1 2026 | Target |
6358
+
6359
+ ***
6360
+
6361
+ ## What is SOC 2?
6362
+
6363
+ **SOC 2** is an attestation standard by **AICPA** (The American Institute of Certified Public Accountants) evaluating controls over:
6364
+
6365
+ 1. **Security** - Protection against unauthorized access, both physical and logical
6366
+ 2. **Availability** - System accessibility and operational performance as committed
6367
+ 3. **Processing Integrity** - System processing is complete, valid, accurate, timely, and authorized
6368
+ 4. **Confidentiality** - Information designated as confidential is protected
6369
+ 5. **Privacy** - Personal information is collected, used, retained, disclosed, and disposed per privacy commitments
6370
+
6371
+ ### Report Types
6372
+
6373
+ * **Type I**: Verifies that security controls are properly **designed** at a point in time.
6374
+ * **Type II**: Validates that controls **operate effectively** over a period (typically 6–12 months).
6375
+
6376
+ <Callout intent="success">
6377
+ AgentMail's SOC 2 Type I report confirms that our security infrastructure is properly designed and implemented.
6378
+ </Callout>
6379
+
6380
+ ***
6381
+
6382
+ ## Security Controls Implemented
6383
+
6384
+ The following controls have been audited and verified as part of our SOC 2 Type I compliance:
6385
+
6386
+ ### Access Control
6387
+
6388
+ * Role-based access; **least privilege** enforced
6389
+ * **MFA** (Multi-Factor Authentication) for administrative access and sensitive operations
6390
+ * Quarterly access reviews and revocation upon role change
6391
+
6392
+ ### Encryption & Key Management
6393
+
6394
+ * **TLS 1.2+** for all service/API communications
6395
+ * Data at rest encrypted using industry-standard ciphers
6396
+ * Centralized **KMS** (Key Management Service) for key generation, rotation, and revocation
6397
+ * **Encrypted point-in-time backups** with 30-day retention
6398
+
6399
+ See [Security Overview](https://agentmail.to/security) for more details.
6400
+
6401
+ ### Email Authentication & Anti-Abuse
6402
+
6403
+ * **SPF, DKIM, DMARC** configured across all sending domains
6404
+ * Real-time scanning of inbound/outbound messages for malware/phishing
6405
+ * IP-based **rate limiting** and behavioral abuse detection
6406
+
6407
+ See [Email Protocols](https://docs.agentmail.to/email-protocols) for technical details.
6408
+
6409
+ ### Monitoring & Incident Response
6410
+
6411
+ * Centralized logging and anomaly detection with alerting
6412
+ * Documented incident response process: detect → triage → contain → eradicate → recover → post-incident review
6413
+ * Responsible disclosure channel for external security researchers
6414
+
6415
+ ### Resilience, Backup & Recovery
6416
+
6417
+ * Daily encrypted backups with **30-day retention**
6418
+ * Regular **restore tests** to validate RTO/RPO targets
6419
+ * Multi-AZ/high-availability architecture for critical components
6420
+
6421
+ ***
6422
+
6423
+ ## SOC 2 Control Mapping
6424
+
6425
+ | Control Area | Implementation | SOC 2 Criteria |
6426
+ | -------------------- | ---------------------------------------------- | -------------- |
6427
+ | Access Control | RBAC, MFA, quarterly reviews | CC6.1–CC6.7 |
6428
+ | Encryption & KMS | TLS 1.2+, at-rest encryption, key rotation | CC6.8–CC6.9 |
6429
+ | Email Authentication | SPF/DKIM/DMARC, anti-abuse filters | CC7.1–CC7.4 |
6430
+ | Threat Monitoring | Centralized logs, alerts, malware scanning | CC7.2–CC7.4 |
6431
+ | Backup & Recovery | Daily backups, 30-day retention, restore tests | CC7.3 |
6432
+ | Incident Response | Runbooks, post-mortems, disclosure program | CC7.4–CC7.5 |
6433
+ | Workforce Security | Security training, NDAs, background checks | CC5.3–CC5.4 |
6434
+
6435
+ > The above mappings reflect our audited Type I controls and are maintained during the Type II observation period.
6436
+
6437
+ ***
6438
+
6439
+ ## Type II Certification Progress
6440
+
6441
+ AgentMail is currently in the **Type II observation period** (August 2025 - December 2025), during which an independent auditor is testing and validating that our security controls operate effectively over time.
6442
+
6443
+ ### What's Being Tested
6444
+
6445
+ * **Continuous Operation**: Controls function consistently without gaps
6446
+ * **Change Management**: Security maintained through system updates and changes
6447
+ * **Evidence Collection**: Logs, tickets, training records, access reviews
6448
+ * **Incident Handling**: Real-world response to security events (if any)
6449
+
6450
+ ### Expected Completion
6451
+
6452
+ **Q1 2026** - Full SOC 2 Type II certification report from independent CPA firm
6453
+
6454
+ Type II certification provides the highest level of assurance that AgentMail's security controls are not only well-designed but also operate effectively over time.
6455
+
6456
+ ***
6457
+
6458
+ ## Accessing SOC 2 Reports
6459
+
6460
+ Organizations evaluating AgentMail can [request SOC 2 documentation](mailto:security@agentmail.to).
6461
+
6462
+ ***
5770
6463
 
5771
6464
 
5772
6465
  # API Welcome
@@ -5878,9 +6571,11 @@ components:
5878
6571
  updated_at:
5879
6572
  type: string
5880
6573
  format: date-time
6574
+ description: Time at which inbox was last updated.
5881
6575
  created_at:
5882
6576
  type: string
5883
6577
  format: date-time
6578
+ description: Time at which inbox was created.
5884
6579
  required:
5885
6580
  - pod_id
5886
6581
  - inbox_id
@@ -5899,6 +6594,7 @@ components:
5899
6594
  type: array
5900
6595
  items:
5901
6596
  $ref: '#/components/schemas/type_inboxes:Inbox'
6597
+ description: Ordered by `created_at` descending.
5902
6598
  required:
5903
6599
  - count
5904
6600
  - inboxes
@@ -6096,9 +6792,11 @@ components:
6096
6792
  updated_at:
6097
6793
  type: string
6098
6794
  format: date-time
6795
+ description: Time at which inbox was last updated.
6099
6796
  created_at:
6100
6797
  type: string
6101
6798
  format: date-time
6799
+ description: Time at which inbox was created.
6102
6800
  required:
6103
6801
  - pod_id
6104
6802
  - inbox_id
@@ -6288,8 +6986,12 @@ components:
6288
6986
  properties:
6289
6987
  username:
6290
6988
  type: string
6989
+ description: Username of address. Randomly generated if not specified.
6291
6990
  domain:
6292
6991
  type: string
6992
+ description: >-
6993
+ Domain of address. Must be verified domain. Defaults to
6994
+ `agentmail.to`.
6293
6995
  display_name:
6294
6996
  $ref: '#/components/schemas/type_inboxes:DisplayName'
6295
6997
  client_id:
@@ -6312,9 +7014,11 @@ components:
6312
7014
  updated_at:
6313
7015
  type: string
6314
7016
  format: date-time
7017
+ description: Time at which inbox was last updated.
6315
7018
  created_at:
6316
7019
  type: string
6317
7020
  format: date-time
7021
+ description: Time at which inbox was created.
6318
7022
  required:
6319
7023
  - pod_id
6320
7024
  - inbox_id
@@ -6535,9 +7239,11 @@ components:
6535
7239
  updated_at:
6536
7240
  type: string
6537
7241
  format: date-time
7242
+ description: Time at which inbox was last updated.
6538
7243
  created_at:
6539
7244
  type: string
6540
7245
  format: date-time
7246
+ description: Time at which inbox was created.
6541
7247
  required:
6542
7248
  - pod_id
6543
7249
  - inbox_id
@@ -7096,6 +7802,7 @@ components:
7096
7802
  type: array
7097
7803
  items:
7098
7804
  $ref: '#/components/schemas/type_threads:ThreadItem'
7805
+ description: Ordered by `timestamp` descending.
7099
7806
  required:
7100
7807
  - count
7101
7808
  - threads
@@ -7419,6 +8126,9 @@ components:
7419
8126
  type: array
7420
8127
  items:
7421
8128
  type: string
8129
+ description: >-
8130
+ Reply-to addresses. In format `username@domain.com` or `Display Name
8131
+ <username@domain.com>`.
7422
8132
  to:
7423
8133
  $ref: '#/components/schemas/type_messages:MessageTo'
7424
8134
  cc:
@@ -7435,8 +8145,10 @@ components:
7435
8145
  $ref: '#/components/schemas/type_messages:MessageHtml'
7436
8146
  extracted_text:
7437
8147
  type: string
8148
+ description: Extracted new text content.
7438
8149
  extracted_html:
7439
8150
  type: string
8151
+ description: Extracted new HTML content.
7440
8152
  attachments:
7441
8153
  $ref: '#/components/schemas/type_messages:MessageAttachments'
7442
8154
  in_reply_to:
@@ -7499,6 +8211,7 @@ components:
7499
8211
  type: array
7500
8212
  items:
7501
8213
  $ref: '#/components/schemas/type_messages:Message'
8214
+ description: Messages in thread. Ordered by `timestamp` ascending.
7502
8215
  required:
7503
8216
  - inbox_id
7504
8217
  - thread_id
@@ -8250,6 +8963,7 @@ components:
8250
8963
  type: array
8251
8964
  items:
8252
8965
  $ref: '#/components/schemas/type_messages:MessageItem'
8966
+ description: Ordered by `timestamp` descending.
8253
8967
  required:
8254
8968
  - count
8255
8969
  - messages
@@ -8532,6 +9246,9 @@ components:
8532
9246
  type: array
8533
9247
  items:
8534
9248
  type: string
9249
+ description: >-
9250
+ Reply-to addresses. In format `username@domain.com` or `Display Name
9251
+ <username@domain.com>`.
8535
9252
  to:
8536
9253
  $ref: '#/components/schemas/type_messages:MessageTo'
8537
9254
  cc:
@@ -8548,8 +9265,10 @@ components:
8548
9265
  $ref: '#/components/schemas/type_messages:MessageHtml'
8549
9266
  extracted_text:
8550
9267
  type: string
9268
+ description: Extracted new text content.
8551
9269
  extracted_html:
8552
9270
  type: string
9271
+ description: Extracted new HTML content.
8553
9272
  attachments:
8554
9273
  $ref: '#/components/schemas/type_messages:MessageAttachments'
8555
9274
  in_reply_to:
@@ -8586,7 +9305,200 @@ async function main() {
8586
9305
  environment: "https://api.agentmail.to",
8587
9306
  apiKey: "YOUR_TOKEN_HERE",
8588
9307
  });
8589
- await client.inboxes.messages.get("inbox_id", "message_id");
9308
+ await client.inboxes.messages.get("inbox_id", "message_id");
9309
+ }
9310
+ main();
9311
+
9312
+ ```
9313
+
9314
+ ```python
9315
+ from agentmail import AgentMail
9316
+
9317
+ client = AgentMail(
9318
+ base_url="https://api.agentmail.to",
9319
+ api_key="YOUR_TOKEN_HERE"
9320
+ )
9321
+
9322
+ client.inboxes.messages.get(
9323
+ inbox_id="inbox_id",
9324
+ message_id="message_id"
9325
+ )
9326
+
9327
+ ```
9328
+
9329
+ ```go
9330
+ package main
9331
+
9332
+ import (
9333
+ "fmt"
9334
+ "net/http"
9335
+ "io"
9336
+ )
9337
+
9338
+ func main() {
9339
+
9340
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id"
9341
+
9342
+ req, _ := http.NewRequest("GET", url, nil)
9343
+
9344
+ req.Header.Add("Authorization", "Bearer <api_key>")
9345
+
9346
+ res, _ := http.DefaultClient.Do(req)
9347
+
9348
+ defer res.Body.Close()
9349
+ body, _ := io.ReadAll(res.Body)
9350
+
9351
+ fmt.Println(res)
9352
+ fmt.Println(string(body))
9353
+
9354
+ }
9355
+ ```
9356
+
9357
+ ```ruby
9358
+ require 'uri'
9359
+ require 'net/http'
9360
+
9361
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id")
9362
+
9363
+ http = Net::HTTP.new(url.host, url.port)
9364
+ http.use_ssl = true
9365
+
9366
+ request = Net::HTTP::Get.new(url)
9367
+ request["Authorization"] = 'Bearer <api_key>'
9368
+
9369
+ response = http.request(request)
9370
+ puts response.read_body
9371
+ ```
9372
+
9373
+ ```java
9374
+ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id")
9375
+ .header("Authorization", "Bearer <api_key>")
9376
+ .asString();
9377
+ ```
9378
+
9379
+ ```php
9380
+ <?php
9381
+
9382
+ $client = new \GuzzleHttp\Client();
9383
+
9384
+ $response = $client->request('GET', 'https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id', [
9385
+ 'headers' => [
9386
+ 'Authorization' => 'Bearer <api_key>',
9387
+ ],
9388
+ ]);
9389
+
9390
+ echo $response->getBody();
9391
+ ```
9392
+
9393
+ ```csharp
9394
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id");
9395
+ var request = new RestRequest(Method.GET);
9396
+ request.AddHeader("Authorization", "Bearer <api_key>");
9397
+ IRestResponse response = client.Execute(request);
9398
+ ```
9399
+
9400
+ ```swift
9401
+ import Foundation
9402
+
9403
+ let headers = ["Authorization": "Bearer <api_key>"]
9404
+
9405
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id")! as URL,
9406
+ cachePolicy: .useProtocolCachePolicy,
9407
+ timeoutInterval: 10.0)
9408
+ request.httpMethod = "GET"
9409
+ request.allHTTPHeaderFields = headers
9410
+
9411
+ let session = URLSession.shared
9412
+ let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
9413
+ if (error != nil) {
9414
+ print(error as Any)
9415
+ } else {
9416
+ let httpResponse = response as? HTTPURLResponse
9417
+ print(httpResponse)
9418
+ }
9419
+ })
9420
+
9421
+ dataTask.resume()
9422
+ ```
9423
+
9424
+ # Get Attachment
9425
+
9426
+ GET https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}
9427
+
9428
+ Reference: https://docs.agentmail.to/api-reference/inboxes/messages/get-attachment
9429
+
9430
+ ## OpenAPI Specification
9431
+
9432
+ ```yaml
9433
+ openapi: 3.1.1
9434
+ info:
9435
+ title: Get Attachment
9436
+ version: endpoint_inboxes/messages.getAttachment
9437
+ paths:
9438
+ /v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}:
9439
+ get:
9440
+ operationId: get-attachment
9441
+ summary: Get Attachment
9442
+ tags:
9443
+ - - subpackage_inboxes
9444
+ - subpackage_inboxes/messages
9445
+ parameters:
9446
+ - name: inbox_id
9447
+ in: path
9448
+ required: true
9449
+ schema:
9450
+ $ref: '#/components/schemas/type_inboxes:InboxId'
9451
+ - name: message_id
9452
+ in: path
9453
+ required: true
9454
+ schema:
9455
+ $ref: '#/components/schemas/type_messages:MessageId'
9456
+ - name: attachment_id
9457
+ in: path
9458
+ required: true
9459
+ schema:
9460
+ $ref: '#/components/schemas/type_attachments:AttachmentId'
9461
+ - name: Authorization
9462
+ in: header
9463
+ description: >-
9464
+ Bearer authentication of the form `Bearer <token>`, where token is
9465
+ your auth token.
9466
+ required: true
9467
+ schema:
9468
+ type: string
9469
+ responses:
9470
+ '200':
9471
+ description: Response with status 200
9472
+ content:
9473
+ application/octet-stream:
9474
+ schema:
9475
+ type: string
9476
+ format: binary
9477
+ '404':
9478
+ description: Error response with status 404
9479
+ content: {}
9480
+ components:
9481
+ schemas:
9482
+ type_inboxes:InboxId:
9483
+ type: string
9484
+ type_messages:MessageId:
9485
+ type: string
9486
+ type_attachments:AttachmentId:
9487
+ type: string
9488
+
9489
+ ```
9490
+
9491
+ ## SDK Code Examples
9492
+
9493
+ ```typescript
9494
+ import { AgentMailClient } from "agentmail";
9495
+
9496
+ async function main() {
9497
+ const client = new AgentMailClient({
9498
+ environment: "https://api.agentmail.to",
9499
+ apiKey: "YOUR_TOKEN_HERE",
9500
+ });
9501
+ await client.inboxes.messages.getAttachment(":inbox_id", ":message_id", ":attachment_id");
8590
9502
  }
8591
9503
  main();
8592
9504
 
@@ -8600,9 +9512,10 @@ client = AgentMail(
8600
9512
  api_key="YOUR_TOKEN_HERE"
8601
9513
  )
8602
9514
 
8603
- client.inboxes.messages.get(
8604
- inbox_id="inbox_id",
8605
- message_id="message_id"
9515
+ client.inboxes.messages.get_attachment(
9516
+ inbox_id=":inbox_id",
9517
+ message_id=":message_id",
9518
+ attachment_id=":attachment_id"
8606
9519
  )
8607
9520
 
8608
9521
  ```
@@ -8618,7 +9531,7 @@ import (
8618
9531
 
8619
9532
  func main() {
8620
9533
 
8621
- url := "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id"
9534
+ url := "https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/attachments/%3Aattachment_id"
8622
9535
 
8623
9536
  req, _ := http.NewRequest("GET", url, nil)
8624
9537
 
@@ -8639,7 +9552,7 @@ func main() {
8639
9552
  require 'uri'
8640
9553
  require 'net/http'
8641
9554
 
8642
- url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id")
9555
+ url = URI("https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/attachments/%3Aattachment_id")
8643
9556
 
8644
9557
  http = Net::HTTP.new(url.host, url.port)
8645
9558
  http.use_ssl = true
@@ -8652,7 +9565,7 @@ puts response.read_body
8652
9565
  ```
8653
9566
 
8654
9567
  ```java
8655
- HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id")
9568
+ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/attachments/%3Aattachment_id")
8656
9569
  .header("Authorization", "Bearer <api_key>")
8657
9570
  .asString();
8658
9571
  ```
@@ -8662,7 +9575,7 @@ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes
8662
9575
 
8663
9576
  $client = new \GuzzleHttp\Client();
8664
9577
 
8665
- $response = $client->request('GET', 'https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id', [
9578
+ $response = $client->request('GET', 'https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/attachments/%3Aattachment_id', [
8666
9579
  'headers' => [
8667
9580
  'Authorization' => 'Bearer <api_key>',
8668
9581
  ],
@@ -8672,7 +9585,7 @@ echo $response->getBody();
8672
9585
  ```
8673
9586
 
8674
9587
  ```csharp
8675
- var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id");
9588
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/attachments/%3Aattachment_id");
8676
9589
  var request = new RestRequest(Method.GET);
8677
9590
  request.AddHeader("Authorization", "Bearer <api_key>");
8678
9591
  IRestResponse response = client.Execute(request);
@@ -8683,7 +9596,7 @@ import Foundation
8683
9596
 
8684
9597
  let headers = ["Authorization": "Bearer <api_key>"]
8685
9598
 
8686
- let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id")! as URL,
9599
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/attachments/%3Aattachment_id")! as URL,
8687
9600
  cachePolicy: .useProtocolCachePolicy,
8688
9601
  timeoutInterval: 10.0)
8689
9602
  request.httpMethod = "GET"
@@ -8702,24 +9615,24 @@ let dataTask = session.dataTask(with: request as URLRequest, completionHandler:
8702
9615
  dataTask.resume()
8703
9616
  ```
8704
9617
 
8705
- # Get Attachment
9618
+ # Get Raw Message
8706
9619
 
8707
- GET https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}
9620
+ GET https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/{message_id}/raw
8708
9621
 
8709
- Reference: https://docs.agentmail.to/api-reference/inboxes/messages/get-attachment
9622
+ Reference: https://docs.agentmail.to/api-reference/inboxes/messages/get-raw
8710
9623
 
8711
9624
  ## OpenAPI Specification
8712
9625
 
8713
9626
  ```yaml
8714
9627
  openapi: 3.1.1
8715
9628
  info:
8716
- title: Get Attachment
8717
- version: endpoint_inboxes/messages.getAttachment
9629
+ title: Get Raw Message
9630
+ version: endpoint_inboxes/messages.getRaw
8718
9631
  paths:
8719
- /v0/inboxes/{inbox_id}/messages/{message_id}/attachments/{attachment_id}:
9632
+ /v0/inboxes/{inbox_id}/messages/{message_id}/raw:
8720
9633
  get:
8721
- operationId: get-attachment
8722
- summary: Get Attachment
9634
+ operationId: get-raw
9635
+ summary: Get Raw Message
8723
9636
  tags:
8724
9637
  - - subpackage_inboxes
8725
9638
  - subpackage_inboxes/messages
@@ -8734,11 +9647,6 @@ paths:
8734
9647
  required: true
8735
9648
  schema:
8736
9649
  $ref: '#/components/schemas/type_messages:MessageId'
8737
- - name: attachment_id
8738
- in: path
8739
- required: true
8740
- schema:
8741
- $ref: '#/components/schemas/type_attachments:AttachmentId'
8742
9650
  - name: Authorization
8743
9651
  in: header
8744
9652
  description: >-
@@ -8764,8 +9672,6 @@ components:
8764
9672
  type: string
8765
9673
  type_messages:MessageId:
8766
9674
  type: string
8767
- type_attachments:AttachmentId:
8768
- type: string
8769
9675
 
8770
9676
  ```
8771
9677
 
@@ -8779,7 +9685,7 @@ async function main() {
8779
9685
  environment: "https://api.agentmail.to",
8780
9686
  apiKey: "YOUR_TOKEN_HERE",
8781
9687
  });
8782
- await client.inboxes.messages.getAttachment(":inbox_id", ":message_id", ":attachment_id");
9688
+ await client.inboxes.messages.getRaw(":inbox_id", ":message_id");
8783
9689
  }
8784
9690
  main();
8785
9691
 
@@ -8793,10 +9699,9 @@ client = AgentMail(
8793
9699
  api_key="YOUR_TOKEN_HERE"
8794
9700
  )
8795
9701
 
8796
- client.inboxes.messages.get_attachment(
9702
+ client.inboxes.messages.get_raw(
8797
9703
  inbox_id=":inbox_id",
8798
- message_id=":message_id",
8799
- attachment_id=":attachment_id"
9704
+ message_id=":message_id"
8800
9705
  )
8801
9706
 
8802
9707
  ```
@@ -8812,7 +9717,7 @@ import (
8812
9717
 
8813
9718
  func main() {
8814
9719
 
8815
- url := "https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/attachments/%3Aattachment_id"
9720
+ url := "https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/raw"
8816
9721
 
8817
9722
  req, _ := http.NewRequest("GET", url, nil)
8818
9723
 
@@ -8833,7 +9738,7 @@ func main() {
8833
9738
  require 'uri'
8834
9739
  require 'net/http'
8835
9740
 
8836
- url = URI("https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/attachments/%3Aattachment_id")
9741
+ url = URI("https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/raw")
8837
9742
 
8838
9743
  http = Net::HTTP.new(url.host, url.port)
8839
9744
  http.use_ssl = true
@@ -8846,7 +9751,7 @@ puts response.read_body
8846
9751
  ```
8847
9752
 
8848
9753
  ```java
8849
- HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/attachments/%3Aattachment_id")
9754
+ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/raw")
8850
9755
  .header("Authorization", "Bearer <api_key>")
8851
9756
  .asString();
8852
9757
  ```
@@ -8856,7 +9761,7 @@ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes
8856
9761
 
8857
9762
  $client = new \GuzzleHttp\Client();
8858
9763
 
8859
- $response = $client->request('GET', 'https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/attachments/%3Aattachment_id', [
9764
+ $response = $client->request('GET', 'https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/raw', [
8860
9765
  'headers' => [
8861
9766
  'Authorization' => 'Bearer <api_key>',
8862
9767
  ],
@@ -8866,7 +9771,7 @@ echo $response->getBody();
8866
9771
  ```
8867
9772
 
8868
9773
  ```csharp
8869
- var client = new RestClient("https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/attachments/%3Aattachment_id");
9774
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/raw");
8870
9775
  var request = new RestRequest(Method.GET);
8871
9776
  request.AddHeader("Authorization", "Bearer <api_key>");
8872
9777
  IRestResponse response = client.Execute(request);
@@ -8877,7 +9782,7 @@ import Foundation
8877
9782
 
8878
9783
  let headers = ["Authorization": "Bearer <api_key>"]
8879
9784
 
8880
- let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/attachments/%3Aattachment_id")! as URL,
9785
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/raw")! as URL,
8881
9786
  cachePolicy: .useProtocolCachePolicy,
8882
9787
  timeoutInterval: 10.0)
8883
9788
  request.httpMethod = "GET"
@@ -8896,24 +9801,25 @@ let dataTask = session.dataTask(with: request as URLRequest, completionHandler:
8896
9801
  dataTask.resume()
8897
9802
  ```
8898
9803
 
8899
- # Get Raw Message
9804
+ # Send Message
8900
9805
 
8901
- GET https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/{message_id}/raw
9806
+ POST https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/send
9807
+ Content-Type: application/json
8902
9808
 
8903
- Reference: https://docs.agentmail.to/api-reference/inboxes/messages/get-raw
9809
+ Reference: https://docs.agentmail.to/api-reference/inboxes/messages/send
8904
9810
 
8905
9811
  ## OpenAPI Specification
8906
9812
 
8907
9813
  ```yaml
8908
9814
  openapi: 3.1.1
8909
9815
  info:
8910
- title: Get Raw Message
8911
- version: endpoint_inboxes/messages.getRaw
9816
+ title: Send Message
9817
+ version: endpoint_inboxes/messages.send
8912
9818
  paths:
8913
- /v0/inboxes/{inbox_id}/messages/{message_id}/raw:
8914
- get:
8915
- operationId: get-raw
8916
- summary: Get Raw Message
9819
+ /v0/inboxes/{inbox_id}/messages/send:
9820
+ post:
9821
+ operationId: send
9822
+ summary: Send Message
8917
9823
  tags:
8918
9824
  - - subpackage_inboxes
8919
9825
  - subpackage_inboxes/messages
@@ -8923,11 +9829,6 @@ paths:
8923
9829
  required: true
8924
9830
  schema:
8925
9831
  $ref: '#/components/schemas/type_inboxes:InboxId'
8926
- - name: message_id
8927
- in: path
8928
- required: true
8929
- schema:
8930
- $ref: '#/components/schemas/type_messages:MessageId'
8931
9832
  - name: Authorization
8932
9833
  in: header
8933
9834
  description: >-
@@ -8940,19 +9841,113 @@ paths:
8940
9841
  '200':
8941
9842
  description: Response with status 200
8942
9843
  content:
8943
- application/octet-stream:
9844
+ application/json:
8944
9845
  schema:
8945
- type: string
8946
- format: binary
9846
+ $ref: '#/components/schemas/type_messages:SendMessageResponse'
9847
+ '400':
9848
+ description: Error response with status 400
9849
+ content: {}
9850
+ '403':
9851
+ description: Error response with status 403
9852
+ content: {}
8947
9853
  '404':
8948
9854
  description: Error response with status 404
8949
9855
  content: {}
9856
+ requestBody:
9857
+ content:
9858
+ application/json:
9859
+ schema:
9860
+ $ref: '#/components/schemas/type_messages:SendMessageRequest'
8950
9861
  components:
8951
9862
  schemas:
8952
9863
  type_inboxes:InboxId:
8953
9864
  type: string
9865
+ type_messages:MessageLabels:
9866
+ type: array
9867
+ items:
9868
+ type: string
9869
+ type_messages:Addresses:
9870
+ oneOf:
9871
+ - type: string
9872
+ - type: array
9873
+ items:
9874
+ type: string
9875
+ type_messages:SendMessageReplyTo:
9876
+ $ref: '#/components/schemas/type_messages:Addresses'
9877
+ type_messages:SendMessageTo:
9878
+ $ref: '#/components/schemas/type_messages:Addresses'
9879
+ type_messages:SendMessageCc:
9880
+ $ref: '#/components/schemas/type_messages:Addresses'
9881
+ type_messages:SendMessageBcc:
9882
+ $ref: '#/components/schemas/type_messages:Addresses'
9883
+ type_messages:MessageSubject:
9884
+ type: string
9885
+ type_messages:MessageText:
9886
+ type: string
9887
+ type_messages:MessageHtml:
9888
+ type: string
9889
+ type_attachments:AttachmentFilename:
9890
+ type: string
9891
+ type_attachments:AttachmentContentType:
9892
+ type: string
9893
+ type_attachments:AttachmentContent:
9894
+ type: string
9895
+ type_attachments:SendAttachment:
9896
+ type: object
9897
+ properties:
9898
+ filename:
9899
+ $ref: '#/components/schemas/type_attachments:AttachmentFilename'
9900
+ content_type:
9901
+ $ref: '#/components/schemas/type_attachments:AttachmentContentType'
9902
+ content:
9903
+ $ref: '#/components/schemas/type_attachments:AttachmentContent'
9904
+ required:
9905
+ - content
9906
+ type_messages:SendMessageAttachments:
9907
+ type: array
9908
+ items:
9909
+ $ref: '#/components/schemas/type_attachments:SendAttachment'
9910
+ type_messages:SendMessageHeaders:
9911
+ type: object
9912
+ additionalProperties:
9913
+ type: string
9914
+ type_messages:SendMessageRequest:
9915
+ type: object
9916
+ properties:
9917
+ labels:
9918
+ $ref: '#/components/schemas/type_messages:MessageLabels'
9919
+ reply_to:
9920
+ $ref: '#/components/schemas/type_messages:SendMessageReplyTo'
9921
+ to:
9922
+ $ref: '#/components/schemas/type_messages:SendMessageTo'
9923
+ cc:
9924
+ $ref: '#/components/schemas/type_messages:SendMessageCc'
9925
+ bcc:
9926
+ $ref: '#/components/schemas/type_messages:SendMessageBcc'
9927
+ subject:
9928
+ $ref: '#/components/schemas/type_messages:MessageSubject'
9929
+ text:
9930
+ $ref: '#/components/schemas/type_messages:MessageText'
9931
+ html:
9932
+ $ref: '#/components/schemas/type_messages:MessageHtml'
9933
+ attachments:
9934
+ $ref: '#/components/schemas/type_messages:SendMessageAttachments'
9935
+ headers:
9936
+ $ref: '#/components/schemas/type_messages:SendMessageHeaders'
8954
9937
  type_messages:MessageId:
8955
9938
  type: string
9939
+ type_threads:ThreadId:
9940
+ type: string
9941
+ type_messages:SendMessageResponse:
9942
+ type: object
9943
+ properties:
9944
+ message_id:
9945
+ $ref: '#/components/schemas/type_messages:MessageId'
9946
+ thread_id:
9947
+ $ref: '#/components/schemas/type_threads:ThreadId'
9948
+ required:
9949
+ - message_id
9950
+ - thread_id
8956
9951
 
8957
9952
  ```
8958
9953
 
@@ -8966,7 +9961,7 @@ async function main() {
8966
9961
  environment: "https://api.agentmail.to",
8967
9962
  apiKey: "YOUR_TOKEN_HERE",
8968
9963
  });
8969
- await client.inboxes.messages.getRaw(":inbox_id", ":message_id");
9964
+ await client.inboxes.messages.send("inbox_id", {});
8970
9965
  }
8971
9966
  main();
8972
9967
 
@@ -8980,9 +9975,8 @@ client = AgentMail(
8980
9975
  api_key="YOUR_TOKEN_HERE"
8981
9976
  )
8982
9977
 
8983
- client.inboxes.messages.get_raw(
8984
- inbox_id=":inbox_id",
8985
- message_id=":message_id"
9978
+ client.inboxes.messages.send(
9979
+ inbox_id="inbox_id"
8986
9980
  )
8987
9981
 
8988
9982
  ```
@@ -8992,17 +9986,21 @@ package main
8992
9986
 
8993
9987
  import (
8994
9988
  "fmt"
9989
+ "strings"
8995
9990
  "net/http"
8996
9991
  "io"
8997
9992
  )
8998
9993
 
8999
9994
  func main() {
9000
9995
 
9001
- url := "https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/raw"
9996
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/messages/send"
9002
9997
 
9003
- req, _ := http.NewRequest("GET", url, nil)
9998
+ payload := strings.NewReader("{}")
9999
+
10000
+ req, _ := http.NewRequest("POST", url, payload)
9004
10001
 
9005
10002
  req.Header.Add("Authorization", "Bearer <api_key>")
10003
+ req.Header.Add("Content-Type", "application/json")
9006
10004
 
9007
10005
  res, _ := http.DefaultClient.Do(req)
9008
10006
 
@@ -9019,21 +10017,25 @@ func main() {
9019
10017
  require 'uri'
9020
10018
  require 'net/http'
9021
10019
 
9022
- url = URI("https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/raw")
10020
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/messages/send")
9023
10021
 
9024
10022
  http = Net::HTTP.new(url.host, url.port)
9025
10023
  http.use_ssl = true
9026
10024
 
9027
- request = Net::HTTP::Get.new(url)
10025
+ request = Net::HTTP::Post.new(url)
9028
10026
  request["Authorization"] = 'Bearer <api_key>'
10027
+ request["Content-Type"] = 'application/json'
10028
+ request.body = "{}"
9029
10029
 
9030
10030
  response = http.request(request)
9031
10031
  puts response.read_body
9032
10032
  ```
9033
10033
 
9034
10034
  ```java
9035
- HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/raw")
10035
+ HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/inboxes/inbox_id/messages/send")
9036
10036
  .header("Authorization", "Bearer <api_key>")
10037
+ .header("Content-Type", "application/json")
10038
+ .body("{}")
9037
10039
  .asString();
9038
10040
  ```
9039
10041
 
@@ -9042,9 +10044,11 @@ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes
9042
10044
 
9043
10045
  $client = new \GuzzleHttp\Client();
9044
10046
 
9045
- $response = $client->request('GET', 'https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/raw', [
10047
+ $response = $client->request('POST', 'https://api.agentmail.to/v0/inboxes/inbox_id/messages/send', [
10048
+ 'body' => '{}',
9046
10049
  'headers' => [
9047
10050
  'Authorization' => 'Bearer <api_key>',
10051
+ 'Content-Type' => 'application/json',
9048
10052
  ],
9049
10053
  ]);
9050
10054
 
@@ -9052,22 +10056,31 @@ echo $response->getBody();
9052
10056
  ```
9053
10057
 
9054
10058
  ```csharp
9055
- var client = new RestClient("https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/raw");
9056
- var request = new RestRequest(Method.GET);
10059
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/messages/send");
10060
+ var request = new RestRequest(Method.POST);
9057
10061
  request.AddHeader("Authorization", "Bearer <api_key>");
10062
+ request.AddHeader("Content-Type", "application/json");
10063
+ request.AddParameter("application/json", "{}", ParameterType.RequestBody);
9058
10064
  IRestResponse response = client.Execute(request);
9059
10065
  ```
9060
10066
 
9061
10067
  ```swift
9062
10068
  import Foundation
9063
10069
 
9064
- let headers = ["Authorization": "Bearer <api_key>"]
10070
+ let headers = [
10071
+ "Authorization": "Bearer <api_key>",
10072
+ "Content-Type": "application/json"
10073
+ ]
10074
+ let parameters = [] as [String : Any]
9065
10075
 
9066
- let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/%3Ainbox_id/messages/%3Amessage_id/raw")! as URL,
10076
+ let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
10077
+
10078
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/messages/send")! as URL,
9067
10079
  cachePolicy: .useProtocolCachePolicy,
9068
10080
  timeoutInterval: 10.0)
9069
- request.httpMethod = "GET"
10081
+ request.httpMethod = "POST"
9070
10082
  request.allHTTPHeaderFields = headers
10083
+ request.httpBody = postData as Data
9071
10084
 
9072
10085
  let session = URLSession.shared
9073
10086
  let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
@@ -9082,25 +10095,25 @@ let dataTask = session.dataTask(with: request as URLRequest, completionHandler:
9082
10095
  dataTask.resume()
9083
10096
  ```
9084
10097
 
9085
- # Send Message
10098
+ # Reply To Message
9086
10099
 
9087
- POST https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/send
10100
+ POST https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/{message_id}/reply
9088
10101
  Content-Type: application/json
9089
10102
 
9090
- Reference: https://docs.agentmail.to/api-reference/inboxes/messages/send
10103
+ Reference: https://docs.agentmail.to/api-reference/inboxes/messages/reply
9091
10104
 
9092
10105
  ## OpenAPI Specification
9093
10106
 
9094
10107
  ```yaml
9095
10108
  openapi: 3.1.1
9096
10109
  info:
9097
- title: Send Message
9098
- version: endpoint_inboxes/messages.send
10110
+ title: Reply To Message
10111
+ version: endpoint_inboxes/messages.reply
9099
10112
  paths:
9100
- /v0/inboxes/{inbox_id}/messages/send:
9101
- post:
9102
- operationId: send
9103
- summary: Send Message
10113
+ /v0/inboxes/{inbox_id}/messages/{message_id}/reply:
10114
+ post:
10115
+ operationId: reply
10116
+ summary: Reply To Message
9104
10117
  tags:
9105
10118
  - - subpackage_inboxes
9106
10119
  - subpackage_inboxes/messages
@@ -9110,6 +10123,11 @@ paths:
9110
10123
  required: true
9111
10124
  schema:
9112
10125
  $ref: '#/components/schemas/type_inboxes:InboxId'
10126
+ - name: message_id
10127
+ in: path
10128
+ required: true
10129
+ schema:
10130
+ $ref: '#/components/schemas/type_messages:MessageId'
9113
10131
  - name: Authorization
9114
10132
  in: header
9115
10133
  description: >-
@@ -9138,11 +10156,13 @@ paths:
9138
10156
  content:
9139
10157
  application/json:
9140
10158
  schema:
9141
- $ref: '#/components/schemas/type_messages:SendMessageRequest'
10159
+ $ref: '#/components/schemas/type_messages:ReplyToMessageRequest'
9142
10160
  components:
9143
10161
  schemas:
9144
10162
  type_inboxes:InboxId:
9145
10163
  type: string
10164
+ type_messages:MessageId:
10165
+ type: string
9146
10166
  type_messages:MessageLabels:
9147
10167
  type: array
9148
10168
  items:
@@ -9161,8 +10181,8 @@ components:
9161
10181
  $ref: '#/components/schemas/type_messages:Addresses'
9162
10182
  type_messages:SendMessageBcc:
9163
10183
  $ref: '#/components/schemas/type_messages:Addresses'
9164
- type_messages:MessageSubject:
9165
- type: string
10184
+ type_messages:ReplyAll:
10185
+ type: boolean
9166
10186
  type_messages:MessageText:
9167
10187
  type: string
9168
10188
  type_messages:MessageHtml:
@@ -9192,7 +10212,7 @@ components:
9192
10212
  type: object
9193
10213
  additionalProperties:
9194
10214
  type: string
9195
- type_messages:SendMessageRequest:
10215
+ type_messages:ReplyToMessageRequest:
9196
10216
  type: object
9197
10217
  properties:
9198
10218
  labels:
@@ -9205,8 +10225,8 @@ components:
9205
10225
  $ref: '#/components/schemas/type_messages:SendMessageCc'
9206
10226
  bcc:
9207
10227
  $ref: '#/components/schemas/type_messages:SendMessageBcc'
9208
- subject:
9209
- $ref: '#/components/schemas/type_messages:MessageSubject'
10228
+ reply_all:
10229
+ $ref: '#/components/schemas/type_messages:ReplyAll'
9210
10230
  text:
9211
10231
  $ref: '#/components/schemas/type_messages:MessageText'
9212
10232
  html:
@@ -9215,8 +10235,6 @@ components:
9215
10235
  $ref: '#/components/schemas/type_messages:SendMessageAttachments'
9216
10236
  headers:
9217
10237
  $ref: '#/components/schemas/type_messages:SendMessageHeaders'
9218
- type_messages:MessageId:
9219
- type: string
9220
10238
  type_threads:ThreadId:
9221
10239
  type: string
9222
10240
  type_messages:SendMessageResponse:
@@ -9242,7 +10260,7 @@ async function main() {
9242
10260
  environment: "https://api.agentmail.to",
9243
10261
  apiKey: "YOUR_TOKEN_HERE",
9244
10262
  });
9245
- await client.inboxes.messages.send("inbox_id", {});
10263
+ await client.inboxes.messages.reply("inbox_id", "message_id", {});
9246
10264
  }
9247
10265
  main();
9248
10266
 
@@ -9256,8 +10274,9 @@ client = AgentMail(
9256
10274
  api_key="YOUR_TOKEN_HERE"
9257
10275
  )
9258
10276
 
9259
- client.inboxes.messages.send(
9260
- inbox_id="inbox_id"
10277
+ client.inboxes.messages.reply(
10278
+ inbox_id="inbox_id",
10279
+ message_id="message_id"
9261
10280
  )
9262
10281
 
9263
10282
  ```
@@ -9274,7 +10293,7 @@ import (
9274
10293
 
9275
10294
  func main() {
9276
10295
 
9277
- url := "https://api.agentmail.to/v0/inboxes/inbox_id/messages/send"
10296
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply"
9278
10297
 
9279
10298
  payload := strings.NewReader("{}")
9280
10299
 
@@ -9298,7 +10317,7 @@ func main() {
9298
10317
  require 'uri'
9299
10318
  require 'net/http'
9300
10319
 
9301
- url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/messages/send")
10320
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply")
9302
10321
 
9303
10322
  http = Net::HTTP.new(url.host, url.port)
9304
10323
  http.use_ssl = true
@@ -9313,7 +10332,7 @@ puts response.read_body
9313
10332
  ```
9314
10333
 
9315
10334
  ```java
9316
- HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/inboxes/inbox_id/messages/send")
10335
+ HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply")
9317
10336
  .header("Authorization", "Bearer <api_key>")
9318
10337
  .header("Content-Type", "application/json")
9319
10338
  .body("{}")
@@ -9325,7 +10344,7 @@ HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/inboxe
9325
10344
 
9326
10345
  $client = new \GuzzleHttp\Client();
9327
10346
 
9328
- $response = $client->request('POST', 'https://api.agentmail.to/v0/inboxes/inbox_id/messages/send', [
10347
+ $response = $client->request('POST', 'https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply', [
9329
10348
  'body' => '{}',
9330
10349
  'headers' => [
9331
10350
  'Authorization' => 'Bearer <api_key>',
@@ -9337,7 +10356,7 @@ echo $response->getBody();
9337
10356
  ```
9338
10357
 
9339
10358
  ```csharp
9340
- var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/messages/send");
10359
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply");
9341
10360
  var request = new RestRequest(Method.POST);
9342
10361
  request.AddHeader("Authorization", "Bearer <api_key>");
9343
10362
  request.AddHeader("Content-Type", "application/json");
@@ -9356,7 +10375,7 @@ let parameters = [] as [String : Any]
9356
10375
 
9357
10376
  let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
9358
10377
 
9359
- let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/messages/send")! as URL,
10378
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply")! as URL,
9360
10379
  cachePolicy: .useProtocolCachePolicy,
9361
10380
  timeoutInterval: 10.0)
9362
10381
  request.httpMethod = "POST"
@@ -9376,25 +10395,25 @@ let dataTask = session.dataTask(with: request as URLRequest, completionHandler:
9376
10395
  dataTask.resume()
9377
10396
  ```
9378
10397
 
9379
- # Reply To Message
10398
+ # Reply All Message
9380
10399
 
9381
- POST https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/{message_id}/reply
10400
+ POST https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/{message_id}/reply-all
9382
10401
  Content-Type: application/json
9383
10402
 
9384
- Reference: https://docs.agentmail.to/api-reference/inboxes/messages/reply
10403
+ Reference: https://docs.agentmail.to/api-reference/inboxes/messages/reply-all
9385
10404
 
9386
10405
  ## OpenAPI Specification
9387
10406
 
9388
10407
  ```yaml
9389
10408
  openapi: 3.1.1
9390
10409
  info:
9391
- title: Reply To Message
9392
- version: endpoint_inboxes/messages.reply
10410
+ title: Reply All Message
10411
+ version: endpoint_inboxes/messages.reply-all
9393
10412
  paths:
9394
- /v0/inboxes/{inbox_id}/messages/{message_id}/reply:
10413
+ /v0/inboxes/{inbox_id}/messages/{message_id}/reply-all:
9395
10414
  post:
9396
- operationId: reply
9397
- summary: Reply To Message
10415
+ operationId: reply-all
10416
+ summary: Reply All Message
9398
10417
  tags:
9399
10418
  - - subpackage_inboxes
9400
10419
  - subpackage_inboxes/messages
@@ -9437,7 +10456,7 @@ paths:
9437
10456
  content:
9438
10457
  application/json:
9439
10458
  schema:
9440
- $ref: '#/components/schemas/type_messages:ReplyToMessageRequest'
10459
+ $ref: '#/components/schemas/type_messages:ReplyAllMessageRequest'
9441
10460
  components:
9442
10461
  schemas:
9443
10462
  type_inboxes:InboxId:
@@ -9456,12 +10475,6 @@ components:
9456
10475
  type: string
9457
10476
  type_messages:SendMessageReplyTo:
9458
10477
  $ref: '#/components/schemas/type_messages:Addresses'
9459
- type_messages:SendMessageTo:
9460
- $ref: '#/components/schemas/type_messages:Addresses'
9461
- type_messages:SendMessageCc:
9462
- $ref: '#/components/schemas/type_messages:Addresses'
9463
- type_messages:SendMessageBcc:
9464
- $ref: '#/components/schemas/type_messages:Addresses'
9465
10478
  type_messages:MessageText:
9466
10479
  type: string
9467
10480
  type_messages:MessageHtml:
@@ -9491,19 +10504,13 @@ components:
9491
10504
  type: object
9492
10505
  additionalProperties:
9493
10506
  type: string
9494
- type_messages:ReplyToMessageRequest:
10507
+ type_messages:ReplyAllMessageRequest:
9495
10508
  type: object
9496
10509
  properties:
9497
10510
  labels:
9498
10511
  $ref: '#/components/schemas/type_messages:MessageLabels'
9499
10512
  reply_to:
9500
10513
  $ref: '#/components/schemas/type_messages:SendMessageReplyTo'
9501
- to:
9502
- $ref: '#/components/schemas/type_messages:SendMessageTo'
9503
- cc:
9504
- $ref: '#/components/schemas/type_messages:SendMessageCc'
9505
- bcc:
9506
- $ref: '#/components/schemas/type_messages:SendMessageBcc'
9507
10514
  text:
9508
10515
  $ref: '#/components/schemas/type_messages:MessageText'
9509
10516
  html:
@@ -9537,7 +10544,7 @@ async function main() {
9537
10544
  environment: "https://api.agentmail.to",
9538
10545
  apiKey: "YOUR_TOKEN_HERE",
9539
10546
  });
9540
- await client.inboxes.messages.reply("inbox_id", "message_id", {});
10547
+ await client.inboxes.messages.replyAll("inbox_id", "message_id", {});
9541
10548
  }
9542
10549
  main();
9543
10550
 
@@ -9551,7 +10558,7 @@ client = AgentMail(
9551
10558
  api_key="YOUR_TOKEN_HERE"
9552
10559
  )
9553
10560
 
9554
- client.inboxes.messages.reply(
10561
+ client.inboxes.messages.reply_all(
9555
10562
  inbox_id="inbox_id",
9556
10563
  message_id="message_id"
9557
10564
  )
@@ -9570,7 +10577,7 @@ import (
9570
10577
 
9571
10578
  func main() {
9572
10579
 
9573
- url := "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply"
10580
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply-all"
9574
10581
 
9575
10582
  payload := strings.NewReader("{}")
9576
10583
 
@@ -9594,7 +10601,7 @@ func main() {
9594
10601
  require 'uri'
9595
10602
  require 'net/http'
9596
10603
 
9597
- url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply")
10604
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply-all")
9598
10605
 
9599
10606
  http = Net::HTTP.new(url.host, url.port)
9600
10607
  http.use_ssl = true
@@ -9609,7 +10616,7 @@ puts response.read_body
9609
10616
  ```
9610
10617
 
9611
10618
  ```java
9612
- HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply")
10619
+ HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply-all")
9613
10620
  .header("Authorization", "Bearer <api_key>")
9614
10621
  .header("Content-Type", "application/json")
9615
10622
  .body("{}")
@@ -9621,7 +10628,7 @@ HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/inboxe
9621
10628
 
9622
10629
  $client = new \GuzzleHttp\Client();
9623
10630
 
9624
- $response = $client->request('POST', 'https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply', [
10631
+ $response = $client->request('POST', 'https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply-all', [
9625
10632
  'body' => '{}',
9626
10633
  'headers' => [
9627
10634
  'Authorization' => 'Bearer <api_key>',
@@ -9633,7 +10640,7 @@ echo $response->getBody();
9633
10640
  ```
9634
10641
 
9635
10642
  ```csharp
9636
- var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply");
10643
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply-all");
9637
10644
  var request = new RestRequest(Method.POST);
9638
10645
  request.AddHeader("Authorization", "Bearer <api_key>");
9639
10646
  request.AddHeader("Content-Type", "application/json");
@@ -9652,7 +10659,7 @@ let parameters = [] as [String : Any]
9652
10659
 
9653
10660
  let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
9654
10661
 
9655
- let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply")! as URL,
10662
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply-all")! as URL,
9656
10663
  cachePolicy: .useProtocolCachePolicy,
9657
10664
  timeoutInterval: 10.0)
9658
10665
  request.httpMethod = "POST"
@@ -9744,10 +10751,12 @@ components:
9744
10751
  type: array
9745
10752
  items:
9746
10753
  type: string
10754
+ description: Labels to add to message.
9747
10755
  remove_labels:
9748
10756
  type: array
9749
10757
  items:
9750
10758
  type: string
10759
+ description: Labels to remove from message.
9751
10760
  type_threads:ThreadId:
9752
10761
  type: string
9753
10762
  type_messages:MessageLabels:
@@ -9843,6 +10852,9 @@ components:
9843
10852
  type: array
9844
10853
  items:
9845
10854
  type: string
10855
+ description: >-
10856
+ Reply-to addresses. In format `username@domain.com` or `Display Name
10857
+ <username@domain.com>`.
9846
10858
  to:
9847
10859
  $ref: '#/components/schemas/type_messages:MessageTo'
9848
10860
  cc:
@@ -9859,8 +10871,10 @@ components:
9859
10871
  $ref: '#/components/schemas/type_messages:MessageHtml'
9860
10872
  extracted_text:
9861
10873
  type: string
10874
+ description: Extracted new text content.
9862
10875
  extracted_html:
9863
10876
  type: string
10877
+ description: Extracted new HTML content.
9864
10878
  attachments:
9865
10879
  $ref: '#/components/schemas/type_messages:MessageAttachments'
9866
10880
  in_reply_to:
@@ -10244,6 +11258,7 @@ components:
10244
11258
  type: array
10245
11259
  items:
10246
11260
  $ref: '#/components/schemas/type_drafts:DraftItem'
11261
+ description: Ordered by `updated_at` descending.
10247
11262
  required:
10248
11263
  - count
10249
11264
  - drafts
@@ -10545,6 +11560,7 @@ components:
10545
11560
  type: array
10546
11561
  items:
10547
11562
  type: string
11563
+ description: IDs of previous messages in thread.
10548
11564
  send_status:
10549
11565
  $ref: '#/components/schemas/type_drafts:DraftSendStatus'
10550
11566
  send_at:
@@ -10554,6 +11570,7 @@ components:
10554
11570
  created_at:
10555
11571
  type: string
10556
11572
  format: date-time
11573
+ description: Time at which draft was created.
10557
11574
  required:
10558
11575
  - inbox_id
10559
11576
  - thread_id
@@ -10886,6 +11903,7 @@ components:
10886
11903
  type: array
10887
11904
  items:
10888
11905
  type: string
11906
+ description: IDs of previous messages in thread.
10889
11907
  send_status:
10890
11908
  $ref: '#/components/schemas/type_drafts:DraftSendStatus'
10891
11909
  send_at:
@@ -10895,6 +11913,7 @@ components:
10895
11913
  created_at:
10896
11914
  type: string
10897
11915
  format: date-time
11916
+ description: Time at which draft was created.
10898
11917
  required:
10899
11918
  - inbox_id
10900
11919
  - thread_id
@@ -11244,6 +12263,7 @@ components:
11244
12263
  type: array
11245
12264
  items:
11246
12265
  type: string
12266
+ description: IDs of previous messages in thread.
11247
12267
  send_status:
11248
12268
  $ref: '#/components/schemas/type_drafts:DraftSendStatus'
11249
12269
  send_at:
@@ -11253,6 +12273,7 @@ components:
11253
12273
  created_at:
11254
12274
  type: string
11255
12275
  format: date-time
12276
+ description: Time at which draft was created.
11256
12277
  required:
11257
12278
  - inbox_id
11258
12279
  - thread_id
@@ -11483,10 +12504,12 @@ components:
11483
12504
  type: array
11484
12505
  items:
11485
12506
  type: string
12507
+ description: Labels to add to message.
11486
12508
  remove_labels:
11487
12509
  type: array
11488
12510
  items:
11489
12511
  type: string
12512
+ description: Labels to remove from message.
11490
12513
  type_messages:MessageId:
11491
12514
  type: string
11492
12515
  type_threads:ThreadId:
@@ -11927,35 +12950,43 @@ components:
11927
12950
  type: array
11928
12951
  items:
11929
12952
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
12953
+ description: Timestamps when messages were sent.
11930
12954
  delivered:
11931
12955
  type: array
11932
12956
  items:
11933
12957
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
12958
+ description: Timestamps when messages were delivered.
11934
12959
  bounced:
11935
12960
  type: array
11936
12961
  items:
11937
12962
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
12963
+ description: Timestamps when messages bounced.
11938
12964
  delayed:
11939
12965
  type: array
11940
12966
  items:
11941
12967
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
12968
+ description: Timestamps when messages were delayed.
11942
12969
  rejected:
11943
12970
  type: array
11944
12971
  items:
11945
12972
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
12973
+ description: Timestamps when messages were rejected.
11946
12974
  complained:
11947
12975
  type: array
11948
12976
  items:
11949
12977
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
12978
+ description: Timestamps when messages received complaints.
11950
12979
  received:
11951
12980
  type: array
11952
12981
  items:
11953
12982
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
12983
+ description: Timestamps when messages were received.
11954
12984
  type_metrics:ListMetricsResponse:
11955
12985
  type: object
11956
12986
  properties:
11957
12987
  message:
11958
12988
  $ref: '#/components/schemas/type_metrics:MessageMetrics'
12989
+ description: Message metrics grouped by event type.
11959
12990
 
11960
12991
  ```
11961
12992
 
@@ -12313,6 +13344,7 @@ components:
12313
13344
  type: array
12314
13345
  items:
12315
13346
  $ref: '#/components/schemas/type_threads:ThreadItem'
13347
+ description: Ordered by `timestamp` descending.
12316
13348
  required:
12317
13349
  - count
12318
13350
  - threads
@@ -12628,6 +13660,9 @@ components:
12628
13660
  type: array
12629
13661
  items:
12630
13662
  type: string
13663
+ description: >-
13664
+ Reply-to addresses. In format `username@domain.com` or `Display Name
13665
+ <username@domain.com>`.
12631
13666
  to:
12632
13667
  $ref: '#/components/schemas/type_messages:MessageTo'
12633
13668
  cc:
@@ -12644,8 +13679,10 @@ components:
12644
13679
  $ref: '#/components/schemas/type_messages:MessageHtml'
12645
13680
  extracted_text:
12646
13681
  type: string
13682
+ description: Extracted new text content.
12647
13683
  extracted_html:
12648
13684
  type: string
13685
+ description: Extracted new HTML content.
12649
13686
  attachments:
12650
13687
  $ref: '#/components/schemas/type_messages:MessageAttachments'
12651
13688
  in_reply_to:
@@ -12708,6 +13745,7 @@ components:
12708
13745
  type: array
12709
13746
  items:
12710
13747
  $ref: '#/components/schemas/type_messages:Message'
13748
+ description: Messages in thread. Ordered by `timestamp` ascending.
12711
13749
  required:
12712
13750
  - inbox_id
12713
13751
  - thread_id
@@ -13242,6 +14280,7 @@ components:
13242
14280
  type: array
13243
14281
  items:
13244
14282
  $ref: '#/components/schemas/type_drafts:DraftItem'
14283
+ description: Ordered by `updated_at` descending.
13245
14284
  required:
13246
14285
  - count
13247
14286
  - drafts
@@ -13535,6 +14574,7 @@ components:
13535
14574
  type: array
13536
14575
  items:
13537
14576
  type: string
14577
+ description: IDs of previous messages in thread.
13538
14578
  send_status:
13539
14579
  $ref: '#/components/schemas/type_drafts:DraftSendStatus'
13540
14580
  send_at:
@@ -13544,6 +14584,7 @@ components:
13544
14584
  created_at:
13545
14585
  type: string
13546
14586
  format: date-time
14587
+ description: Time at which draft was created.
13547
14588
  required:
13548
14589
  - inbox_id
13549
14590
  - thread_id
@@ -13755,9 +14796,11 @@ components:
13755
14796
  updated_at:
13756
14797
  type: string
13757
14798
  format: date-time
14799
+ description: Time at which the domain was last updated.
13758
14800
  created_at:
13759
14801
  type: string
13760
14802
  format: date-time
14803
+ description: Time at which the domain was created.
13761
14804
  required:
13762
14805
  - domain_id
13763
14806
  - feedback_enabled
@@ -13776,6 +14819,7 @@ components:
13776
14819
  type: array
13777
14820
  items:
13778
14821
  $ref: '#/components/schemas/type_domains:DomainItem'
14822
+ description: Ordered by `created_at` descending.
13779
14823
  required:
13780
14824
  - count
13781
14825
  - domains
@@ -13979,14 +15023,19 @@ components:
13979
15023
  properties:
13980
15024
  type:
13981
15025
  $ref: '#/components/schemas/type_domains:RecordType'
15026
+ description: The type of the DNS record.
13982
15027
  name:
13983
15028
  type: string
15029
+ description: The name or host of the record.
13984
15030
  value:
13985
15031
  type: string
15032
+ description: The value of the record.
13986
15033
  status:
13987
15034
  $ref: '#/components/schemas/type_domains:RecordStatus'
15035
+ description: The verification status of this specific record.
13988
15036
  priority:
13989
15037
  type: integer
15038
+ description: The priority of the MX record.
13990
15039
  required:
13991
15040
  - type
13992
15041
  - name
@@ -14003,20 +15052,24 @@ components:
14003
15052
  $ref: '#/components/schemas/type_domains:DomainId'
14004
15053
  status:
14005
15054
  $ref: '#/components/schemas/type_domains:VerificationStatus'
15055
+ description: The verification status of the domain.
14006
15056
  feedback_enabled:
14007
15057
  $ref: '#/components/schemas/type_domains:FeedbackEnabled'
14008
15058
  records:
14009
15059
  type: array
14010
15060
  items:
14011
15061
  $ref: '#/components/schemas/type_domains:VerificationRecord'
15062
+ description: A list of DNS records required to verify the domain.
14012
15063
  client_id:
14013
15064
  $ref: '#/components/schemas/type_domains:ClientId'
14014
15065
  updated_at:
14015
15066
  type: string
14016
15067
  format: date-time
15068
+ description: Time at which the domain was last updated.
14017
15069
  created_at:
14018
15070
  type: string
14019
15071
  format: date-time
15072
+ description: Time at which the domain was created.
14020
15073
  required:
14021
15074
  - domain_id
14022
15075
  - status
@@ -14416,14 +15469,19 @@ components:
14416
15469
  properties:
14417
15470
  type:
14418
15471
  $ref: '#/components/schemas/type_domains:RecordType'
15472
+ description: The type of the DNS record.
14419
15473
  name:
14420
15474
  type: string
15475
+ description: The name or host of the record.
14421
15476
  value:
14422
15477
  type: string
15478
+ description: The value of the record.
14423
15479
  status:
14424
15480
  $ref: '#/components/schemas/type_domains:RecordStatus'
15481
+ description: The verification status of this specific record.
14425
15482
  priority:
14426
15483
  type: integer
15484
+ description: The priority of the MX record.
14427
15485
  required:
14428
15486
  - type
14429
15487
  - name
@@ -14440,20 +15498,24 @@ components:
14440
15498
  $ref: '#/components/schemas/type_domains:DomainId'
14441
15499
  status:
14442
15500
  $ref: '#/components/schemas/type_domains:VerificationStatus'
15501
+ description: The verification status of the domain.
14443
15502
  feedback_enabled:
14444
15503
  $ref: '#/components/schemas/type_domains:FeedbackEnabled'
14445
15504
  records:
14446
15505
  type: array
14447
15506
  items:
14448
15507
  $ref: '#/components/schemas/type_domains:VerificationRecord'
15508
+ description: A list of DNS records required to verify the domain.
14449
15509
  client_id:
14450
15510
  $ref: '#/components/schemas/type_domains:ClientId'
14451
15511
  updated_at:
14452
15512
  type: string
14453
15513
  format: date-time
15514
+ description: Time at which the domain was last updated.
14454
15515
  created_at:
14455
15516
  type: string
14456
15517
  format: date-time
15518
+ description: Time at which the domain was created.
14457
15519
  required:
14458
15520
  - domain_id
14459
15521
  - status
@@ -15053,14 +16115,18 @@ components:
15053
16115
  $ref: '#/components/schemas/type_webhooks:InboxIds'
15054
16116
  secret:
15055
16117
  type: string
16118
+ description: Secret for webhook signature verification.
15056
16119
  enabled:
15057
16120
  type: boolean
16121
+ description: Whether the webhook is enabled.
15058
16122
  updated_at:
15059
16123
  type: string
15060
16124
  format: date-time
16125
+ description: Time at which webhook was last updated.
15061
16126
  created_at:
15062
16127
  type: string
15063
16128
  format: date-time
16129
+ description: Time at which webhook was created.
15064
16130
  client_id:
15065
16131
  $ref: '#/components/schemas/type_webhooks:ClientId'
15066
16132
  required:
@@ -15083,6 +16149,7 @@ components:
15083
16149
  type: array
15084
16150
  items:
15085
16151
  $ref: '#/components/schemas/type_webhooks:Webhook'
16152
+ description: Ordered by `created_at` descending.
15086
16153
  required:
15087
16154
  - count
15088
16155
  - webhooks
@@ -15295,14 +16362,18 @@ components:
15295
16362
  $ref: '#/components/schemas/type_webhooks:InboxIds'
15296
16363
  secret:
15297
16364
  type: string
16365
+ description: Secret for webhook signature verification.
15298
16366
  enabled:
15299
16367
  type: boolean
16368
+ description: Whether the webhook is enabled.
15300
16369
  updated_at:
15301
16370
  type: string
15302
16371
  format: date-time
16372
+ description: Time at which webhook was last updated.
15303
16373
  created_at:
15304
16374
  type: string
15305
16375
  format: date-time
16376
+ description: Time at which webhook was created.
15306
16377
  client_id:
15307
16378
  $ref: '#/components/schemas/type_webhooks:ClientId'
15308
16379
  required:
@@ -15538,14 +16609,18 @@ components:
15538
16609
  $ref: '#/components/schemas/type_webhooks:InboxIds'
15539
16610
  secret:
15540
16611
  type: string
16612
+ description: Secret for webhook signature verification.
15541
16613
  enabled:
15542
16614
  type: boolean
16615
+ description: Whether the webhook is enabled.
15543
16616
  updated_at:
15544
16617
  type: string
15545
16618
  format: date-time
16619
+ description: Time at which webhook was last updated.
15546
16620
  created_at:
15547
16621
  type: string
15548
16622
  format: date-time
16623
+ description: Time at which webhook was created.
15549
16624
  client_id:
15550
16625
  $ref: '#/components/schemas/type_webhooks:ClientId'
15551
16626
  required:
@@ -16047,6 +17122,9 @@ components:
16047
17122
  type: array
16048
17123
  items:
16049
17124
  type: string
17125
+ description: >-
17126
+ Reply-to addresses. In format `username@domain.com` or `Display Name
17127
+ <username@domain.com>`.
16050
17128
  to:
16051
17129
  $ref: '#/components/schemas/type_messages:MessageTo'
16052
17130
  cc:
@@ -16063,8 +17141,10 @@ components:
16063
17141
  $ref: '#/components/schemas/type_messages:MessageHtml'
16064
17142
  extracted_text:
16065
17143
  type: string
17144
+ description: Extracted new text content.
16066
17145
  extracted_html:
16067
17146
  type: string
17147
+ description: Extracted new HTML content.
16068
17148
  attachments:
16069
17149
  $ref: '#/components/schemas/type_messages:MessageAttachments'
16070
17150
  in_reply_to:
@@ -16088,6 +17168,96 @@ components:
16088
17168
  - size
16089
17169
  - updated_at
16090
17170
  - created_at
17171
+ type_threads:ThreadLabels:
17172
+ type: array
17173
+ items:
17174
+ type: string
17175
+ type_threads:ThreadTimestamp:
17176
+ type: string
17177
+ format: date-time
17178
+ type_threads:ThreadReceivedTimestamp:
17179
+ type: string
17180
+ format: date-time
17181
+ type_threads:ThreadSentTimestamp:
17182
+ type: string
17183
+ format: date-time
17184
+ type_threads:ThreadSenders:
17185
+ type: array
17186
+ items:
17187
+ type: string
17188
+ type_threads:ThreadRecipients:
17189
+ type: array
17190
+ items:
17191
+ type: string
17192
+ type_threads:ThreadSubject:
17193
+ type: string
17194
+ type_threads:ThreadPreview:
17195
+ type: string
17196
+ type_threads:ThreadAttachments:
17197
+ type: array
17198
+ items:
17199
+ $ref: '#/components/schemas/type_attachments:Attachment'
17200
+ type_threads:ThreadLastMessageId:
17201
+ type: string
17202
+ type_threads:ThreadMessageCount:
17203
+ type: integer
17204
+ type_threads:ThreadSize:
17205
+ type: integer
17206
+ type_threads:ThreadUpdatedAt:
17207
+ type: string
17208
+ format: date-time
17209
+ type_threads:ThreadCreatedAt:
17210
+ type: string
17211
+ format: date-time
17212
+ type_threads:ThreadItem:
17213
+ type: object
17214
+ properties:
17215
+ inbox_id:
17216
+ $ref: '#/components/schemas/type_inboxes:InboxId'
17217
+ thread_id:
17218
+ $ref: '#/components/schemas/type_threads:ThreadId'
17219
+ labels:
17220
+ $ref: '#/components/schemas/type_threads:ThreadLabels'
17221
+ timestamp:
17222
+ $ref: '#/components/schemas/type_threads:ThreadTimestamp'
17223
+ received_timestamp:
17224
+ $ref: '#/components/schemas/type_threads:ThreadReceivedTimestamp'
17225
+ sent_timestamp:
17226
+ $ref: '#/components/schemas/type_threads:ThreadSentTimestamp'
17227
+ senders:
17228
+ $ref: '#/components/schemas/type_threads:ThreadSenders'
17229
+ recipients:
17230
+ $ref: '#/components/schemas/type_threads:ThreadRecipients'
17231
+ subject:
17232
+ $ref: '#/components/schemas/type_threads:ThreadSubject'
17233
+ preview:
17234
+ $ref: '#/components/schemas/type_threads:ThreadPreview'
17235
+ attachments:
17236
+ $ref: '#/components/schemas/type_threads:ThreadAttachments'
17237
+ last_message_id:
17238
+ $ref: '#/components/schemas/type_threads:ThreadLastMessageId'
17239
+ message_count:
17240
+ $ref: '#/components/schemas/type_threads:ThreadMessageCount'
17241
+ size:
17242
+ $ref: '#/components/schemas/type_threads:ThreadSize'
17243
+ updated_at:
17244
+ $ref: '#/components/schemas/type_threads:ThreadUpdatedAt'
17245
+ created_at:
17246
+ $ref: '#/components/schemas/type_threads:ThreadCreatedAt'
17247
+ required:
17248
+ - inbox_id
17249
+ - thread_id
17250
+ - labels
17251
+ - timestamp
17252
+ - received_timestamp
17253
+ - sent_timestamp
17254
+ - senders
17255
+ - recipients
17256
+ - last_message_id
17257
+ - message_count
17258
+ - size
17259
+ - updated_at
17260
+ - created_at
16091
17261
  type_events:MessageReceivedEvent:
16092
17262
  type: object
16093
17263
  properties:
@@ -16105,11 +17275,14 @@ components:
16105
17275
  $ref: '#/components/schemas/type_events:EventId'
16106
17276
  message:
16107
17277
  $ref: '#/components/schemas/type_messages:Message'
17278
+ thread:
17279
+ $ref: '#/components/schemas/type_threads:ThreadItem'
16108
17280
  required:
16109
17281
  - type
16110
17282
  - event_type
16111
17283
  - event_id
16112
17284
  - message
17285
+ - thread
16113
17286
 
16114
17287
  ```
16115
17288
 
@@ -16192,6 +17365,7 @@ components:
16192
17365
  type: array
16193
17366
  items:
16194
17367
  type: string
17368
+ description: Sent recipients.
16195
17369
  required:
16196
17370
  - inbox_id
16197
17371
  - thread_id
@@ -16302,6 +17476,7 @@ components:
16302
17476
  type: array
16303
17477
  items:
16304
17478
  type: string
17479
+ description: Delivered recipients.
16305
17480
  required:
16306
17481
  - inbox_id
16307
17482
  - thread_id
@@ -16402,8 +17577,10 @@ components:
16402
17577
  properties:
16403
17578
  address:
16404
17579
  type: string
17580
+ description: Recipient address.
16405
17581
  status:
16406
17582
  type: string
17583
+ description: Recipient status.
16407
17584
  required:
16408
17585
  - address
16409
17586
  - status
@@ -16420,12 +17597,15 @@ components:
16420
17597
  $ref: '#/components/schemas/type_events:Timestamp'
16421
17598
  type:
16422
17599
  type: string
17600
+ description: Bounce type.
16423
17601
  sub_type:
16424
17602
  type: string
17603
+ description: Bounce sub-type.
16425
17604
  recipients:
16426
17605
  type: array
16427
17606
  items:
16428
17607
  $ref: '#/components/schemas/type_events:Recipient'
17608
+ description: Bounced recipients.
16429
17609
  required:
16430
17610
  - inbox_id
16431
17611
  - thread_id
@@ -16536,12 +17716,15 @@ components:
16536
17716
  $ref: '#/components/schemas/type_events:Timestamp'
16537
17717
  type:
16538
17718
  type: string
17719
+ description: Complaint type.
16539
17720
  sub_type:
16540
17721
  type: string
17722
+ description: Complaint sub-type.
16541
17723
  recipients:
16542
17724
  type: array
16543
17725
  items:
16544
17726
  type: string
17727
+ description: Complained recipients.
16545
17728
  required:
16546
17729
  - inbox_id
16547
17730
  - thread_id
@@ -16652,6 +17835,7 @@ components:
16652
17835
  $ref: '#/components/schemas/type_events:Timestamp'
16653
17836
  reason:
16654
17837
  type: string
17838
+ description: Reject reason.
16655
17839
  required:
16656
17840
  - inbox_id
16657
17841
  - thread_id
@@ -16766,14 +17950,19 @@ components:
16766
17950
  properties:
16767
17951
  type:
16768
17952
  $ref: '#/components/schemas/type_domains:RecordType'
17953
+ description: The type of the DNS record.
16769
17954
  name:
16770
17955
  type: string
17956
+ description: The name or host of the record.
16771
17957
  value:
16772
17958
  type: string
17959
+ description: The value of the record.
16773
17960
  status:
16774
17961
  $ref: '#/components/schemas/type_domains:RecordStatus'
17962
+ description: The verification status of this specific record.
16775
17963
  priority:
16776
17964
  type: integer
17965
+ description: The priority of the MX record.
16777
17966
  required:
16778
17967
  - type
16779
17968
  - name
@@ -16790,20 +17979,24 @@ components:
16790
17979
  $ref: '#/components/schemas/type_domains:DomainId'
16791
17980
  status:
16792
17981
  $ref: '#/components/schemas/type_domains:VerificationStatus'
17982
+ description: The verification status of the domain.
16793
17983
  feedback_enabled:
16794
17984
  $ref: '#/components/schemas/type_domains:FeedbackEnabled'
16795
17985
  records:
16796
17986
  type: array
16797
17987
  items:
16798
17988
  $ref: '#/components/schemas/type_domains:VerificationRecord'
17989
+ description: A list of DNS records required to verify the domain.
16799
17990
  client_id:
16800
17991
  $ref: '#/components/schemas/type_domains:ClientId'
16801
17992
  updated_at:
16802
17993
  type: string
16803
17994
  format: date-time
17995
+ description: Time at which the domain was last updated.
16804
17996
  created_at:
16805
17997
  type: string
16806
17998
  format: date-time
17999
+ description: Time at which the domain was created.
16807
18000
  required:
16808
18001
  - domain_id
16809
18002
  - status
@@ -16957,10 +18150,12 @@ components:
16957
18150
  type: array
16958
18151
  items:
16959
18152
  type: string
18153
+ description: IDs of the inboxes that have been subscribed to.
16960
18154
  pod_ids:
16961
18155
  type: array
16962
18156
  items:
16963
18157
  type: string
18158
+ description: IDs of the pods that have been subscribed to.
16964
18159
  required:
16965
18160
  - type
16966
18161
  type_events:EventId:
@@ -17064,6 +18259,9 @@ components:
17064
18259
  type: array
17065
18260
  items:
17066
18261
  type: string
18262
+ description: >-
18263
+ Reply-to addresses. In format `username@domain.com` or `Display Name
18264
+ <username@domain.com>`.
17067
18265
  to:
17068
18266
  $ref: '#/components/schemas/type_messages:MessageTo'
17069
18267
  cc:
@@ -17080,8 +18278,10 @@ components:
17080
18278
  $ref: '#/components/schemas/type_messages:MessageHtml'
17081
18279
  extracted_text:
17082
18280
  type: string
18281
+ description: Extracted new text content.
17083
18282
  extracted_html:
17084
18283
  type: string
18284
+ description: Extracted new HTML content.
17085
18285
  attachments:
17086
18286
  $ref: '#/components/schemas/type_messages:MessageAttachments'
17087
18287
  in_reply_to:
@@ -17105,6 +18305,96 @@ components:
17105
18305
  - size
17106
18306
  - updated_at
17107
18307
  - created_at
18308
+ type_threads:ThreadLabels:
18309
+ type: array
18310
+ items:
18311
+ type: string
18312
+ type_threads:ThreadTimestamp:
18313
+ type: string
18314
+ format: date-time
18315
+ type_threads:ThreadReceivedTimestamp:
18316
+ type: string
18317
+ format: date-time
18318
+ type_threads:ThreadSentTimestamp:
18319
+ type: string
18320
+ format: date-time
18321
+ type_threads:ThreadSenders:
18322
+ type: array
18323
+ items:
18324
+ type: string
18325
+ type_threads:ThreadRecipients:
18326
+ type: array
18327
+ items:
18328
+ type: string
18329
+ type_threads:ThreadSubject:
18330
+ type: string
18331
+ type_threads:ThreadPreview:
18332
+ type: string
18333
+ type_threads:ThreadAttachments:
18334
+ type: array
18335
+ items:
18336
+ $ref: '#/components/schemas/type_attachments:Attachment'
18337
+ type_threads:ThreadLastMessageId:
18338
+ type: string
18339
+ type_threads:ThreadMessageCount:
18340
+ type: integer
18341
+ type_threads:ThreadSize:
18342
+ type: integer
18343
+ type_threads:ThreadUpdatedAt:
18344
+ type: string
18345
+ format: date-time
18346
+ type_threads:ThreadCreatedAt:
18347
+ type: string
18348
+ format: date-time
18349
+ type_threads:ThreadItem:
18350
+ type: object
18351
+ properties:
18352
+ inbox_id:
18353
+ $ref: '#/components/schemas/type_inboxes:InboxId'
18354
+ thread_id:
18355
+ $ref: '#/components/schemas/type_threads:ThreadId'
18356
+ labels:
18357
+ $ref: '#/components/schemas/type_threads:ThreadLabels'
18358
+ timestamp:
18359
+ $ref: '#/components/schemas/type_threads:ThreadTimestamp'
18360
+ received_timestamp:
18361
+ $ref: '#/components/schemas/type_threads:ThreadReceivedTimestamp'
18362
+ sent_timestamp:
18363
+ $ref: '#/components/schemas/type_threads:ThreadSentTimestamp'
18364
+ senders:
18365
+ $ref: '#/components/schemas/type_threads:ThreadSenders'
18366
+ recipients:
18367
+ $ref: '#/components/schemas/type_threads:ThreadRecipients'
18368
+ subject:
18369
+ $ref: '#/components/schemas/type_threads:ThreadSubject'
18370
+ preview:
18371
+ $ref: '#/components/schemas/type_threads:ThreadPreview'
18372
+ attachments:
18373
+ $ref: '#/components/schemas/type_threads:ThreadAttachments'
18374
+ last_message_id:
18375
+ $ref: '#/components/schemas/type_threads:ThreadLastMessageId'
18376
+ message_count:
18377
+ $ref: '#/components/schemas/type_threads:ThreadMessageCount'
18378
+ size:
18379
+ $ref: '#/components/schemas/type_threads:ThreadSize'
18380
+ updated_at:
18381
+ $ref: '#/components/schemas/type_threads:ThreadUpdatedAt'
18382
+ created_at:
18383
+ $ref: '#/components/schemas/type_threads:ThreadCreatedAt'
18384
+ required:
18385
+ - inbox_id
18386
+ - thread_id
18387
+ - labels
18388
+ - timestamp
18389
+ - received_timestamp
18390
+ - sent_timestamp
18391
+ - senders
18392
+ - recipients
18393
+ - last_message_id
18394
+ - message_count
18395
+ - size
18396
+ - updated_at
18397
+ - created_at
17108
18398
  type_events:MessageReceivedEvent:
17109
18399
  type: object
17110
18400
  properties:
@@ -17122,11 +18412,14 @@ components:
17122
18412
  $ref: '#/components/schemas/type_events:EventId'
17123
18413
  message:
17124
18414
  $ref: '#/components/schemas/type_messages:Message'
18415
+ thread:
18416
+ $ref: '#/components/schemas/type_threads:ThreadItem'
17125
18417
  required:
17126
18418
  - type
17127
18419
  - event_type
17128
18420
  - event_id
17129
18421
  - message
18422
+ - thread
17130
18423
  type_events:Timestamp:
17131
18424
  type: string
17132
18425
  format: date-time
@@ -17145,6 +18438,7 @@ components:
17145
18438
  type: array
17146
18439
  items:
17147
18440
  type: string
18441
+ description: Sent recipients.
17148
18442
  required:
17149
18443
  - inbox_id
17150
18444
  - thread_id
@@ -17188,6 +18482,7 @@ components:
17188
18482
  type: array
17189
18483
  items:
17190
18484
  type: string
18485
+ description: Delivered recipients.
17191
18486
  required:
17192
18487
  - inbox_id
17193
18488
  - thread_id
@@ -17221,8 +18516,10 @@ components:
17221
18516
  properties:
17222
18517
  address:
17223
18518
  type: string
18519
+ description: Recipient address.
17224
18520
  status:
17225
18521
  type: string
18522
+ description: Recipient status.
17226
18523
  required:
17227
18524
  - address
17228
18525
  - status
@@ -17239,12 +18536,15 @@ components:
17239
18536
  $ref: '#/components/schemas/type_events:Timestamp'
17240
18537
  type:
17241
18538
  type: string
18539
+ description: Bounce type.
17242
18540
  sub_type:
17243
18541
  type: string
18542
+ description: Bounce sub-type.
17244
18543
  recipients:
17245
18544
  type: array
17246
18545
  items:
17247
18546
  $ref: '#/components/schemas/type_events:Recipient'
18547
+ description: Bounced recipients.
17248
18548
  required:
17249
18549
  - inbox_id
17250
18550
  - thread_id
@@ -17288,12 +18588,15 @@ components:
17288
18588
  $ref: '#/components/schemas/type_events:Timestamp'
17289
18589
  type:
17290
18590
  type: string
18591
+ description: Complaint type.
17291
18592
  sub_type:
17292
18593
  type: string
18594
+ description: Complaint sub-type.
17293
18595
  recipients:
17294
18596
  type: array
17295
18597
  items:
17296
18598
  type: string
18599
+ description: Complained recipients.
17297
18600
  required:
17298
18601
  - inbox_id
17299
18602
  - thread_id
@@ -17337,6 +18640,7 @@ components:
17337
18640
  $ref: '#/components/schemas/type_events:Timestamp'
17338
18641
  reason:
17339
18642
  type: string
18643
+ description: Reject reason.
17340
18644
  required:
17341
18645
  - inbox_id
17342
18646
  - thread_id
@@ -17393,14 +18697,19 @@ components:
17393
18697
  properties:
17394
18698
  type:
17395
18699
  $ref: '#/components/schemas/type_domains:RecordType'
18700
+ description: The type of the DNS record.
17396
18701
  name:
17397
18702
  type: string
18703
+ description: The name or host of the record.
17398
18704
  value:
17399
18705
  type: string
18706
+ description: The value of the record.
17400
18707
  status:
17401
18708
  $ref: '#/components/schemas/type_domains:RecordStatus'
18709
+ description: The verification status of this specific record.
17402
18710
  priority:
17403
18711
  type: integer
18712
+ description: The priority of the MX record.
17404
18713
  required:
17405
18714
  - type
17406
18715
  - name
@@ -17417,20 +18726,24 @@ components:
17417
18726
  $ref: '#/components/schemas/type_domains:DomainId'
17418
18727
  status:
17419
18728
  $ref: '#/components/schemas/type_domains:VerificationStatus'
18729
+ description: The verification status of the domain.
17420
18730
  feedback_enabled:
17421
18731
  $ref: '#/components/schemas/type_domains:FeedbackEnabled'
17422
18732
  records:
17423
18733
  type: array
17424
18734
  items:
17425
18735
  $ref: '#/components/schemas/type_domains:VerificationRecord'
18736
+ description: A list of DNS records required to verify the domain.
17426
18737
  client_id:
17427
18738
  $ref: '#/components/schemas/type_domains:ClientId'
17428
18739
  updated_at:
17429
18740
  type: string
17430
18741
  format: date-time
18742
+ description: Time at which the domain was last updated.
17431
18743
  created_at:
17432
18744
  type: string
17433
18745
  format: date-time
18746
+ description: Time at which the domain was created.
17434
18747
  required:
17435
18748
  - domain_id
17436
18749
  - status
@@ -17474,10 +18787,12 @@ components:
17474
18787
  type: array
17475
18788
  items:
17476
18789
  type: string
18790
+ description: IDs of the inboxes to subscribe to.
17477
18791
  pod_ids:
17478
18792
  type: array
17479
18793
  items:
17480
18794
  type: string
18795
+ description: IDs of the pods to subscribe to.
17481
18796
  required:
17482
18797
  - type
17483
18798
 
@@ -17569,35 +18884,43 @@ components:
17569
18884
  type: array
17570
18885
  items:
17571
18886
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
18887
+ description: Timestamps when messages were sent.
17572
18888
  delivered:
17573
18889
  type: array
17574
18890
  items:
17575
18891
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
18892
+ description: Timestamps when messages were delivered.
17576
18893
  bounced:
17577
18894
  type: array
17578
18895
  items:
17579
18896
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
18897
+ description: Timestamps when messages bounced.
17580
18898
  delayed:
17581
18899
  type: array
17582
18900
  items:
17583
18901
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
18902
+ description: Timestamps when messages were delayed.
17584
18903
  rejected:
17585
18904
  type: array
17586
18905
  items:
17587
18906
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
18907
+ description: Timestamps when messages were rejected.
17588
18908
  complained:
17589
18909
  type: array
17590
18910
  items:
17591
18911
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
18912
+ description: Timestamps when messages received complaints.
17592
18913
  received:
17593
18914
  type: array
17594
18915
  items:
17595
18916
  $ref: '#/components/schemas/type_metrics:MetricTimestamp'
18917
+ description: Timestamps when messages were received.
17596
18918
  type_metrics:ListMetricsResponse:
17597
18919
  type: object
17598
18920
  properties:
17599
18921
  message:
17600
18922
  $ref: '#/components/schemas/type_metrics:MessageMetrics'
18923
+ description: Message metrics grouped by event type.
17601
18924
 
17602
18925
  ```
17603
18926
 
@@ -17806,6 +19129,7 @@ components:
17806
19129
  used_at:
17807
19130
  type: string
17808
19131
  format: date-time
19132
+ description: Time at which api key was last used.
17809
19133
  created_at:
17810
19134
  $ref: '#/components/schemas/type_api-keys:CreatedAt'
17811
19135
  required:
@@ -17824,6 +19148,7 @@ components:
17824
19148
  type: array
17825
19149
  items:
17826
19150
  $ref: '#/components/schemas/type_api-keys:ApiKey'
19151
+ description: Ordered by `created_at` descending.
17827
19152
  required:
17828
19153
  - count
17829
19154
  - api_keys
@@ -18023,6 +19348,7 @@ components:
18023
19348
  $ref: '#/components/schemas/type_api-keys:ApiKeyId'
18024
19349
  api_key:
18025
19350
  type: string
19351
+ description: API key.
18026
19352
  prefix:
18027
19353
  $ref: '#/components/schemas/type_api-keys:Prefix'
18028
19354
  name:
@@ -18428,9 +19754,11 @@ components:
18428
19754
  updated_at:
18429
19755
  type: string
18430
19756
  format: date-time
19757
+ description: Time at which pod was last updated.
18431
19758
  created_at:
18432
19759
  type: string
18433
19760
  format: date-time
19761
+ description: Time at which pod was created.
18434
19762
  client_id:
18435
19763
  $ref: '#/components/schemas/type_pods:ClientId'
18436
19764
  required:
@@ -18451,6 +19779,7 @@ components:
18451
19779
  type: array
18452
19780
  items:
18453
19781
  $ref: '#/components/schemas/type_pods:Pod'
19782
+ description: Ordered by `created_at` descending.
18454
19783
  required:
18455
19784
  - count
18456
19785
  - pods
@@ -18642,9 +19971,11 @@ components:
18642
19971
  updated_at:
18643
19972
  type: string
18644
19973
  format: date-time
19974
+ description: Time at which pod was last updated.
18645
19975
  created_at:
18646
19976
  type: string
18647
19977
  format: date-time
19978
+ description: Time at which pod was created.
18648
19979
  client_id:
18649
19980
  $ref: '#/components/schemas/type_pods:ClientId'
18650
19981
  required:
@@ -18850,9 +20181,11 @@ components:
18850
20181
  updated_at:
18851
20182
  type: string
18852
20183
  format: date-time
20184
+ description: Time at which pod was last updated.
18853
20185
  created_at:
18854
20186
  type: string
18855
20187
  format: date-time
20188
+ description: Time at which pod was created.
18856
20189
  client_id:
18857
20190
  $ref: '#/components/schemas/type_pods:ClientId'
18858
20191
  required:
@@ -19294,9 +20627,11 @@ components:
19294
20627
  updated_at:
19295
20628
  type: string
19296
20629
  format: date-time
20630
+ description: Time at which inbox was last updated.
19297
20631
  created_at:
19298
20632
  type: string
19299
20633
  format: date-time
20634
+ description: Time at which inbox was created.
19300
20635
  required:
19301
20636
  - pod_id
19302
20637
  - inbox_id
@@ -19315,6 +20650,7 @@ components:
19315
20650
  type: array
19316
20651
  items:
19317
20652
  $ref: '#/components/schemas/type_inboxes:Inbox'
20653
+ description: Ordered by `created_at` descending.
19318
20654
  required:
19319
20655
  - count
19320
20656
  - inboxes
@@ -19520,9 +20856,11 @@ components:
19520
20856
  updated_at:
19521
20857
  type: string
19522
20858
  format: date-time
20859
+ description: Time at which inbox was last updated.
19523
20860
  created_at:
19524
20861
  type: string
19525
20862
  format: date-time
20863
+ description: Time at which inbox was created.
19526
20864
  required:
19527
20865
  - pod_id
19528
20866
  - inbox_id
@@ -19721,8 +21059,12 @@ components:
19721
21059
  properties:
19722
21060
  username:
19723
21061
  type: string
21062
+ description: Username of address. Randomly generated if not specified.
19724
21063
  domain:
19725
21064
  type: string
21065
+ description: >-
21066
+ Domain of address. Must be verified domain. Defaults to
21067
+ `agentmail.to`.
19726
21068
  display_name:
19727
21069
  $ref: '#/components/schemas/type_inboxes:DisplayName'
19728
21070
  client_id:
@@ -19743,9 +21085,11 @@ components:
19743
21085
  updated_at:
19744
21086
  type: string
19745
21087
  format: date-time
21088
+ description: Time at which inbox was last updated.
19746
21089
  created_at:
19747
21090
  type: string
19748
21091
  format: date-time
21092
+ description: Time at which inbox was created.
19749
21093
  required:
19750
21094
  - pod_id
19751
21095
  - inbox_id
@@ -20310,6 +21654,7 @@ components:
20310
21654
  type: array
20311
21655
  items:
20312
21656
  $ref: '#/components/schemas/type_threads:ThreadItem'
21657
+ description: Ordered by `timestamp` descending.
20313
21658
  required:
20314
21659
  - count
20315
21660
  - threads
@@ -20635,6 +21980,9 @@ components:
20635
21980
  type: array
20636
21981
  items:
20637
21982
  type: string
21983
+ description: >-
21984
+ Reply-to addresses. In format `username@domain.com` or `Display Name
21985
+ <username@domain.com>`.
20638
21986
  to:
20639
21987
  $ref: '#/components/schemas/type_messages:MessageTo'
20640
21988
  cc:
@@ -20651,8 +21999,10 @@ components:
20651
21999
  $ref: '#/components/schemas/type_messages:MessageHtml'
20652
22000
  extracted_text:
20653
22001
  type: string
22002
+ description: Extracted new text content.
20654
22003
  extracted_html:
20655
22004
  type: string
22005
+ description: Extracted new HTML content.
20656
22006
  attachments:
20657
22007
  $ref: '#/components/schemas/type_messages:MessageAttachments'
20658
22008
  in_reply_to:
@@ -20715,6 +22065,7 @@ components:
20715
22065
  type: array
20716
22066
  items:
20717
22067
  $ref: '#/components/schemas/type_messages:Message'
22068
+ description: Messages in thread. Ordered by `timestamp` ascending.
20718
22069
  required:
20719
22070
  - inbox_id
20720
22071
  - thread_id
@@ -21267,6 +22618,7 @@ components:
21267
22618
  type: array
21268
22619
  items:
21269
22620
  $ref: '#/components/schemas/type_drafts:DraftItem'
22621
+ description: Ordered by `updated_at` descending.
21270
22622
  required:
21271
22623
  - count
21272
22624
  - drafts
@@ -21570,6 +22922,7 @@ components:
21570
22922
  type: array
21571
22923
  items:
21572
22924
  type: string
22925
+ description: IDs of previous messages in thread.
21573
22926
  send_status:
21574
22927
  $ref: '#/components/schemas/type_drafts:DraftSendStatus'
21575
22928
  send_at:
@@ -21579,6 +22932,7 @@ components:
21579
22932
  created_at:
21580
22933
  type: string
21581
22934
  format: date-time
22935
+ description: Time at which draft was created.
21582
22936
  required:
21583
22937
  - inbox_id
21584
22938
  - thread_id
@@ -21832,9 +23186,11 @@ components:
21832
23186
  updated_at:
21833
23187
  type: string
21834
23188
  format: date-time
23189
+ description: Time at which the domain was last updated.
21835
23190
  created_at:
21836
23191
  type: string
21837
23192
  format: date-time
23193
+ description: Time at which the domain was created.
21838
23194
  required:
21839
23195
  - domain_id
21840
23196
  - feedback_enabled
@@ -21853,6 +23209,7 @@ components:
21853
23209
  type: array
21854
23210
  items:
21855
23211
  $ref: '#/components/schemas/type_domains:DomainItem'
23212
+ description: Ordered by `created_at` descending.
21856
23213
  required:
21857
23214
  - count
21858
23215
  - domains
@@ -22077,14 +23434,19 @@ components:
22077
23434
  properties:
22078
23435
  type:
22079
23436
  $ref: '#/components/schemas/type_domains:RecordType'
23437
+ description: The type of the DNS record.
22080
23438
  name:
22081
23439
  type: string
23440
+ description: The name or host of the record.
22082
23441
  value:
22083
23442
  type: string
23443
+ description: The value of the record.
22084
23444
  status:
22085
23445
  $ref: '#/components/schemas/type_domains:RecordStatus'
23446
+ description: The verification status of this specific record.
22086
23447
  priority:
22087
23448
  type: integer
23449
+ description: The priority of the MX record.
22088
23450
  required:
22089
23451
  - type
22090
23452
  - name
@@ -22101,20 +23463,24 @@ components:
22101
23463
  $ref: '#/components/schemas/type_domains:DomainId'
22102
23464
  status:
22103
23465
  $ref: '#/components/schemas/type_domains:VerificationStatus'
23466
+ description: The verification status of the domain.
22104
23467
  feedback_enabled:
22105
23468
  $ref: '#/components/schemas/type_domains:FeedbackEnabled'
22106
23469
  records:
22107
23470
  type: array
22108
23471
  items:
22109
23472
  $ref: '#/components/schemas/type_domains:VerificationRecord'
23473
+ description: A list of DNS records required to verify the domain.
22110
23474
  client_id:
22111
23475
  $ref: '#/components/schemas/type_domains:ClientId'
22112
23476
  updated_at:
22113
23477
  type: string
22114
23478
  format: date-time
23479
+ description: Time at which the domain was last updated.
22115
23480
  created_at:
22116
23481
  type: string
22117
23482
  format: date-time
23483
+ description: Time at which the domain was created.
22118
23484
  required:
22119
23485
  - domain_id
22120
23486
  - status