agentmail 0.1.11 → 0.1.13

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 (85) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/attachments/types/AttachmentInline.d.ts +1 -1
  3. package/dist/cjs/api/resources/domains/types/FeedbackEnabled.d.ts +1 -1
  4. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +4 -1
  5. package/dist/cjs/api/resources/inboxes/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -0
  6. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +4 -1
  7. package/dist/cjs/api/resources/inboxes/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -0
  8. package/dist/cjs/api/resources/messages/types/Message.d.ts +1 -0
  9. package/dist/cjs/api/resources/messages/types/MessageHeaders.d.ts +4 -0
  10. package/dist/cjs/api/resources/messages/types/MessageHeaders.js +3 -0
  11. package/dist/cjs/api/resources/messages/types/MessageItem.d.ts +1 -0
  12. package/dist/cjs/api/resources/messages/types/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/messages/types/index.js +1 -0
  14. package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +1 -14
  15. package/dist/cjs/api/resources/pods/resources/domains/client/requests/ListDomainsRequest.d.ts +0 -4
  16. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +1 -14
  17. package/dist/cjs/api/resources/pods/resources/inboxes/client/requests/ListInboxesRequest.d.ts +0 -4
  18. package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +4 -1
  19. package/dist/cjs/api/resources/pods/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -0
  20. package/dist/cjs/api/resources/threads/client/Client.js +4 -1
  21. package/dist/cjs/api/resources/threads/client/requests/ListThreadsRequest.d.ts +1 -0
  22. package/dist/cjs/api/resources/webhooks/types/Webhook.d.ts +1 -1
  23. package/dist/cjs/api/types/Ascending.d.ts +1 -1
  24. package/dist/cjs/api/types/IncludeSpam.d.ts +4 -0
  25. package/dist/cjs/api/types/IncludeSpam.js +3 -0
  26. package/dist/cjs/api/types/index.d.ts +1 -0
  27. package/dist/cjs/api/types/index.js +1 -0
  28. package/dist/cjs/serialization/resources/messages/types/Message.d.ts +2 -0
  29. package/dist/cjs/serialization/resources/messages/types/Message.js +2 -0
  30. package/dist/cjs/serialization/resources/messages/types/MessageHeaders.d.ts +7 -0
  31. package/dist/cjs/serialization/resources/messages/types/MessageHeaders.js +39 -0
  32. package/dist/cjs/serialization/resources/messages/types/MessageItem.d.ts +2 -0
  33. package/dist/cjs/serialization/resources/messages/types/MessageItem.js +2 -0
  34. package/dist/cjs/serialization/resources/messages/types/index.d.ts +1 -0
  35. package/dist/cjs/serialization/resources/messages/types/index.js +1 -0
  36. package/dist/cjs/serialization/types/IncludeSpam.d.ts +7 -0
  37. package/dist/cjs/serialization/types/IncludeSpam.js +39 -0
  38. package/dist/cjs/serialization/types/index.d.ts +1 -0
  39. package/dist/cjs/serialization/types/index.js +1 -0
  40. package/dist/cjs/version.d.ts +1 -1
  41. package/dist/cjs/version.js +1 -1
  42. package/dist/esm/BaseClient.mjs +2 -2
  43. package/dist/esm/api/resources/attachments/types/AttachmentInline.d.mts +1 -1
  44. package/dist/esm/api/resources/domains/types/FeedbackEnabled.d.mts +1 -1
  45. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +4 -1
  46. package/dist/esm/api/resources/inboxes/resources/messages/client/requests/ListMessagesRequest.d.mts +1 -0
  47. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +4 -1
  48. package/dist/esm/api/resources/inboxes/resources/threads/client/requests/ListThreadsRequest.d.mts +1 -0
  49. package/dist/esm/api/resources/messages/types/Message.d.mts +1 -0
  50. package/dist/esm/api/resources/messages/types/MessageHeaders.d.mts +4 -0
  51. package/dist/esm/api/resources/messages/types/MessageHeaders.mjs +2 -0
  52. package/dist/esm/api/resources/messages/types/MessageItem.d.mts +1 -0
  53. package/dist/esm/api/resources/messages/types/index.d.mts +1 -0
  54. package/dist/esm/api/resources/messages/types/index.mjs +1 -0
  55. package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +1 -14
  56. package/dist/esm/api/resources/pods/resources/domains/client/requests/ListDomainsRequest.d.mts +0 -4
  57. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +1 -14
  58. package/dist/esm/api/resources/pods/resources/inboxes/client/requests/ListInboxesRequest.d.mts +0 -4
  59. package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +4 -1
  60. package/dist/esm/api/resources/pods/resources/threads/client/requests/ListThreadsRequest.d.mts +1 -0
  61. package/dist/esm/api/resources/threads/client/Client.mjs +4 -1
  62. package/dist/esm/api/resources/threads/client/requests/ListThreadsRequest.d.mts +1 -0
  63. package/dist/esm/api/resources/webhooks/types/Webhook.d.mts +1 -1
  64. package/dist/esm/api/types/Ascending.d.mts +1 -1
  65. package/dist/esm/api/types/IncludeSpam.d.mts +4 -0
  66. package/dist/esm/api/types/IncludeSpam.mjs +2 -0
  67. package/dist/esm/api/types/index.d.mts +1 -0
  68. package/dist/esm/api/types/index.mjs +1 -0
  69. package/dist/esm/serialization/resources/messages/types/Message.d.mts +2 -0
  70. package/dist/esm/serialization/resources/messages/types/Message.mjs +2 -0
  71. package/dist/esm/serialization/resources/messages/types/MessageHeaders.d.mts +7 -0
  72. package/dist/esm/serialization/resources/messages/types/MessageHeaders.mjs +3 -0
  73. package/dist/esm/serialization/resources/messages/types/MessageItem.d.mts +2 -0
  74. package/dist/esm/serialization/resources/messages/types/MessageItem.mjs +2 -0
  75. package/dist/esm/serialization/resources/messages/types/index.d.mts +1 -0
  76. package/dist/esm/serialization/resources/messages/types/index.mjs +1 -0
  77. package/dist/esm/serialization/types/IncludeSpam.d.mts +7 -0
  78. package/dist/esm/serialization/types/IncludeSpam.mjs +3 -0
  79. package/dist/esm/serialization/types/index.d.mts +1 -0
  80. package/dist/esm/serialization/types/index.mjs +1 -0
  81. package/dist/esm/version.d.mts +1 -1
  82. package/dist/esm/version.mjs +1 -1
  83. package/dist/llms-full.txt +845 -52
  84. package/dist/llms.txt +3 -1
  85. package/package.json +1 -1
@@ -5,7 +5,7 @@
5
5
  <Tip title="Welcome to AgentMail!" icon="fa-solid fa-star" />
6
6
 
7
7
  <Frame caption="We're excited to have you onboard!">
8
- <img src="file:1a083c39-ceed-4591-acaf-4220b54f7913" alt="We're excited to have you onboard!" />
8
+ <img src="file:310e2395-5411-4afa-b39b-892397ecb1ca" alt="We're excited to have you onboard!" />
9
9
  </Frame>
10
10
 
11
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.
@@ -171,7 +171,7 @@ This guide will walk you through installing the AgentMail SDK, authenticating wi
171
171
  <Step title="Create an API Key">
172
172
  Now that you're in the console, you'll need to create an API key to
173
173
  authenticate your requests. Navigate to the API Keys section in your console
174
- dashboard. ![API Key Creation Screenshot](file:20e7f82e-4a12-4165-ba99-4b5cff0ac0f5) Click
174
+ dashboard. ![API Key Creation Screenshot](file:96bda405-2981-443a-a64d-e1a2835c9fb0) Click
175
175
  "Create New API Key" and give it a descriptive name. Once created, copy the
176
176
  API key and store it securely. Create a `.env` file in your project's root
177
177
  directory and add your key to it. We recommend using environment variables to
@@ -322,7 +322,7 @@ Unlike traditional email providers that are designed for human scale, AgentMail
322
322
 
323
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.
324
324
 
325
- <img src="file:17d978ed-f12c-4634-8560-1fe14dfd09a0" alt="AgentMail Organizational Hierarchy" />
325
+ <img src="file:b0c8b4e6-563d-4ff5-b08c-d9dde55452da" alt="AgentMail Organizational Hierarchy" />
326
326
 
327
327
  <Steps>
328
328
  <Step title="Organization">
@@ -742,7 +742,7 @@ Here is an example of a well-structured and styled HTML header:
742
742
  </CodeBlocks>
743
743
 
744
744
  <Frame caption="Look how pretty this message looks!">
745
- <img src="file:c2086bbe-a796-4972-be4d-5e4534c24ca8" alt="rendered css" />
745
+ <img src="file:1e8d927e-c68d-49f1-8278-166497a45a69" alt="rendered css" />
746
746
  </Frame>
747
747
 
748
748
  ## Receiving `Messages`
@@ -1981,7 +1981,7 @@ Configuring your domain is a three-step process: add the domain via API, copy th
1981
1981
  After creating your domain in the AgentMail Console, click the "Download BIND Zone File" button to get the complete zone file.
1982
1982
 
1983
1983
  <Frame caption="Downloading BIND zone file from AgentMail Console">
1984
- <img src="file:984a2b44-d86f-47bc-ace2-143e0daf1757" alt="Download BIND Zone File from Console" />
1984
+ <img src="file:d9e83f6a-1341-4b14-b758-7e3508a231d4" alt="Download BIND Zone File from Console" />
1985
1985
  </Frame>
1986
1986
 
1987
1987
  <Tabs>
@@ -1992,13 +1992,13 @@ Configuring your domain is a three-step process: add the domain via API, copy th
1992
1992
  2. Click **"Import zone file"** in the top right corner
1993
1993
 
1994
1994
  <Frame caption="Importing BIND zone file in AWS Route 53">
1995
- <img src="file:9647ee70-c593-4daa-a8bf-3079e41ff670" alt="AWS Route 53 BIND Import" />
1995
+ <img src="file:328d8c68-88cf-42ea-bce3-5630206b406d" alt="AWS Route 53 BIND Import" />
1996
1996
  </Frame>
1997
1997
 
1998
1998
  3. Paste the CONTENTS of downloaded BIND zone file
1999
1999
 
2000
2000
  <Frame caption="Open the file with text editor and paste the contents. It should look similar to what we have in this image.">
2001
- <img src="file:8e5863f4-bee3-42c8-a6fe-60fc89f9b534" alt="AWS Route 53 BIND Import" />
2001
+ <img src="file:35f3a2a1-77a9-4a1f-932d-1e580a86eae2" alt="AWS Route 53 BIND Import" />
2002
2002
  </Frame>
2003
2003
 
2004
2004
  4. Review the records and click **"Import"**
@@ -2011,13 +2011,13 @@ Configuring your domain is a three-step process: add the domain via API, copy th
2011
2011
  2. Navigate to **DNS > Records**
2012
2012
 
2013
2013
  <Frame caption="This is what the page looks like">
2014
- <img src="file:88185597-fdb9-45aa-a132-7b7284bde354" alt="Cloudflare BIND Import" />
2014
+ <img src="file:0caf7073-c006-46c3-aa5b-67ea84d2cf76" alt="Cloudflare BIND Import" />
2015
2015
  </Frame>
2016
2016
 
2017
2017
  3. Click **"Import and Export"**
2018
2018
 
2019
2019
  <Frame caption="You should be able to just drop the file in">
2020
- <img src="file:7fdc901a-28f8-436a-ad49-d2595e448503" alt="Cloudflare BIND Import" />
2020
+ <img src="file:6ed60e97-c0e8-448d-a7e7-220170cdda24" alt="Cloudflare BIND Import" />
2021
2021
  </Frame>
2022
2022
 
2023
2023
  4. Upload the downloaded BIND zone file as is
@@ -2030,13 +2030,13 @@ Configuring your domain is a three-step process: add the domain via API, copy th
2030
2030
  2. Navigate to the **DNS** subtab of the domain you want to send from
2031
2031
 
2032
2032
  <Frame caption="Click on this button!">
2033
- <img src="file:ad432f5f-3bdd-4e60-ad17-c9129578a975" alt="Porkbun DNS Management" />
2033
+ <img src="file:9fe338be-7731-4fb0-b136-c2b6fa86a7de" alt="Porkbun DNS Management" />
2034
2034
  </Frame>
2035
2035
 
2036
2036
  3. Scroll down to the quick upload section
2037
2037
 
2038
2038
  <Frame caption="Upload your BIND zone file here">
2039
- <img src="file:9a206318-f766-4423-b0aa-3c6f637edb2a" alt="Porkbun Zone File Import" />
2039
+ <img src="file:db814e7e-4737-488a-bccc-2d581772369b" alt="Porkbun Zone File Import" />
2040
2040
  </Frame>
2041
2041
 
2042
2042
  4. Upload the downloaded BIND zone file as is
@@ -2120,7 +2120,7 @@ Configuring your domain is a three-step process: add the domain via API, copy th
2120
2120
  * **Value:** Can directly copy paste the `value` from the API response (e.g., `{random_letters_numbers}.dkim.amazonses.com`).
2121
2121
 
2122
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!">
2123
- <img src="file:1913b0a8-b4bb-4368-b90d-4989059e598a" alt="AWS Route 53 Record Configuration" />
2123
+ <img src="file:97040bb3-e526-420e-b804-9043ccec9a68" alt="AWS Route 53 Record Configuration" />
2124
2124
  </Frame>
2125
2125
 
2126
2126
  * **TXT (DMARC/SPF):**
@@ -2842,13 +2842,13 @@ Ngrok creates a secure tunnel from a public URL to your local development server
2842
2842
 
2843
2843
  Visit [ngrok.com](https://ngrok.com/) and click "Sign up" to create a free account.
2844
2844
 
2845
- <img src="file:c15f82e4-27f6-4a70-ac26-add0b5b12db0" alt="Ngrok homepage" />
2845
+ <img src="file:cacdfa4e-696b-4485-8833-67280879d17d" alt="Ngrok homepage" />
2846
2846
 
2847
2847
  ### 1.2 Choose your platform and install
2848
2848
 
2849
2849
  After logging in, ngrok will guide you through the setup process. Select your operating system and follow the installation instructions.
2850
2850
 
2851
- <img src="file:4a0b3ee3-7848-45d2-be50-2b5ff7c85295" alt="Ngrok setup instructions" />
2851
+ <img src="file:def52365-4003-4d3f-9b50-b9abb02ecd4b" alt="Ngrok setup instructions" />
2852
2852
 
2853
2853
  For macOS, you can install ngrok via Homebrew:
2854
2854
 
@@ -2894,7 +2894,7 @@ ngrok http 3000
2894
2894
 
2895
2895
  You should see output similar to this:
2896
2896
 
2897
- <img src="file:8bcb8b41-cb1c-462c-8fe4-e9e6a1184d0b" alt="Ngrok terminal output" />
2897
+ <img src="file:2894d030-381a-4542-96a8-38db296ce8d5" alt="Ngrok terminal output" />
2898
2898
 
2899
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.
2900
2900
 
@@ -2991,7 +2991,7 @@ python webhook_receiver.py
2991
2991
 
2992
2992
  Open your browser and visit `http://127.0.0.1:3000` to see the status page confirming your webhook receiver is running:
2993
2993
 
2994
- <img src="file:ca0e6f7a-9ed4-4689-9508-7a56cef9eaf5" alt="Webhook receiver status page" />
2994
+ <img src="file:3615403f-ba34-4b46-8b25-c654950bca80" alt="Webhook receiver status page" />
2995
2995
 
2996
2996
  ## Testing Your Setup
2997
2997
 
@@ -3059,6 +3059,381 @@ For production deployments:
3059
3059
  </CardGroup>
3060
3060
 
3061
3061
 
3062
+ # WebSockets
3063
+
3064
+ > Learn how to use WebSockets for instant email notifications without webhooks or polling.
3065
+
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.
3067
+
3068
+ ## Why Use WebSockets?
3069
+
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 |
3077
+
3078
+ ***
3079
+
3080
+ ## Python SDK
3081
+
3082
+ The Python SDK provides both synchronous and asynchronous WebSocket clients.
3083
+
3084
+ ### Async Usage
3085
+
3086
+ ```python
3087
+ import asyncio
3088
+ from agentmail import AsyncAgentMail, Subscribe, Subscribed, MessageReceivedEvent
3089
+
3090
+ client = AsyncAgentMail(api_key="YOUR_API_KEY")
3091
+
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"]))
3096
+
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}")
3104
+
3105
+ asyncio.run(main())
3106
+ ```
3107
+
3108
+ ### Sync Usage
3109
+
3110
+ ```python
3111
+ from agentmail import AgentMail, Subscribe, Subscribed, MessageReceivedEvent
3112
+
3113
+ client = AgentMail(api_key="YOUR_API_KEY")
3114
+
3115
+ with client.websockets.connect() as socket:
3116
+ # Subscribe to inboxes
3117
+ socket.send_subscribe(Subscribe(inbox_ids=["agent@agentmail.to"]))
3118
+
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
+ ```
3127
+
3128
+ ### Event Handler Pattern
3129
+
3130
+ You can also use event handlers instead of iterating:
3131
+
3132
+ ```python
3133
+ import asyncio
3134
+ from agentmail import AsyncAgentMail, Subscribe, EventType
3135
+
3136
+ client = AsyncAgentMail(api_key="YOUR_API_KEY")
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))
3145
+
3146
+ # Subscribe and start listening
3147
+ await socket.send_subscribe(Subscribe(inbox_ids=["agent@agentmail.to"]))
3148
+ await socket.start_listening()
3149
+
3150
+ asyncio.run(main())
3151
+ ```
3152
+
3153
+ For sync usage with event handlers, run the listener in a background thread:
3154
+
3155
+ ```python
3156
+ import threading
3157
+ from agentmail import AgentMail, Subscribe, EventType
3158
+
3159
+ client = AgentMail(api_key="YOUR_API_KEY")
3160
+
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))
3166
+
3167
+ socket.send_subscribe(Subscribe(inbox_ids=["agent@agentmail.to"]))
3168
+
3169
+ # Start listening in background thread
3170
+ listener = threading.Thread(target=socket.start_listening, daemon=True)
3171
+ listener.start()
3172
+ listener.join()
3173
+ ```
3174
+
3175
+ ***
3176
+
3177
+ ## TypeScript SDK
3178
+
3179
+ The TypeScript SDK provides a WebSocket client with automatic reconnection.
3180
+
3181
+ ### Basic Usage
3182
+
3183
+ ```typescript
3184
+ import { AgentMailClient, AgentMail } from "agentmail";
3185
+
3186
+ const client = new AgentMailClient({
3187
+ apiKey: process.env.AGENTMAIL_API_KEY,
3188
+ });
3189
+
3190
+ async function main() {
3191
+ const socket = await client.websockets.connect();
3192
+
3193
+ // Handle events
3194
+ socket.on("open", () => {
3195
+ console.log("Connected");
3196
+
3197
+ // Subscribe to inboxes after connection is open
3198
+ socket.sendSubscribe({
3199
+ type: "subscribe",
3200
+ inboxIds: ["agent@agentmail.to"],
3201
+ });
3202
+ });
3203
+
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
+ });
3212
+
3213
+ socket.on("close", (event) => {
3214
+ console.log("Disconnected:", event.code, event.reason);
3215
+ });
3216
+
3217
+ socket.on("error", (error) => {
3218
+ console.error("Error:", error);
3219
+ });
3220
+ }
3221
+
3222
+ main();
3223
+ ```
3224
+
3225
+ ### React/Next.js Usage
3226
+
3227
+ Using the SDK with React:
3228
+
3229
+ ```typescript
3230
+ import { useEffect, useState } from "react";
3231
+ import { AgentMailClient, AgentMail } from "agentmail";
3232
+
3233
+ function useAgentMailWebSocket(apiKey: string, inboxIds: string[]) {
3234
+ const [lastMessage, setLastMessage] = useState<AgentMail.MessageReceivedEvent | null>(null);
3235
+ const [isConnected, setIsConnected] = useState(false);
3236
+
3237
+ useEffect(() => {
3238
+ const client = new AgentMailClient({ apiKey });
3239
+
3240
+ let socket: Awaited<ReturnType<typeof client.websockets.connect>>;
3241
+
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
+
3062
3437
  # Email Deliverability
3063
3438
 
3064
3439
  > Learn the strategies and best practices for maximizing your email deliverability with AgentMail.
@@ -3113,7 +3488,7 @@ How you send your emails is just as important as what you send. If you're sendin
3113
3488
  more natural to email providers. AgentMail's ability to create inboxes at
3114
3489
  scale makes this strategy easy to implement.
3115
3490
 
3116
- <img src="file:a620b6d7-d2f7-4925-94ce-afcd6fb2ff4c" alt="Diagram comparing one inbox sending 1000 emails vs. five inboxes sending 200 each." />
3491
+ <img src="file:3af96ac6-1192-4d7c-9c5c-faefe4c6dc84" alt="Diagram comparing one inbox sending 1000 emails vs. five inboxes sending 200 each." />
3117
3492
  </Step>
3118
3493
 
3119
3494
  <Step title="Protect Your Reputation with Multiple Domains">
@@ -5132,7 +5507,7 @@ Done
5132
5507
 
5133
5508
  Go to your AgentMail inbox and filter by labels to organize your emails:
5134
5509
 
5135
- <img src="file:2d19dca9-3d2a-43a1-a741-27bc0b88bc19" alt="Test image" />
5510
+ <img src="file:d68eacab-1cee-4bd4-96b5-0e2a1aed4774" alt="Test image" />
5136
5511
 
5137
5512
  **Filter by sentiment:**
5138
5513
 
@@ -5954,55 +6329,137 @@ We hope this provides a clear and transparent look into why these DNS records ar
5954
6329
 
5955
6330
  # SOC 2 Compliance
5956
6331
 
5957
- > AgentMail's SOC 2 Type II certification and what it means for your data security
6332
+ > AgentMail's SOC 2 Type I achievement and Type II certification progress.
5958
6333
 
5959
- AgentMail is **SOC 2 Type II certified**, demonstrating our commitment to maintaining the highest standards of security, availability, and confidentiality for your data.
6334
+ > AgentMail has **achieved SOC 2 Type I compliance** (July 2025) and is currently working toward **Type II certification** (target: Q1 2026).
6335
+
6336
+ ***
5960
6337
 
5961
- <img src="file:7e299fb7-9841-4f90-a033-b5e4878067b1" alt="SOC 2 Type II Certified" />
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
+ ***
5962
6360
 
5963
6361
  ## What is SOC 2?
5964
6362
 
5965
- SOC 2 is a rigorous auditing standard developed by the American Institute of Certified Public Accountants (AICPA). It evaluates how organizations manage customer data based on five principles:
6363
+ **SOC 2** is an attestation standard by **AICPA** (The American Institute of Certified Public Accountants) evaluating controls over:
5966
6364
 
5967
- * **Security**: Protection against unauthorized access
5968
- * **Availability**: Systems are operational and accessible as committed
5969
- * **Processing Integrity**: Data processing is complete, accurate, and authorized
5970
- * **Confidentiality**: Information designated as confidential is protected
5971
- * **Privacy**: Personal information is collected, used, and retained appropriately
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
5972
6370
 
5973
- ## What does this mean for you?
6371
+ ### Report Types
5974
6372
 
5975
- When you use AgentMail, you can trust that:
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).
5976
6375
 
5977
- <AccordionGroup>
5978
- <Accordion title="Your data is protected by enterprise-grade security">
5979
- We've implemented comprehensive security controls that have been
5980
- independently verified by third-party auditors. This includes access
5981
- controls, encryption, and continuous monitoring.
5982
- </Accordion>
6376
+ <Callout intent="success">
6377
+ AgentMail's SOC 2 Type I report confirms that our security infrastructure is properly designed and implemented.
6378
+ </Callout>
5983
6379
 
5984
- <Accordion title="We follow industry best practices">
5985
- Our policies and procedures align with established security frameworks. We
5986
- don't just claim to be secure—we prove it through regular audits.
5987
- </Accordion>
6380
+ ***
5988
6381
 
5989
- <Accordion title="Our controls are continuously monitored">
5990
- SOC 2 Type II certification means our controls were tested over an
5991
- observation period, not just at a single point in time. This demonstrates
5992
- consistent, ongoing compliance.
5993
- </Accordion>
5994
- </AccordionGroup>
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
5995
6420
 
5996
- ## Our Certifications
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.
5997
6442
 
5998
- | Certification | Status | Last Audit |
5999
- | ------------- | ----------- | ------------- |
6000
- | SOC 2 Type I | ✅ Compliant | — |
6001
- | SOC 2 Type II | ✅ Compliant | November 2025 |
6443
+ ### What's Being Tested
6002
6444
 
6003
- ## Request Compliance Documentation
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)
6004
6449
 
6005
- Need our SOC 2 report for your vendor assessment? Contact our team at [founders@agentmail.cc](mailto:founders@agentmail.cc) to request access to our compliance documentation.
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
+ ***
6006
6463
 
6007
6464
 
6008
6465
  # API Welcome
@@ -7642,6 +8099,10 @@ components:
7642
8099
  type: array
7643
8100
  items:
7644
8101
  type: string
8102
+ type_messages:MessageHeaders:
8103
+ type: object
8104
+ additionalProperties:
8105
+ type: string
7645
8106
  type_messages:MessageSize:
7646
8107
  type: integer
7647
8108
  type_messages:MessageUpdatedAt:
@@ -7698,6 +8159,8 @@ components:
7698
8159
  $ref: '#/components/schemas/type_messages:MessageInReplyTo'
7699
8160
  references:
7700
8161
  $ref: '#/components/schemas/type_messages:MessageReferences'
8162
+ headers:
8163
+ $ref: '#/components/schemas/type_messages:MessageHeaders'
7701
8164
  size:
7702
8165
  $ref: '#/components/schemas/type_messages:MessageSize'
7703
8166
  updated_at:
@@ -8437,6 +8900,10 @@ components:
8437
8900
  type: array
8438
8901
  items:
8439
8902
  type: string
8903
+ type_messages:MessageHeaders:
8904
+ type: object
8905
+ additionalProperties:
8906
+ type: string
8440
8907
  type_messages:MessageSize:
8441
8908
  type: integer
8442
8909
  type_messages:MessageUpdatedAt:
@@ -8476,6 +8943,8 @@ components:
8476
8943
  $ref: '#/components/schemas/type_messages:MessageInReplyTo'
8477
8944
  references:
8478
8945
  $ref: '#/components/schemas/type_messages:MessageReferences'
8946
+ headers:
8947
+ $ref: '#/components/schemas/type_messages:MessageHeaders'
8479
8948
  size:
8480
8949
  $ref: '#/components/schemas/type_messages:MessageSize'
8481
8950
  updated_at:
@@ -8762,6 +9231,10 @@ components:
8762
9231
  type: array
8763
9232
  items:
8764
9233
  type: string
9234
+ type_messages:MessageHeaders:
9235
+ type: object
9236
+ additionalProperties:
9237
+ type: string
8765
9238
  type_messages:MessageSize:
8766
9239
  type: integer
8767
9240
  type_messages:MessageUpdatedAt:
@@ -8818,6 +9291,8 @@ components:
8818
9291
  $ref: '#/components/schemas/type_messages:MessageInReplyTo'
8819
9292
  references:
8820
9293
  $ref: '#/components/schemas/type_messages:MessageReferences'
9294
+ headers:
9295
+ $ref: '#/components/schemas/type_messages:MessageHeaders'
8821
9296
  size:
8822
9297
  $ref: '#/components/schemas/type_messages:MessageSize'
8823
9298
  updated_at:
@@ -9724,6 +10199,8 @@ components:
9724
10199
  $ref: '#/components/schemas/type_messages:Addresses'
9725
10200
  type_messages:SendMessageBcc:
9726
10201
  $ref: '#/components/schemas/type_messages:Addresses'
10202
+ type_messages:ReplyAll:
10203
+ type: boolean
9727
10204
  type_messages:MessageText:
9728
10205
  type: string
9729
10206
  type_messages:MessageHtml:
@@ -9766,6 +10243,8 @@ components:
9766
10243
  $ref: '#/components/schemas/type_messages:SendMessageCc'
9767
10244
  bcc:
9768
10245
  $ref: '#/components/schemas/type_messages:SendMessageBcc'
10246
+ reply_all:
10247
+ $ref: '#/components/schemas/type_messages:ReplyAll'
9769
10248
  text:
9770
10249
  $ref: '#/components/schemas/type_messages:MessageText'
9771
10250
  html:
@@ -9934,6 +10413,290 @@ let dataTask = session.dataTask(with: request as URLRequest, completionHandler:
9934
10413
  dataTask.resume()
9935
10414
  ```
9936
10415
 
10416
+ # Reply All Message
10417
+
10418
+ POST https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/{message_id}/reply-all
10419
+ Content-Type: application/json
10420
+
10421
+ Reference: https://docs.agentmail.to/api-reference/inboxes/messages/reply-all
10422
+
10423
+ ## OpenAPI Specification
10424
+
10425
+ ```yaml
10426
+ openapi: 3.1.1
10427
+ info:
10428
+ title: Reply All Message
10429
+ version: endpoint_inboxes/messages.reply-all
10430
+ paths:
10431
+ /v0/inboxes/{inbox_id}/messages/{message_id}/reply-all:
10432
+ post:
10433
+ operationId: reply-all
10434
+ summary: Reply All Message
10435
+ tags:
10436
+ - - subpackage_inboxes
10437
+ - subpackage_inboxes/messages
10438
+ parameters:
10439
+ - name: inbox_id
10440
+ in: path
10441
+ required: true
10442
+ schema:
10443
+ $ref: '#/components/schemas/type_inboxes:InboxId'
10444
+ - name: message_id
10445
+ in: path
10446
+ required: true
10447
+ schema:
10448
+ $ref: '#/components/schemas/type_messages:MessageId'
10449
+ - name: Authorization
10450
+ in: header
10451
+ description: >-
10452
+ Bearer authentication of the form `Bearer <token>`, where token is
10453
+ your auth token.
10454
+ required: true
10455
+ schema:
10456
+ type: string
10457
+ responses:
10458
+ '200':
10459
+ description: Response with status 200
10460
+ content:
10461
+ application/json:
10462
+ schema:
10463
+ $ref: '#/components/schemas/type_messages:SendMessageResponse'
10464
+ '400':
10465
+ description: Error response with status 400
10466
+ content: {}
10467
+ '403':
10468
+ description: Error response with status 403
10469
+ content: {}
10470
+ '404':
10471
+ description: Error response with status 404
10472
+ content: {}
10473
+ requestBody:
10474
+ content:
10475
+ application/json:
10476
+ schema:
10477
+ $ref: '#/components/schemas/type_messages:ReplyAllMessageRequest'
10478
+ components:
10479
+ schemas:
10480
+ type_inboxes:InboxId:
10481
+ type: string
10482
+ type_messages:MessageId:
10483
+ type: string
10484
+ type_messages:MessageLabels:
10485
+ type: array
10486
+ items:
10487
+ type: string
10488
+ type_messages:Addresses:
10489
+ oneOf:
10490
+ - type: string
10491
+ - type: array
10492
+ items:
10493
+ type: string
10494
+ type_messages:SendMessageReplyTo:
10495
+ $ref: '#/components/schemas/type_messages:Addresses'
10496
+ type_messages:MessageText:
10497
+ type: string
10498
+ type_messages:MessageHtml:
10499
+ type: string
10500
+ type_attachments:AttachmentFilename:
10501
+ type: string
10502
+ type_attachments:AttachmentContentType:
10503
+ type: string
10504
+ type_attachments:AttachmentContent:
10505
+ type: string
10506
+ type_attachments:SendAttachment:
10507
+ type: object
10508
+ properties:
10509
+ filename:
10510
+ $ref: '#/components/schemas/type_attachments:AttachmentFilename'
10511
+ content_type:
10512
+ $ref: '#/components/schemas/type_attachments:AttachmentContentType'
10513
+ content:
10514
+ $ref: '#/components/schemas/type_attachments:AttachmentContent'
10515
+ required:
10516
+ - content
10517
+ type_messages:SendMessageAttachments:
10518
+ type: array
10519
+ items:
10520
+ $ref: '#/components/schemas/type_attachments:SendAttachment'
10521
+ type_messages:SendMessageHeaders:
10522
+ type: object
10523
+ additionalProperties:
10524
+ type: string
10525
+ type_messages:ReplyAllMessageRequest:
10526
+ type: object
10527
+ properties:
10528
+ labels:
10529
+ $ref: '#/components/schemas/type_messages:MessageLabels'
10530
+ reply_to:
10531
+ $ref: '#/components/schemas/type_messages:SendMessageReplyTo'
10532
+ text:
10533
+ $ref: '#/components/schemas/type_messages:MessageText'
10534
+ html:
10535
+ $ref: '#/components/schemas/type_messages:MessageHtml'
10536
+ attachments:
10537
+ $ref: '#/components/schemas/type_messages:SendMessageAttachments'
10538
+ headers:
10539
+ $ref: '#/components/schemas/type_messages:SendMessageHeaders'
10540
+ type_threads:ThreadId:
10541
+ type: string
10542
+ type_messages:SendMessageResponse:
10543
+ type: object
10544
+ properties:
10545
+ message_id:
10546
+ $ref: '#/components/schemas/type_messages:MessageId'
10547
+ thread_id:
10548
+ $ref: '#/components/schemas/type_threads:ThreadId'
10549
+ required:
10550
+ - message_id
10551
+ - thread_id
10552
+
10553
+ ```
10554
+
10555
+ ## SDK Code Examples
10556
+
10557
+ ```typescript
10558
+ import { AgentMailClient } from "agentmail";
10559
+
10560
+ async function main() {
10561
+ const client = new AgentMailClient({
10562
+ environment: "https://api.agentmail.to",
10563
+ apiKey: "YOUR_TOKEN_HERE",
10564
+ });
10565
+ await client.inboxes.messages.replyAll("inbox_id", "message_id", {});
10566
+ }
10567
+ main();
10568
+
10569
+ ```
10570
+
10571
+ ```python
10572
+ from agentmail import AgentMail
10573
+
10574
+ client = AgentMail(
10575
+ base_url="https://api.agentmail.to",
10576
+ api_key="YOUR_TOKEN_HERE"
10577
+ )
10578
+
10579
+ client.inboxes.messages.reply_all(
10580
+ inbox_id="inbox_id",
10581
+ message_id="message_id"
10582
+ )
10583
+
10584
+ ```
10585
+
10586
+ ```go
10587
+ package main
10588
+
10589
+ import (
10590
+ "fmt"
10591
+ "strings"
10592
+ "net/http"
10593
+ "io"
10594
+ )
10595
+
10596
+ func main() {
10597
+
10598
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply-all"
10599
+
10600
+ payload := strings.NewReader("{}")
10601
+
10602
+ req, _ := http.NewRequest("POST", url, payload)
10603
+
10604
+ req.Header.Add("Authorization", "Bearer <api_key>")
10605
+ req.Header.Add("Content-Type", "application/json")
10606
+
10607
+ res, _ := http.DefaultClient.Do(req)
10608
+
10609
+ defer res.Body.Close()
10610
+ body, _ := io.ReadAll(res.Body)
10611
+
10612
+ fmt.Println(res)
10613
+ fmt.Println(string(body))
10614
+
10615
+ }
10616
+ ```
10617
+
10618
+ ```ruby
10619
+ require 'uri'
10620
+ require 'net/http'
10621
+
10622
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply-all")
10623
+
10624
+ http = Net::HTTP.new(url.host, url.port)
10625
+ http.use_ssl = true
10626
+
10627
+ request = Net::HTTP::Post.new(url)
10628
+ request["Authorization"] = 'Bearer <api_key>'
10629
+ request["Content-Type"] = 'application/json'
10630
+ request.body = "{}"
10631
+
10632
+ response = http.request(request)
10633
+ puts response.read_body
10634
+ ```
10635
+
10636
+ ```java
10637
+ HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply-all")
10638
+ .header("Authorization", "Bearer <api_key>")
10639
+ .header("Content-Type", "application/json")
10640
+ .body("{}")
10641
+ .asString();
10642
+ ```
10643
+
10644
+ ```php
10645
+ <?php
10646
+
10647
+ $client = new \GuzzleHttp\Client();
10648
+
10649
+ $response = $client->request('POST', 'https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply-all', [
10650
+ 'body' => '{}',
10651
+ 'headers' => [
10652
+ 'Authorization' => 'Bearer <api_key>',
10653
+ 'Content-Type' => 'application/json',
10654
+ ],
10655
+ ]);
10656
+
10657
+ echo $response->getBody();
10658
+ ```
10659
+
10660
+ ```csharp
10661
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply-all");
10662
+ var request = new RestRequest(Method.POST);
10663
+ request.AddHeader("Authorization", "Bearer <api_key>");
10664
+ request.AddHeader("Content-Type", "application/json");
10665
+ request.AddParameter("application/json", "{}", ParameterType.RequestBody);
10666
+ IRestResponse response = client.Execute(request);
10667
+ ```
10668
+
10669
+ ```swift
10670
+ import Foundation
10671
+
10672
+ let headers = [
10673
+ "Authorization": "Bearer <api_key>",
10674
+ "Content-Type": "application/json"
10675
+ ]
10676
+ let parameters = [] as [String : Any]
10677
+
10678
+ let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
10679
+
10680
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id/reply-all")! as URL,
10681
+ cachePolicy: .useProtocolCachePolicy,
10682
+ timeoutInterval: 10.0)
10683
+ request.httpMethod = "POST"
10684
+ request.allHTTPHeaderFields = headers
10685
+ request.httpBody = postData as Data
10686
+
10687
+ let session = URLSession.shared
10688
+ let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
10689
+ if (error != nil) {
10690
+ print(error as Any)
10691
+ } else {
10692
+ let httpResponse = response as? HTTPURLResponse
10693
+ print(httpResponse)
10694
+ }
10695
+ })
10696
+
10697
+ dataTask.resume()
10698
+ ```
10699
+
9937
10700
  # Update Message
9938
10701
 
9939
10702
  PATCH https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/{message_id}
@@ -10080,6 +10843,10 @@ components:
10080
10843
  type: array
10081
10844
  items:
10082
10845
  type: string
10846
+ type_messages:MessageHeaders:
10847
+ type: object
10848
+ additionalProperties:
10849
+ type: string
10083
10850
  type_messages:MessageSize:
10084
10851
  type: integer
10085
10852
  type_messages:MessageUpdatedAt:
@@ -10136,6 +10903,8 @@ components:
10136
10903
  $ref: '#/components/schemas/type_messages:MessageInReplyTo'
10137
10904
  references:
10138
10905
  $ref: '#/components/schemas/type_messages:MessageReferences'
10906
+ headers:
10907
+ $ref: '#/components/schemas/type_messages:MessageHeaders'
10139
10908
  size:
10140
10909
  $ref: '#/components/schemas/type_messages:MessageSize'
10141
10910
  updated_at:
@@ -12888,6 +13657,10 @@ components:
12888
13657
  type: array
12889
13658
  items:
12890
13659
  type: string
13660
+ type_messages:MessageHeaders:
13661
+ type: object
13662
+ additionalProperties:
13663
+ type: string
12891
13664
  type_messages:MessageSize:
12892
13665
  type: integer
12893
13666
  type_messages:MessageUpdatedAt:
@@ -12944,6 +13717,8 @@ components:
12944
13717
  $ref: '#/components/schemas/type_messages:MessageInReplyTo'
12945
13718
  references:
12946
13719
  $ref: '#/components/schemas/type_messages:MessageReferences'
13720
+ headers:
13721
+ $ref: '#/components/schemas/type_messages:MessageHeaders'
12947
13722
  size:
12948
13723
  $ref: '#/components/schemas/type_messages:MessageSize'
12949
13724
  updated_at:
@@ -16350,6 +17125,10 @@ components:
16350
17125
  type: array
16351
17126
  items:
16352
17127
  type: string
17128
+ type_messages:MessageHeaders:
17129
+ type: object
17130
+ additionalProperties:
17131
+ type: string
16353
17132
  type_messages:MessageSize:
16354
17133
  type: integer
16355
17134
  type_messages:MessageUpdatedAt:
@@ -16406,6 +17185,8 @@ components:
16406
17185
  $ref: '#/components/schemas/type_messages:MessageInReplyTo'
16407
17186
  references:
16408
17187
  $ref: '#/components/schemas/type_messages:MessageReferences'
17188
+ headers:
17189
+ $ref: '#/components/schemas/type_messages:MessageHeaders'
16409
17190
  size:
16410
17191
  $ref: '#/components/schemas/type_messages:MessageSize'
16411
17192
  updated_at:
@@ -17487,6 +18268,10 @@ components:
17487
18268
  type: array
17488
18269
  items:
17489
18270
  type: string
18271
+ type_messages:MessageHeaders:
18272
+ type: object
18273
+ additionalProperties:
18274
+ type: string
17490
18275
  type_messages:MessageSize:
17491
18276
  type: integer
17492
18277
  type_messages:MessageUpdatedAt:
@@ -17543,6 +18328,8 @@ components:
17543
18328
  $ref: '#/components/schemas/type_messages:MessageInReplyTo'
17544
18329
  references:
17545
18330
  $ref: '#/components/schemas/type_messages:MessageReferences'
18331
+ headers:
18332
+ $ref: '#/components/schemas/type_messages:MessageHeaders'
17546
18333
  size:
17547
18334
  $ref: '#/components/schemas/type_messages:MessageSize'
17548
18335
  updated_at:
@@ -21208,6 +21995,10 @@ components:
21208
21995
  type: array
21209
21996
  items:
21210
21997
  type: string
21998
+ type_messages:MessageHeaders:
21999
+ type: object
22000
+ additionalProperties:
22001
+ type: string
21211
22002
  type_messages:MessageSize:
21212
22003
  type: integer
21213
22004
  type_messages:MessageUpdatedAt:
@@ -21264,6 +22055,8 @@ components:
21264
22055
  $ref: '#/components/schemas/type_messages:MessageInReplyTo'
21265
22056
  references:
21266
22057
  $ref: '#/components/schemas/type_messages:MessageReferences'
22058
+ headers:
22059
+ $ref: '#/components/schemas/type_messages:MessageHeaders'
21267
22060
  size:
21268
22061
  $ref: '#/components/schemas/type_messages:MessageSize'
21269
22062
  updated_at: