agentmail 0.2.11 → 0.2.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 (55) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/apiKeys/client/Client.js +6 -3
  3. package/dist/cjs/api/resources/domains/client/Client.js +12 -6
  4. package/dist/cjs/api/resources/drafts/client/Client.js +6 -3
  5. package/dist/cjs/api/resources/inboxes/client/Client.js +10 -5
  6. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +14 -7
  7. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +18 -9
  8. package/dist/cjs/api/resources/inboxes/resources/metrics/client/Client.js +2 -1
  9. package/dist/cjs/api/resources/inboxes/resources/threads/client/Client.js +8 -4
  10. package/dist/cjs/api/resources/metrics/client/Client.js +2 -1
  11. package/dist/cjs/api/resources/organizations/client/Client.js +2 -1
  12. package/dist/cjs/api/resources/organizations/types/Organization.d.ts +10 -0
  13. package/dist/cjs/api/resources/pods/client/Client.js +8 -4
  14. package/dist/cjs/api/resources/pods/resources/domains/client/Client.js +6 -3
  15. package/dist/cjs/api/resources/pods/resources/drafts/client/Client.js +6 -3
  16. package/dist/cjs/api/resources/pods/resources/inboxes/client/Client.js +8 -4
  17. package/dist/cjs/api/resources/pods/resources/threads/client/Client.js +6 -3
  18. package/dist/cjs/api/resources/threads/client/Client.js +6 -3
  19. package/dist/cjs/api/resources/webhooks/client/Client.js +10 -5
  20. package/dist/cjs/api/resources/websockets/client/Client.js +2 -1
  21. package/dist/cjs/environments.d.ts +5 -5
  22. package/dist/cjs/environments.js +4 -4
  23. package/dist/cjs/serialization/resources/organizations/types/Organization.d.ts +5 -0
  24. package/dist/cjs/serialization/resources/organizations/types/Organization.js +5 -0
  25. package/dist/cjs/version.d.ts +1 -1
  26. package/dist/cjs/version.js +1 -1
  27. package/dist/esm/BaseClient.mjs +2 -2
  28. package/dist/esm/api/resources/apiKeys/client/Client.mjs +6 -3
  29. package/dist/esm/api/resources/domains/client/Client.mjs +12 -6
  30. package/dist/esm/api/resources/drafts/client/Client.mjs +6 -3
  31. package/dist/esm/api/resources/inboxes/client/Client.mjs +10 -5
  32. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +14 -7
  33. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +18 -9
  34. package/dist/esm/api/resources/inboxes/resources/metrics/client/Client.mjs +2 -1
  35. package/dist/esm/api/resources/inboxes/resources/threads/client/Client.mjs +8 -4
  36. package/dist/esm/api/resources/metrics/client/Client.mjs +2 -1
  37. package/dist/esm/api/resources/organizations/client/Client.mjs +2 -1
  38. package/dist/esm/api/resources/organizations/types/Organization.d.mts +10 -0
  39. package/dist/esm/api/resources/pods/client/Client.mjs +8 -4
  40. package/dist/esm/api/resources/pods/resources/domains/client/Client.mjs +6 -3
  41. package/dist/esm/api/resources/pods/resources/drafts/client/Client.mjs +6 -3
  42. package/dist/esm/api/resources/pods/resources/inboxes/client/Client.mjs +8 -4
  43. package/dist/esm/api/resources/pods/resources/threads/client/Client.mjs +6 -3
  44. package/dist/esm/api/resources/threads/client/Client.mjs +6 -3
  45. package/dist/esm/api/resources/webhooks/client/Client.mjs +10 -5
  46. package/dist/esm/api/resources/websockets/client/Client.mjs +2 -1
  47. package/dist/esm/environments.d.mts +5 -5
  48. package/dist/esm/environments.mjs +4 -4
  49. package/dist/esm/serialization/resources/organizations/types/Organization.d.mts +5 -0
  50. package/dist/esm/serialization/resources/organizations/types/Organization.mjs +5 -0
  51. package/dist/esm/version.d.mts +1 -1
  52. package/dist/esm/version.mjs +1 -1
  53. package/dist/llms-full.txt +1940 -484
  54. package/dist/llms.txt +10 -0
  55. package/package.json +1 -1
@@ -1,6 +1,9 @@
1
- # Welcome
1
+ ***
2
2
 
3
- > Your starting point for building with the AgentMail API.
3
+ title: Welcome
4
+ slug: welcome
5
+ description: Your starting point for building with the AgentMail API.
6
+ ---------------------------------------------------------------------
4
7
 
5
8
  <Tip title="Welcome to AgentMail!" icon="fa-solid fa-star">
6
9
  We're thrilled to have you here! Dive in to learn how to give your AI agents their own email inboxes.
@@ -41,9 +44,12 @@ AgentMail is an API platform for giving AI agents their own inboxes to send, rec
41
44
  </CardGroup>
42
45
 
43
46
 
44
- # Introduction
47
+ ***
45
48
 
46
- > Give AI agents email inboxes
49
+ title: Introduction
50
+ subtitle: Give AI agents email inboxes
51
+ slug: introduction
52
+ ------------------
47
53
 
48
54
  ## What is AgentMail?
49
55
 
@@ -155,9 +161,15 @@ Our customers use AgentMail for agent identity, authentication, and communicatio
155
161
  </CardGroup>
156
162
 
157
163
 
158
- # Quickstart
164
+ ***
159
165
 
160
- > Follow this guide to make your first AgentMail API request and create a new email inbox.
166
+ title: Quickstart
167
+ subtitle: Create your first inbox with the AgentMail API
168
+ slug: quickstart
169
+ description: >-
170
+ Follow this guide to make your first AgentMail API request and create a new
171
+ email inbox.
172
+ ------------
161
173
 
162
174
  This guide will walk you through installing the AgentMail SDK, authenticating with your API key, and creating your first email inbox.
163
175
 
@@ -297,9 +309,15 @@ Congrats, you sent your first email via AgentMail. But this isn't our strength.
297
309
  </Note>
298
310
 
299
311
 
300
- # Inboxes
312
+ ***
301
313
 
302
- > Learn how AgentMail Inboxes act as scalable, API-first email accounts for your agents.
314
+ title: Inboxes
315
+ subtitle: The foundation of your agent's identity and communication.
316
+ slug: inboxes
317
+ description: >-
318
+ Learn how AgentMail Inboxes act as scalable, API-first email accounts for your
319
+ agents.
320
+ -------
303
321
 
304
322
  ## What is an Inbox?
305
323
 
@@ -422,9 +440,15 @@ Here at AgentMail we've now made an `Inbox` an API resource, meaning you can per
422
440
  </Tip>
423
441
 
424
442
 
425
- # Messages
443
+ ***
426
444
 
427
- > Learn how to send, receive, and manage emails as Message objects with the AgentMail API.
445
+ title: Messages
446
+ subtitle: The fundamental unit of communication for your agents.
447
+ slug: messages
448
+ description: >-
449
+ Learn how to send, receive, and manage emails as Message objects with the
450
+ AgentMail API.
451
+ --------------
428
452
 
429
453
  ## What is a Message?
430
454
 
@@ -758,9 +782,15 @@ While you can periodically list `Messages` to check for new emails, the most eff
758
782
  ```
759
783
 
760
784
 
761
- # Threads
785
+ ***
762
786
 
763
- > Learn how AgentMail Threads group messages into conversations and how to query them across your entire organization.
787
+ title: Threads
788
+ subtitle: Organizing conversations across your Inboxes.
789
+ slug: threads
790
+ description: >-
791
+ Learn how AgentMail Threads group messages into conversations and how to query
792
+ them across your entire organization.
793
+ -------------------------------------
764
794
 
765
795
  ## What is a Thread?
766
796
 
@@ -860,9 +890,15 @@ You can also retrieve a single `Thread` by its ID. This will return the `Thread`
860
890
  </CodeBlocks>
861
891
 
862
892
 
863
- # Drafts
893
+ ***
864
894
 
865
- > Learn how to create, manage, and send Drafts to enable advanced agent workflows like human-in-the-loop review and scheduled sending.
895
+ title: Drafts
896
+ subtitle: Preparing and scheduling Messages for your agents.
897
+ slug: drafts
898
+ description: >-
899
+ Learn how to create, manage, and send Drafts to enable advanced agent
900
+ workflows like human-in-the-loop review and scheduled sending.
901
+ --------------------------------------------------------------
866
902
 
867
903
  ## What is a Draft?
868
904
 
@@ -984,9 +1020,15 @@ Similar to `Threads`, you can list all `Drafts` across your entire `Organization
984
1020
  </CodeBlocks>
985
1021
 
986
1022
 
987
- # Labels
1023
+ ***
988
1024
 
989
- > Learn how to use Labels to manage state, track campaigns, and filter messages for powerful agentic workflows.
1025
+ title: Labels
1026
+ subtitle: Organizing and categorizing your agent's conversations at scale.
1027
+ slug: labels
1028
+ description: >-
1029
+ Learn how to use Labels to manage state, track campaigns, and filter messages
1030
+ for powerful agentic workflows.
1031
+ -------------------------------
990
1032
 
991
1033
  ## What are `Labels`?
992
1034
 
@@ -1138,9 +1180,15 @@ This is where `Labels` become truly powerful. You can list `Threads`, `Messages`
1138
1180
  </Callout>
1139
1181
 
1140
1182
 
1141
- # Attachments
1183
+ ***
1142
1184
 
1143
- > Learn how to send files as attachments, and download incoming attachments from both messages and threads.
1185
+ title: Attachments
1186
+ subtitle: Sending and receiving files with your agents.
1187
+ slug: attachments
1188
+ description: >-
1189
+ Learn how to send files as attachments, and download incoming attachments from
1190
+ both messages and threads.
1191
+ --------------------------
1144
1192
 
1145
1193
  ## What are `Attachments`?
1146
1194
 
@@ -1278,9 +1326,11 @@ Similarly, you can retrieve an `Attachment` if you know the `Thread` it's in, wh
1278
1326
  </CodeBlocks>
1279
1327
 
1280
1328
 
1281
- # Pods
1329
+ ***
1282
1330
 
1283
- > Learn how to use pods for multi-tenant email management
1331
+ title: Pods
1332
+ description: Learn how to use pods for multi-tenant email management
1333
+ --------------------------------------------------------------------
1284
1334
 
1285
1335
  ## What are Pods?
1286
1336
 
@@ -1516,9 +1566,15 @@ Pod: "Marketing-Agent"
1516
1566
  * Explore [Domains](/custom-domains) to set up custom email domains for your pods
1517
1567
 
1518
1568
 
1519
- # Skills
1569
+ ***
1520
1570
 
1521
- > AgentMail's official skill for Moltbot, Claude Code, Cursor, and other AI assistants
1571
+ title: Skills
1572
+ subtitle: Add AgentMail to AI coding assistants with the official skill
1573
+ slug: integrations/skills
1574
+ description: >-
1575
+ AgentMail's official skill for Moltbot, Claude Code, Cursor, and other AI
1576
+ assistants
1577
+ ----------
1522
1578
 
1523
1579
  ## Getting started
1524
1580
 
@@ -1653,9 +1709,13 @@ Once installed, you can ask your AI assistant to perform email tasks:
1653
1709
  * [AgentMail Console](https://console.agentmail.to)
1654
1710
 
1655
1711
 
1656
- # MCP
1712
+ ***
1657
1713
 
1658
- > AgentMail's Model Context Protocol (MCP) integration
1714
+ title: MCP
1715
+ subtitle: Connect AgentMail to any MCP-compatible AI client
1716
+ slug: integrations/mcp
1717
+ description: AgentMail's Model Context Protocol (MCP) integration
1718
+ -----------------------------------------------------------------
1659
1719
 
1660
1720
  ## Getting started
1661
1721
 
@@ -1686,9 +1746,13 @@ The AgentMail MCP server works with any MCP-compatible client, including:
1686
1746
  For detailed setup instructions and available tools, visit [mcp.agentmail.to](https://mcp.agentmail.to).
1687
1747
 
1688
1748
 
1689
- # Openclaw
1749
+ ***
1690
1750
 
1691
- > AgentMail's Openclaw integration
1751
+ title: Openclaw
1752
+ subtitle: Give your Openclaw agent its own email inbox
1753
+ slug: integrations/openclaw
1754
+ description: AgentMail's Openclaw integration
1755
+ ---------------------------------------------
1692
1756
 
1693
1757
  ## Getting started
1694
1758
 
@@ -1708,10 +1772,10 @@ Install the skill using the Openclaw CLI:
1708
1772
  openclaw skills install agentmail-to/agentmail-skills/agentmail
1709
1773
  ```
1710
1774
 
1711
- Or install via ClawdHub:
1775
+ Or install via ClawHub:
1712
1776
 
1713
1777
  ```bash
1714
- clawdhub install agentmail
1778
+ npx clawhub@latest install agentmail
1715
1779
  ```
1716
1780
 
1717
1781
  ### Configuration
@@ -1790,7 +1854,7 @@ You can send and receive emails using the AgentMail API. Use the `exec` tool to
1790
1854
  ## API Base URL
1791
1855
 
1792
1856
  ```
1793
- https://api.agentmail.to/v1
1857
+ https://api.agentmail.to/v0
1794
1858
  ```
1795
1859
 
1796
1860
  ## Authentication
@@ -1807,7 +1871,7 @@ Authorization: Bearer $AGENTMAIL_API_KEY
1807
1871
 
1808
1872
  ```bash
1809
1873
  curl -s -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
1810
- https://api.agentmail.to/v1/inboxes
1874
+ https://api.agentmail.to/v0/inboxes
1811
1875
  ```
1812
1876
 
1813
1877
  ### Create an inbox
@@ -1816,7 +1880,7 @@ curl -s -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
1816
1880
  curl -s -X POST -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
1817
1881
  -H "Content-Type: application/json" \
1818
1882
  -d '{"display_name": "My Agent"}' \
1819
- https://api.agentmail.to/v1/inboxes
1883
+ https://api.agentmail.to/v0/inboxes
1820
1884
  ```
1821
1885
 
1822
1886
  ### Send an email
@@ -1829,14 +1893,14 @@ curl -s -X POST -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
1829
1893
  "subject": "Hello from Openclaw",
1830
1894
  "text": "This email was sent by my AI assistant."
1831
1895
  }' \
1832
- https://api.agentmail.to/v1/inboxes/{inbox_id}/messages
1896
+ https://api.agentmail.to/v0/inboxes/{inbox_id}/messages
1833
1897
  ```
1834
1898
 
1835
1899
  ### List messages in an inbox
1836
1900
 
1837
1901
  ```bash
1838
1902
  curl -s -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
1839
- https://api.agentmail.to/v1/inboxes/{inbox_id}/messages
1903
+ https://api.agentmail.to/v0/inboxes/{inbox_id}/messages
1840
1904
  ```
1841
1905
 
1842
1906
  ### Reply to a message
@@ -1845,7 +1909,7 @@ curl -s -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
1845
1909
  curl -s -X POST -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
1846
1910
  -H "Content-Type: application/json" \
1847
1911
  -d '{"text": "Thanks for your email!"}' \
1848
- https://api.agentmail.to/v1/inboxes/{inbox_id}/messages/{message_id}/reply
1912
+ https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/{message_id}/reply
1849
1913
  ```
1850
1914
  ````
1851
1915
 
@@ -1903,7 +1967,7 @@ curl -X POST -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
1903
1967
  "url": "https://your-openclaw-webhook-url",
1904
1968
  "events": ["message.received"]
1905
1969
  }' \
1906
- https://api.agentmail.to/v1/webhooks
1970
+ https://api.agentmail.to/v0/webhooks
1907
1971
  ```
1908
1972
 
1909
1973
  Now Openclaw will be notified whenever a new email arrives, allowing it to proactively inform you or take action.
@@ -1916,9 +1980,13 @@ Now Openclaw will be notified whenever a new email arrives, allowing it to proac
1916
1980
  * [Openclaw Skills Guide](https://docs.openclaw.ai/tools/skills)
1917
1981
 
1918
1982
 
1919
- # Replit
1983
+ ***
1920
1984
 
1921
- > AgentMail's Replit integration
1985
+ title: Replit
1986
+ subtitle: Integrate AgentMail with your Replit apps and agents
1987
+ slug: integrations/replit
1988
+ description: AgentMail's Replit integration
1989
+ -------------------------------------------
1922
1990
 
1923
1991
  ## Getting started
1924
1992
 
@@ -2128,9 +2196,15 @@ Email is critical to identity and communication on the internet. Much of the con
2128
2196
  These are just a few select verticals, but we have seen AgentMail be effective in automating any email task across every function. If a human does it with email, it can be automated with AgentMail.
2129
2197
 
2130
2198
 
2131
- # Guide: Sending & Receiving Email
2199
+ ***
2132
2200
 
2133
- > A step-by-step guide to the practical workflow of sending initial emails and handling replies to have a full conversation.
2201
+ title: 'Guide: Sending & Receiving Email'
2202
+ subtitle: Building your first conversational agent workflow.
2203
+ slug: sending-receiving-email
2204
+ description: >-
2205
+ A step-by-step guide to the practical workflow of sending initial emails and
2206
+ handling replies to have a full conversation.
2207
+ ---------------------------------------------
2134
2208
 
2135
2209
  This guide walks you through the complete, practical workflow of an agent having a conversation. While the `Core Concepts` pages detail the individual API calls, this guide shows you how to stitch them together to create a functional conversational loop.
2136
2210
 
@@ -2261,9 +2335,15 @@ Here's the step-by-step logic for a polling-based conversational agent.
2261
2335
  </Callout>
2262
2336
 
2263
2337
 
2264
- # IMAP & SMTP
2338
+ ***
2265
2339
 
2266
- > Configure IMAP and SMTP to access your AgentMail inboxes using email clients or programmatic access.
2340
+ title: IMAP & SMTP
2341
+ subtitle: Connect to AgentMail with standard email protocols
2342
+ slug: imap-smtp
2343
+ description: >-
2344
+ Configure IMAP and SMTP to access your AgentMail inboxes using email clients
2345
+ or programmatic access.
2346
+ -----------------------
2267
2347
 
2268
2348
  AgentMail supports standard IMAP and SMTP protocols, allowing you to connect using traditional email clients or integrate with existing systems that rely on these protocols.
2269
2349
 
@@ -2499,9 +2579,17 @@ sendEmail().catch(console.error);
2499
2579
  | Bulk operations | API |
2500
2580
 
2501
2581
 
2502
- # Using Custom Domains
2582
+ ***
2503
2583
 
2504
- > A step-by-step guide to configuring your custom domain with AgentMail for enhanced branding and trust.
2584
+ title: Using Custom Domains
2585
+ subtitle: >-
2586
+ Strengthen your agent's identity and improve deliverability with your own
2587
+ domain.
2588
+ slug: custom-domains
2589
+ description: >-
2590
+ A step-by-step guide to configuring your custom domain with AgentMail for
2591
+ enhanced branding and trust.
2592
+ ----------------------------
2505
2593
 
2506
2594
  ## Why Use a Custom Domain?
2507
2595
 
@@ -2898,9 +2986,17 @@ DNS can be tricky. Here are some common issues and how to resolve them.
2898
2986
  Check out our guide on [Email Deliverability](/email-deliverability) for tips on warming up your new domain and maintaining a healthy sender reputation.
2899
2987
 
2900
2988
 
2901
- # Managing Your Domains
2989
+ ***
2902
2990
 
2903
- > Learn how to manage your custom domains effectively using AgentMail's API for enhanced deliverability and reputation management.
2991
+ title: Managing Your Domains
2992
+ subtitle: >-
2993
+ Best practices for monitoring, scaling, and optimizing your domain strategy
2994
+ for agent fleets.
2995
+ slug: managing-domains
2996
+ description: >-
2997
+ Learn how to manage your custom domains effectively using AgentMail's API for
2998
+ enhanced deliverability and reputation management.
2999
+ --------------------------------------------------
2904
3000
 
2905
3001
  ## From Setup to Strategy
2906
3002
 
@@ -2969,9 +3065,13 @@ By default, AgentMail configures your domain with a strict DMARC policy (`p=reje
2969
3065
  However, this is obviously up to your discretion if you want to impose a more relaxed DMARC policy, whether its `p=none` where it doesn't do anything if both SPF and DMARC fail, or its `p=quarantine`, where it puts the mail in spam/junk. Feel free to do more research at your own discretion. You can do this by changing the value in the TXT record in your DNS configuration where the name starts with `_dmarc`.
2970
3066
 
2971
3067
 
2972
- # Integrate LiveKit Agents
3068
+ ***
2973
3069
 
2974
- > A step-by-step guide to integrate with the LiveKit Agents SDK.
3070
+ title: Integrate LiveKit Agents
3071
+ subtitle: Build a voice assistant with real time email capabilities.
3072
+ slug: integrate-livekit-agents
3073
+ description: A step-by-step guide to integrate with the LiveKit Agents SDK.
3074
+ ---------------------------------------------------------------------------
2975
3075
 
2976
3076
  ## Overview
2977
3077
 
@@ -3099,9 +3199,15 @@ python agent.py console
3099
3199
  ```
3100
3200
 
3101
3201
 
3102
- # Webhooks Overview
3202
+ ***
3103
3203
 
3104
- > Learn how to use Webhooks to build responsive, event-driven email agents with AgentMail.
3204
+ title: Webhooks Overview
3205
+ subtitle: Get real-time notifications for email events.
3206
+ slug: overview
3207
+ description: >-
3208
+ Learn how to use Webhooks to build responsive, event-driven email agents with
3209
+ AgentMail.
3210
+ ----------
3105
3211
 
3106
3212
  Webhooks are the best way to get real-time information about what's happening with your emails. Instead of constantly asking the AgentMail API if there's a new email (a process called polling), you can register a URL, and we will send you a `POST` request with the details as soon as an event happens.
3107
3213
 
@@ -3222,7 +3328,11 @@ When AgentMail sends a webhook, the payload will have the following structure.
3222
3328
  </CardGroup>
3223
3329
 
3224
3330
 
3225
- # Webhook Events
3331
+ ***
3332
+
3333
+ title: Webhook Events
3334
+ slug: events
3335
+ ------------
3226
3336
 
3227
3337
  As mentioned in the overview, webhooks allow us to create event-driven applications.
3228
3338
 
@@ -3480,9 +3590,15 @@ For example, if you only need to trigger workflows on incoming messages, you can
3480
3590
  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)
3481
3591
 
3482
3592
 
3483
- # Webhook Setup Guide
3593
+ ***
3484
3594
 
3485
- > A comprehensive guide to setting up webhooks with ngrok and AgentMail, including account creation, inbox setup, and code examples.
3595
+ title: Webhook Setup Guide
3596
+ subtitle: Step-by-step guide to configure webhooks.
3597
+ slug: webhook-setup
3598
+ description: >-
3599
+ A comprehensive guide to setting up webhooks with ngrok and AgentMail,
3600
+ including account creation, inbox setup, and code examples.
3601
+ -----------------------------------------------------------
3486
3602
 
3487
3603
  This guide walks you through the complete process of setting up webhooks to receive real-time notifications from AgentMail. You'll learn how to create an ngrok account, set up an inbox, configure webhooks, and write a simple webhook receiver.
3488
3604
 
@@ -3728,9 +3844,15 @@ For production deployments:
3728
3844
  </CardGroup>
3729
3845
 
3730
3846
 
3731
- # Verifying Webhooks
3847
+ ***
3732
3848
 
3733
- > Learn how to verify webhook signatures to secure your webhook endpoints and prevent spoofed requests.
3849
+ title: Verifying Webhooks
3850
+ subtitle: Ensure webhook requests are authentically from AgentMail.
3851
+ slug: webhook-verification
3852
+ description: >-
3853
+ Learn how to verify webhook signatures to secure your webhook endpoints and
3854
+ prevent spoofed requests.
3855
+ -------------------------
3734
3856
 
3735
3857
  When building webhook receivers, it's critical to verify that incoming requests actually originate from AgentMail and haven't been tampered with. AgentMail uses [Svix](https://www.svix.com/) to deliver webhooks, which provides cryptographic signature verification.
3736
3858
 
@@ -4090,9 +4212,15 @@ For production, you'll need to deploy your webhook server to a hosting provider
4090
4212
  </CardGroup>
4091
4213
 
4092
4214
 
4093
- # WebSockets
4215
+ ***
4094
4216
 
4095
- > Learn how to use WebSockets for instant email notifications without webhooks or polling.
4217
+ title: WebSockets
4218
+ subtitle: 'Real-time, low-latency email event streaming'
4219
+ slug: websockets
4220
+ description: >-
4221
+ Learn how to use WebSockets for instant email notifications without webhooks
4222
+ or polling.
4223
+ -----------
4096
4224
 
4097
4225
  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.
4098
4226
 
@@ -4465,9 +4593,15 @@ main();
4465
4593
  ***
4466
4594
 
4467
4595
 
4468
- # Email Deliverability
4596
+ ***
4469
4597
 
4470
- > Learn the strategies and best practices for maximizing your email deliverability with AgentMail.
4598
+ title: Email Deliverability
4599
+ subtitle: 'Best practices for landing your emails in the inbox, not the spam folder.'
4600
+ slug: email-deliverability
4601
+ description: >-
4602
+ Learn the strategies and best practices for maximizing your email
4603
+ deliverability with AgentMail.
4604
+ ------------------------------
4471
4605
 
4472
4606
  ## What is Email Deliverability?
4473
4607
 
@@ -4574,9 +4708,15 @@ The content of your email plays a huge role in whether it's seen as a valuable m
4574
4708
  </Steps>
4575
4709
 
4576
4710
 
4577
- # Idempotent Requests
4711
+ ***
4578
4712
 
4579
- > A guide to using the client_id parameter in AgentMail to prevent duplicate resources and safely retry API requests.
4713
+ title: Idempotent Requests
4714
+ subtitle: Learn how to use idempotency keys to build safe and reliable API integrations.
4715
+ slug: idempotency
4716
+ description: >-
4717
+ A guide to using the client\_id parameter in AgentMail to prevent duplicate
4718
+ resources and safely retry API requests.
4719
+ ----------------------------------------
4580
4720
 
4581
4721
  ## What is Idempotency?
4582
4722
 
@@ -4623,9 +4763,17 @@ To use idempotency effectively, the `client_id` you generate must be unique and
4623
4763
  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.
4624
4764
 
4625
4765
 
4626
- # Example: Event-Driven Agent
4766
+ ***
4627
4767
 
4628
- > A step-by-step guide to building a sophisticated agent that performs proactive outreach and uses webhooks for inbound message processing.
4768
+ title: 'Example: Event-Driven Agent'
4769
+ subtitle: >-
4770
+ Build a proactive, event-driven GitHub agent that uses Webhooks to handle
4771
+ replies in real time.
4772
+ slug: webhook-agent
4773
+ description: >-
4774
+ A step-by-step guide to building a sophisticated agent that performs proactive
4775
+ outreach and uses webhooks for inbound message processing.
4776
+ ----------------------------------------------------------
4629
4777
 
4630
4778
  This tutorial walks you through building a sophisticated, dual-mode agent. It will:
4631
4779
 
@@ -5034,9 +5182,13 @@ You now have a fully event-driven agent that can both initiate conversations and
5034
5182
  ```
5035
5183
 
5036
5184
 
5037
- # Auto-Reply Email Agent
5185
+ ***
5038
5186
 
5039
- > Build a simple agent that automatically responds to incoming emails with personalized messages
5187
+ title: Auto-Reply Email Agent
5188
+ description: >-
5189
+ Build a simple agent that automatically responds to incoming emails with
5190
+ personalized messages
5191
+ ---------------------
5040
5192
 
5041
5193
  ## Overview
5042
5194
 
@@ -5902,9 +6054,13 @@ Your agent now has conversation memory. When replying to follow-up emails, the A
5902
6054
  If you build something cool with AgentMail, we'd love to hear about it. Share in our [Discord community](https://discord.gg/hTYatWYWBc)!
5903
6055
 
5904
6056
 
5905
- # Smart Email Labeling Agent
6057
+ ***
5906
6058
 
5907
- > Build an AI-powered agent that automatically classifies and labels incoming emails across multiple dimensions
6059
+ title: Smart Email Labeling Agent
6060
+ description: >-
6061
+ Build an AI-powered agent that automatically classifies and labels incoming
6062
+ emails across multiple dimensions
6063
+ ---------------------------------
5908
6064
 
5909
6065
  ## Overview
5910
6066
 
@@ -6614,9 +6770,14 @@ Use this data to identify bottlenecks, improve processes, and make data-driven d
6614
6770
  Congratulations! You've built an AI-powered email classification system. This agent showcases how AgentMail's labeling feature can power sophisticated inbox automation and analytics.
6615
6771
 
6616
6772
 
6617
- # Sales Agent with WebSocket
6773
+ ***
6618
6774
 
6619
- > A step-by-step guide to building an AI-powered sales agent that uses WebSocket for real-time email processing without polling or webhooks.
6775
+ title: Sales Agent with WebSocket
6776
+ slug: sales-agent-websocket
6777
+ description: >-
6778
+ A step-by-step guide to building an AI-powered sales agent that uses WebSocket
6779
+ for real-time email processing without polling or webhooks.
6780
+ -----------------------------------------------------------
6620
6781
 
6621
6782
  ## Overview
6622
6783
 
@@ -7335,8 +7496,6 @@ await socket.send_subscribe(Subscribe(inbox_ids=[
7335
7496
  If you build something cool with AgentMail, we'd love to hear about it. Share in our [Discord community](https://discord.gg/hTYatWYWBc)!
7336
7497
 
7337
7498
 
7338
- # Live AgentMail Examples
7339
-
7340
7499
  # Live Email Agents
7341
7500
 
7342
7501
  We have several deployed agents running in production that demonstrate the power of AgentMail. These agents showcase different use cases and capabilities of our platform.
@@ -7379,9 +7538,14 @@ Ready to build your own intelligent email agent? Check out our [quickstart guide
7379
7538
  </Note>
7380
7539
 
7381
7540
 
7382
- # Frequently Asked Questions (FAQ)
7541
+ ***
7383
7542
 
7384
- > Find answers to common questions about AgentMail, from core concepts to best practices and security.
7543
+ title: Frequently Asked Questions (FAQ)
7544
+ slug: faq
7545
+ description: >-
7546
+ Find answers to common questions about AgentMail, from core concepts to best
7547
+ practices and security.
7548
+ -----------------------
7385
7549
 
7386
7550
  <AccordionGroup>
7387
7551
  <Accordion title="What is AgentMail?">
@@ -7429,9 +7593,15 @@ Ready to build your own intelligent email agent? Check out our [quickstart guide
7429
7593
  </AccordionGroup>
7430
7594
 
7431
7595
 
7432
- # Email Reply Extraction with Talon
7596
+ ***
7433
7597
 
7434
- > Learn how to use Talon to extract new content from email replies, removing quoted text with 93.8% accuracy.
7598
+ title: Email Reply Extraction with Talon
7599
+ subtitle: Extract clean reply content from email threads using Talon library
7600
+ slug: talon-reply-extraction
7601
+ description: >-
7602
+ Learn how to use Talon to extract new content from email replies, removing
7603
+ quoted text with 93.8% accuracy.
7604
+ --------------------------------
7435
7605
 
7436
7606
  ## Why Talon?
7437
7607
 
@@ -7962,9 +8132,14 @@ TalonJS provides 90.6% accuracy with slightly faster performance (1.88ms), makin
7962
8132
  </Tip>
7963
8133
 
7964
8134
 
7965
- # Join the AgentMail Community
8135
+ ***
7966
8136
 
7967
- > Connect with the AgentMail team and developers, share what you're building, and get support.
8137
+ title: Join the AgentMail Community
8138
+ slug: community
8139
+ description: >-
8140
+ Connect with the AgentMail team and developers, share what you're building,
8141
+ and get support.
8142
+ ----------------
7968
8143
 
7969
8144
  <CardGroup>
7970
8145
  <Card title="Join our Discord Server" href="https://discord.com/invite/hTYatWYWBc" icon="fa-brands fa-discord">
@@ -7990,9 +8165,12 @@ TalonJS provides 90.6% accuracy with slightly faster performance (1.88ms), makin
7990
8165
  </Callout>
7991
8166
 
7992
8167
 
7993
- # Support
8168
+ ***
7994
8169
 
7995
- > Get help with AgentMail through our support channels.
8170
+ title: Support
8171
+ slug: support
8172
+ description: Get help with AgentMail through our support channels.
8173
+ ------------------------------------------------------------------
7996
8174
 
7997
8175
  ## Need Help?
7998
8176
 
@@ -8005,9 +8183,12 @@ TalonJS provides 90.6% accuracy with slightly faster performance (1.88ms), makin
8005
8183
  </Cards>
8006
8184
 
8007
8185
 
8008
- # Understanding Email Authentication (SPF, DKIM, DMARC)
8186
+ ***
8009
8187
 
8010
- > Learn why we ask for DNS records and what SPF, DKIM, and DMARC are.
8188
+ title: 'Understanding Email Authentication (SPF, DKIM, DMARC)'
8189
+ slug: email-protocols
8190
+ description: 'Learn why we ask for DNS records and what SPF, DKIM, and DMARC are.'
8191
+ ----------------------------------------------------------------------------------
8011
8192
 
8012
8193
  When you add a custom domain to AgentMail, we ask you to add several records to your DNS settings. We understand that this can seem daunting, and we want to be completely transparent about what these records are and why they are necessary.
8013
8194
 
@@ -8081,9 +8262,13 @@ This is some records that we might give you:
8081
8262
  We hope this provides a clear and transparent look into why these DNS records are required. By setting them up, you enable AgentMail to provide a secure and reliable email experience for your AI agents.
8082
8263
 
8083
8264
 
8084
- # SOC 2 Compliance
8265
+ ***
8085
8266
 
8086
- > AgentMail's SOC 2 Type I achievement and Type II certification progress.
8267
+ title: SOC 2 Compliance
8268
+ description: AgentMail's SOC 2 Type I achievement and Type II certification progress.
8269
+ sidebar\_position: 40
8270
+ lastUpdated: '2025-11-02'
8271
+ -------------------------
8087
8272
 
8088
8273
  > AgentMail has **achieved SOC 2 Type I compliance** (July 2025) and is currently working toward **Type II certification** (target: Q1 2026).
8089
8274
 
@@ -8216,9 +8401,13 @@ Organizations evaluating AgentMail can [request SOC 2 documentation](mailto:secu
8216
8401
  ***
8217
8402
 
8218
8403
 
8219
- # API Welcome
8404
+ ***
8220
8405
 
8221
- > Quick overview of the AgentMail SDK
8406
+ title: API Welcome
8407
+ subtitle: Getting Started with AgentMail
8408
+ slug: api-reference
8409
+ description: Quick overview of the AgentMail SDK
8410
+ ------------------------------------------------
8222
8411
 
8223
8412
  ## Introduction
8224
8413
 
@@ -8358,11 +8547,11 @@ components:
8358
8547
  ## SDK Code Examples
8359
8548
 
8360
8549
  ```typescript
8361
- import { AgentMailClient } from "agentmail";
8550
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
8362
8551
 
8363
8552
  async function main() {
8364
8553
  const client = new AgentMailClient({
8365
- environment: "https://api.agentmail.to",
8554
+ environment: AgentMailEnvironment.Production,
8366
8555
  apiKey: "YOUR_TOKEN_HERE",
8367
8556
  });
8368
8557
  await client.inboxes.list({});
@@ -8373,9 +8562,10 @@ main();
8373
8562
 
8374
8563
  ```python
8375
8564
  from agentmail import AgentMail
8565
+ from agentmail.environment import AgentMailEnvironment
8376
8566
 
8377
8567
  client = AgentMail(
8378
- base_url="https://api.agentmail.to",
8568
+ environment=AgentMailEnvironment.PRODUCTION,
8379
8569
  api_key="YOUR_TOKEN_HERE"
8380
8570
  )
8381
8571
 
@@ -8581,11 +8771,11 @@ components:
8581
8771
  ## SDK Code Examples
8582
8772
 
8583
8773
  ```typescript
8584
- import { AgentMailClient } from "agentmail";
8774
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
8585
8775
 
8586
8776
  async function main() {
8587
8777
  const client = new AgentMailClient({
8588
- environment: "https://api.agentmail.to",
8778
+ environment: AgentMailEnvironment.Production,
8589
8779
  apiKey: "YOUR_TOKEN_HERE",
8590
8780
  });
8591
8781
  await client.inboxes.get("inbox_id");
@@ -8596,9 +8786,10 @@ main();
8596
8786
 
8597
8787
  ```python
8598
8788
  from agentmail import AgentMail
8789
+ from agentmail.environment import AgentMailEnvironment
8599
8790
 
8600
8791
  client = AgentMail(
8601
- base_url="https://api.agentmail.to",
8792
+ environment=AgentMailEnvironment.PRODUCTION,
8602
8793
  api_key="YOUR_TOKEN_HERE"
8603
8794
  )
8604
8795
 
@@ -8822,11 +9013,11 @@ components:
8822
9013
  ## SDK Code Examples
8823
9014
 
8824
9015
  ```typescript
8825
- import { AgentMailClient } from "agentmail";
9016
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
8826
9017
 
8827
9018
  async function main() {
8828
9019
  const client = new AgentMailClient({
8829
- environment: "https://api.agentmail.to",
9020
+ environment: AgentMailEnvironment.Production,
8830
9021
  apiKey: "YOUR_TOKEN_HERE",
8831
9022
  });
8832
9023
  await client.inboxes.create({
@@ -8840,9 +9031,10 @@ main();
8840
9031
 
8841
9032
  ```python
8842
9033
  from agentmail import AgentMail
9034
+ from agentmail.environment import AgentMailEnvironment
8843
9035
 
8844
9036
  client = AgentMail(
8845
- base_url="https://api.agentmail.to",
9037
+ environment=AgentMailEnvironment.PRODUCTION,
8846
9038
  api_key="YOUR_TOKEN_HERE"
8847
9039
  )
8848
9040
 
@@ -9074,11 +9266,11 @@ components:
9074
9266
  ## SDK Code Examples
9075
9267
 
9076
9268
  ```typescript
9077
- import { AgentMailClient } from "agentmail";
9269
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
9078
9270
 
9079
9271
  async function main() {
9080
9272
  const client = new AgentMailClient({
9081
- environment: "https://api.agentmail.to",
9273
+ environment: AgentMailEnvironment.Production,
9082
9274
  apiKey: "YOUR_TOKEN_HERE",
9083
9275
  });
9084
9276
  await client.inboxes.update("inbox_id", {
@@ -9091,9 +9283,10 @@ main();
9091
9283
 
9092
9284
  ```python
9093
9285
  from agentmail import AgentMail
9286
+ from agentmail.environment import AgentMailEnvironment
9094
9287
 
9095
9288
  client = AgentMail(
9096
- base_url="https://api.agentmail.to",
9289
+ environment=AgentMailEnvironment.PRODUCTION,
9097
9290
  api_key="YOUR_TOKEN_HERE"
9098
9291
  )
9099
9292
 
@@ -9270,11 +9463,11 @@ components:
9270
9463
  ## SDK Code Examples
9271
9464
 
9272
9465
  ```typescript
9273
- import { AgentMailClient } from "agentmail";
9466
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
9274
9467
 
9275
9468
  async function main() {
9276
9469
  const client = new AgentMailClient({
9277
- environment: "https://api.agentmail.to",
9470
+ environment: AgentMailEnvironment.Production,
9278
9471
  apiKey: "YOUR_TOKEN_HERE",
9279
9472
  });
9280
9473
  await client.inboxes.delete("inbox_id");
@@ -9285,9 +9478,10 @@ main();
9285
9478
 
9286
9479
  ```python
9287
9480
  from agentmail import AgentMail
9481
+ from agentmail.environment import AgentMailEnvironment
9288
9482
 
9289
9483
  client = AgentMail(
9290
- base_url="https://api.agentmail.to",
9484
+ environment=AgentMailEnvironment.PRODUCTION,
9291
9485
  api_key="YOUR_TOKEN_HERE"
9292
9486
  )
9293
9487
 
@@ -9642,11 +9836,11 @@ components:
9642
9836
  ## SDK Code Examples
9643
9837
 
9644
9838
  ```typescript
9645
- import { AgentMailClient } from "agentmail";
9839
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
9646
9840
 
9647
9841
  async function main() {
9648
9842
  const client = new AgentMailClient({
9649
- environment: "https://api.agentmail.to",
9843
+ environment: AgentMailEnvironment.Production,
9650
9844
  apiKey: "YOUR_TOKEN_HERE",
9651
9845
  });
9652
9846
  await client.inboxes.threads.list("inbox_id", {});
@@ -9657,9 +9851,10 @@ main();
9657
9851
 
9658
9852
  ```python
9659
9853
  from agentmail import AgentMail
9854
+ from agentmail.environment import AgentMailEnvironment
9660
9855
 
9661
9856
  client = AgentMail(
9662
- base_url="https://api.agentmail.to",
9857
+ environment=AgentMailEnvironment.PRODUCTION,
9663
9858
  api_key="YOUR_TOKEN_HERE"
9664
9859
  )
9665
9860
 
@@ -10092,11 +10287,11 @@ components:
10092
10287
  ## SDK Code Examples
10093
10288
 
10094
10289
  ```typescript
10095
- import { AgentMailClient } from "agentmail";
10290
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
10096
10291
 
10097
10292
  async function main() {
10098
10293
  const client = new AgentMailClient({
10099
- environment: "https://api.agentmail.to",
10294
+ environment: AgentMailEnvironment.Production,
10100
10295
  apiKey: "YOUR_TOKEN_HERE",
10101
10296
  });
10102
10297
  await client.inboxes.threads.get("inbox_id", "thread_id");
@@ -10107,9 +10302,10 @@ main();
10107
10302
 
10108
10303
  ```python
10109
10304
  from agentmail import AgentMail
10305
+ from agentmail.environment import AgentMailEnvironment
10110
10306
 
10111
10307
  client = AgentMail(
10112
- base_url="https://api.agentmail.to",
10308
+ environment=AgentMailEnvironment.PRODUCTION,
10113
10309
  api_key="YOUR_TOKEN_HERE"
10114
10310
  )
10115
10311
 
@@ -10324,11 +10520,11 @@ components:
10324
10520
  ## SDK Code Examples
10325
10521
 
10326
10522
  ```typescript
10327
- import { AgentMailClient } from "agentmail";
10523
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
10328
10524
 
10329
10525
  async function main() {
10330
10526
  const client = new AgentMailClient({
10331
- environment: "https://api.agentmail.to",
10527
+ environment: AgentMailEnvironment.Production,
10332
10528
  apiKey: "YOUR_TOKEN_HERE",
10333
10529
  });
10334
10530
  await client.inboxes.threads.getAttachment("inbox_id", "thread_id", "attachment_id");
@@ -10339,9 +10535,10 @@ main();
10339
10535
 
10340
10536
  ```python
10341
10537
  from agentmail import AgentMail
10538
+ from agentmail.environment import AgentMailEnvironment
10342
10539
 
10343
10540
  client = AgentMail(
10344
- base_url="https://api.agentmail.to",
10541
+ environment=AgentMailEnvironment.PRODUCTION,
10345
10542
  api_key="YOUR_TOKEN_HERE"
10346
10543
  )
10347
10544
 
@@ -10506,11 +10703,11 @@ components:
10506
10703
  ## SDK Code Examples
10507
10704
 
10508
10705
  ```typescript
10509
- import { AgentMailClient } from "agentmail";
10706
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
10510
10707
 
10511
10708
  async function main() {
10512
10709
  const client = new AgentMailClient({
10513
- environment: "https://api.agentmail.to",
10710
+ environment: AgentMailEnvironment.Production,
10514
10711
  apiKey: "YOUR_TOKEN_HERE",
10515
10712
  });
10516
10713
  await client.inboxes.threads.delete("inbox_id", "thread_id");
@@ -10521,9 +10718,10 @@ main();
10521
10718
 
10522
10719
  ```python
10523
10720
  from agentmail import AgentMail
10721
+ from agentmail.environment import AgentMailEnvironment
10524
10722
 
10525
10723
  client = AgentMail(
10526
- base_url="https://api.agentmail.to",
10724
+ environment=AgentMailEnvironment.PRODUCTION,
10527
10725
  api_key="YOUR_TOKEN_HERE"
10528
10726
  )
10529
10727
 
@@ -10890,11 +11088,11 @@ components:
10890
11088
  ## SDK Code Examples
10891
11089
 
10892
11090
  ```typescript
10893
- import { AgentMailClient } from "agentmail";
11091
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
10894
11092
 
10895
11093
  async function main() {
10896
11094
  const client = new AgentMailClient({
10897
- environment: "https://api.agentmail.to",
11095
+ environment: AgentMailEnvironment.Production,
10898
11096
  apiKey: "YOUR_TOKEN_HERE",
10899
11097
  });
10900
11098
  await client.inboxes.messages.list("inbox_id", {});
@@ -10905,9 +11103,10 @@ main();
10905
11103
 
10906
11104
  ```python
10907
11105
  from agentmail import AgentMail
11106
+ from agentmail.environment import AgentMailEnvironment
10908
11107
 
10909
11108
  client = AgentMail(
10910
- base_url="https://api.agentmail.to",
11109
+ environment=AgentMailEnvironment.PRODUCTION,
10911
11110
  api_key="YOUR_TOKEN_HERE"
10912
11111
  )
10913
11112
 
@@ -11227,11 +11426,11 @@ components:
11227
11426
  ## SDK Code Examples
11228
11427
 
11229
11428
  ```typescript
11230
- import { AgentMailClient } from "agentmail";
11429
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
11231
11430
 
11232
11431
  async function main() {
11233
11432
  const client = new AgentMailClient({
11234
- environment: "https://api.agentmail.to",
11433
+ environment: AgentMailEnvironment.Production,
11235
11434
  apiKey: "YOUR_TOKEN_HERE",
11236
11435
  });
11237
11436
  await client.inboxes.messages.get("inbox_id", "message_id");
@@ -11242,9 +11441,10 @@ main();
11242
11441
 
11243
11442
  ```python
11244
11443
  from agentmail import AgentMail
11444
+ from agentmail.environment import AgentMailEnvironment
11245
11445
 
11246
11446
  client = AgentMail(
11247
- base_url="https://api.agentmail.to",
11447
+ environment=AgentMailEnvironment.PRODUCTION,
11248
11448
  api_key="YOUR_TOKEN_HERE"
11249
11449
  )
11250
11450
 
@@ -11459,11 +11659,11 @@ components:
11459
11659
  ## SDK Code Examples
11460
11660
 
11461
11661
  ```typescript
11462
- import { AgentMailClient } from "agentmail";
11662
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
11463
11663
 
11464
11664
  async function main() {
11465
11665
  const client = new AgentMailClient({
11466
- environment: "https://api.agentmail.to",
11666
+ environment: AgentMailEnvironment.Production,
11467
11667
  apiKey: "YOUR_TOKEN_HERE",
11468
11668
  });
11469
11669
  await client.inboxes.messages.getAttachment("inbox_id", "message_id", "attachment_id");
@@ -11474,9 +11674,10 @@ main();
11474
11674
 
11475
11675
  ```python
11476
11676
  from agentmail import AgentMail
11677
+ from agentmail.environment import AgentMailEnvironment
11477
11678
 
11478
11679
  client = AgentMail(
11479
- base_url="https://api.agentmail.to",
11680
+ environment=AgentMailEnvironment.PRODUCTION,
11480
11681
  api_key="YOUR_TOKEN_HERE"
11481
11682
  )
11482
11683
 
@@ -11646,11 +11847,11 @@ components:
11646
11847
  ## SDK Code Examples
11647
11848
 
11648
11849
  ```typescript
11649
- import { AgentMailClient } from "agentmail";
11850
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
11650
11851
 
11651
11852
  async function main() {
11652
11853
  const client = new AgentMailClient({
11653
- environment: "https://api.agentmail.to",
11854
+ environment: AgentMailEnvironment.Production,
11654
11855
  apiKey: "YOUR_TOKEN_HERE",
11655
11856
  });
11656
11857
  await client.inboxes.messages.getRaw(":inbox_id", ":message_id");
@@ -11661,9 +11862,10 @@ main();
11661
11862
 
11662
11863
  ```python
11663
11864
  from agentmail import AgentMail
11865
+ from agentmail.environment import AgentMailEnvironment
11664
11866
 
11665
11867
  client = AgentMail(
11666
- base_url="https://api.agentmail.to",
11868
+ environment=AgentMailEnvironment.PRODUCTION,
11667
11869
  api_key="YOUR_TOKEN_HERE"
11668
11870
  )
11669
11871
 
@@ -11933,11 +12135,11 @@ components:
11933
12135
  ## SDK Code Examples
11934
12136
 
11935
12137
  ```typescript
11936
- import { AgentMailClient } from "agentmail";
12138
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
11937
12139
 
11938
12140
  async function main() {
11939
12141
  const client = new AgentMailClient({
11940
- environment: "https://api.agentmail.to",
12142
+ environment: AgentMailEnvironment.Production,
11941
12143
  apiKey: "YOUR_TOKEN_HERE",
11942
12144
  });
11943
12145
  await client.inboxes.messages.send("inbox_id", {});
@@ -11948,9 +12150,10 @@ main();
11948
12150
 
11949
12151
  ```python
11950
12152
  from agentmail import AgentMail
12153
+ from agentmail.environment import AgentMailEnvironment
11951
12154
 
11952
12155
  client = AgentMail(
11953
- base_url="https://api.agentmail.to",
12156
+ environment=AgentMailEnvironment.PRODUCTION,
11954
12157
  api_key="YOUR_TOKEN_HERE"
11955
12158
  )
11956
12159
 
@@ -12243,11 +12446,11 @@ components:
12243
12446
  ## SDK Code Examples
12244
12447
 
12245
12448
  ```typescript
12246
- import { AgentMailClient } from "agentmail";
12449
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
12247
12450
 
12248
12451
  async function main() {
12249
12452
  const client = new AgentMailClient({
12250
- environment: "https://api.agentmail.to",
12453
+ environment: AgentMailEnvironment.Production,
12251
12454
  apiKey: "YOUR_TOKEN_HERE",
12252
12455
  });
12253
12456
  await client.inboxes.messages.reply("inbox_id", "message_id", {});
@@ -12258,9 +12461,10 @@ main();
12258
12461
 
12259
12462
  ```python
12260
12463
  from agentmail import AgentMail
12464
+ from agentmail.environment import AgentMailEnvironment
12261
12465
 
12262
12466
  client = AgentMail(
12263
- base_url="https://api.agentmail.to",
12467
+ environment=AgentMailEnvironment.PRODUCTION,
12264
12468
  api_key="YOUR_TOKEN_HERE"
12265
12469
  )
12266
12470
 
@@ -12538,11 +12742,11 @@ components:
12538
12742
  ## SDK Code Examples
12539
12743
 
12540
12744
  ```typescript
12541
- import { AgentMailClient } from "agentmail";
12745
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
12542
12746
 
12543
12747
  async function main() {
12544
12748
  const client = new AgentMailClient({
12545
- environment: "https://api.agentmail.to",
12749
+ environment: AgentMailEnvironment.Production,
12546
12750
  apiKey: "YOUR_TOKEN_HERE",
12547
12751
  });
12548
12752
  await client.inboxes.messages.replyAll("inbox_id", "message_id", {});
@@ -12553,9 +12757,10 @@ main();
12553
12757
 
12554
12758
  ```python
12555
12759
  from agentmail import AgentMail
12760
+ from agentmail.environment import AgentMailEnvironment
12556
12761
 
12557
12762
  client = AgentMail(
12558
- base_url="https://api.agentmail.to",
12763
+ environment=AgentMailEnvironment.PRODUCTION,
12559
12764
  api_key="YOUR_TOKEN_HERE"
12560
12765
  )
12561
12766
 
@@ -12849,11 +13054,11 @@ components:
12849
13054
  ## SDK Code Examples
12850
13055
 
12851
13056
  ```typescript
12852
- import { AgentMailClient } from "agentmail";
13057
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
12853
13058
 
12854
13059
  async function main() {
12855
13060
  const client = new AgentMailClient({
12856
- environment: "https://api.agentmail.to",
13061
+ environment: AgentMailEnvironment.Production,
12857
13062
  apiKey: "YOUR_TOKEN_HERE",
12858
13063
  });
12859
13064
  await client.inboxes.messages.forward("inbox_id", "message_id", {});
@@ -12864,9 +13069,10 @@ main();
12864
13069
 
12865
13070
  ```python
12866
13071
  from agentmail import AgentMail
13072
+ from agentmail.environment import AgentMailEnvironment
12867
13073
 
12868
13074
  client = AgentMail(
12869
- base_url="https://api.agentmail.to",
13075
+ environment=AgentMailEnvironment.PRODUCTION,
12870
13076
  api_key="YOUR_TOKEN_HERE"
12871
13077
  )
12872
13078
 
@@ -13228,11 +13434,11 @@ components:
13228
13434
  ## SDK Code Examples
13229
13435
 
13230
13436
  ```typescript
13231
- import { AgentMailClient } from "agentmail";
13437
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
13232
13438
 
13233
13439
  async function main() {
13234
13440
  const client = new AgentMailClient({
13235
- environment: "https://api.agentmail.to",
13441
+ environment: AgentMailEnvironment.Production,
13236
13442
  apiKey: "YOUR_TOKEN_HERE",
13237
13443
  });
13238
13444
  await client.inboxes.messages.update("inbox_id", "message_id", {});
@@ -13243,9 +13449,10 @@ main();
13243
13449
 
13244
13450
  ```python
13245
13451
  from agentmail import AgentMail
13452
+ from agentmail.environment import AgentMailEnvironment
13246
13453
 
13247
13454
  client = AgentMail(
13248
- base_url="https://api.agentmail.to",
13455
+ environment=AgentMailEnvironment.PRODUCTION,
13249
13456
  api_key="YOUR_TOKEN_HERE"
13250
13457
  )
13251
13458
 
@@ -13598,11 +13805,11 @@ components:
13598
13805
  ## SDK Code Examples
13599
13806
 
13600
13807
  ```typescript
13601
- import { AgentMailClient } from "agentmail";
13808
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
13602
13809
 
13603
13810
  async function main() {
13604
13811
  const client = new AgentMailClient({
13605
- environment: "https://api.agentmail.to",
13812
+ environment: AgentMailEnvironment.Production,
13606
13813
  apiKey: "YOUR_TOKEN_HERE",
13607
13814
  });
13608
13815
  await client.inboxes.drafts.list("inbox_id", {});
@@ -13613,9 +13820,10 @@ main();
13613
13820
 
13614
13821
  ```python
13615
13822
  from agentmail import AgentMail
13823
+ from agentmail.environment import AgentMailEnvironment
13616
13824
 
13617
13825
  client = AgentMail(
13618
- base_url="https://api.agentmail.to",
13826
+ environment=AgentMailEnvironment.PRODUCTION,
13619
13827
  api_key="YOUR_TOKEN_HERE"
13620
13828
  )
13621
13829
 
@@ -13920,11 +14128,11 @@ components:
13920
14128
  ## SDK Code Examples
13921
14129
 
13922
14130
  ```typescript
13923
- import { AgentMailClient } from "agentmail";
14131
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
13924
14132
 
13925
14133
  async function main() {
13926
14134
  const client = new AgentMailClient({
13927
- environment: "https://api.agentmail.to",
14135
+ environment: AgentMailEnvironment.Production,
13928
14136
  apiKey: "YOUR_TOKEN_HERE",
13929
14137
  });
13930
14138
  await client.inboxes.drafts.get("inbox_id", "draft_id");
@@ -13935,9 +14143,10 @@ main();
13935
14143
 
13936
14144
  ```python
13937
14145
  from agentmail import AgentMail
14146
+ from agentmail.environment import AgentMailEnvironment
13938
14147
 
13939
14148
  client = AgentMail(
13940
- base_url="https://api.agentmail.to",
14149
+ environment=AgentMailEnvironment.PRODUCTION,
13941
14150
  api_key="YOUR_TOKEN_HERE"
13942
14151
  )
13943
14152
 
@@ -14043,25 +14252,24 @@ let dataTask = session.dataTask(with: request as URLRequest, completionHandler:
14043
14252
  dataTask.resume()
14044
14253
  ```
14045
14254
 
14046
- # Create Draft
14255
+ # Get Attachment
14047
14256
 
14048
- POST https://api.agentmail.to/v0/inboxes/{inbox_id}/drafts
14049
- Content-Type: application/json
14257
+ GET https://api.agentmail.to/v0/inboxes/{inbox_id}/drafts/{draft_id}/attachments/{attachment_id}
14050
14258
 
14051
- Reference: https://docs.agentmail.to/api-reference/inboxes/drafts/create
14259
+ Reference: https://docs.agentmail.to/api-reference/inboxes/drafts/get-attachment
14052
14260
 
14053
14261
  ## OpenAPI Specification
14054
14262
 
14055
14263
  ```yaml
14056
14264
  openapi: 3.1.1
14057
14265
  info:
14058
- title: Create Draft
14059
- version: endpoint_inboxes/drafts.create
14266
+ title: Get Attachment
14267
+ version: endpoint_inboxes/drafts.getAttachment
14060
14268
  paths:
14061
- /v0/inboxes/{inbox_id}/drafts:
14062
- post:
14063
- operationId: create
14064
- summary: Create Draft
14269
+ /v0/inboxes/{inbox_id}/drafts/{draft_id}/attachments/{attachment_id}:
14270
+ get:
14271
+ operationId: get-attachment
14272
+ summary: Get Attachment
14065
14273
  tags:
14066
14274
  - - subpackage_inboxes
14067
14275
  - subpackage_inboxes/drafts
@@ -14071,6 +14279,16 @@ paths:
14071
14279
  required: true
14072
14280
  schema:
14073
14281
  $ref: '#/components/schemas/type_inboxes:InboxId'
14282
+ - name: draft_id
14283
+ in: path
14284
+ required: true
14285
+ schema:
14286
+ $ref: '#/components/schemas/type_drafts:DraftId'
14287
+ - name: attachment_id
14288
+ in: path
14289
+ required: true
14290
+ schema:
14291
+ $ref: '#/components/schemas/type_attachments:AttachmentId'
14074
14292
  - name: Authorization
14075
14293
  in: header
14076
14294
  description: >-
@@ -14085,47 +14303,22 @@ paths:
14085
14303
  content:
14086
14304
  application/json:
14087
14305
  schema:
14088
- $ref: '#/components/schemas/type_drafts:Draft'
14306
+ $ref: '#/components/schemas/type_attachments:AttachmentResponse'
14089
14307
  '404':
14090
14308
  description: Error response with status 404
14091
14309
  content: {}
14092
- requestBody:
14093
- content:
14094
- application/json:
14095
- schema:
14096
- $ref: '#/components/schemas/type_drafts:CreateDraftRequest'
14097
14310
  components:
14098
14311
  schemas:
14099
14312
  type_inboxes:InboxId:
14100
14313
  type: string
14101
- type_drafts:DraftLabels:
14102
- type: array
14103
- items:
14104
- type: string
14105
- type_drafts:DraftReplyTo:
14106
- type: array
14107
- items:
14108
- type: string
14109
- type_drafts:DraftTo:
14110
- type: array
14111
- items:
14112
- type: string
14113
- type_drafts:DraftCc:
14114
- type: array
14115
- items:
14116
- type: string
14117
- type_drafts:DraftBcc:
14118
- type: array
14119
- items:
14120
- type: string
14121
- type_drafts:DraftSubject:
14122
- type: string
14123
- type_drafts:DraftText:
14314
+ type_drafts:DraftId:
14124
14315
  type: string
14125
- type_drafts:DraftHtml:
14316
+ type_attachments:AttachmentId:
14126
14317
  type: string
14127
14318
  type_attachments:AttachmentFilename:
14128
14319
  type: string
14320
+ type_attachments:AttachmentSize:
14321
+ type: integer
14129
14322
  type_attachments:AttachmentContentType:
14130
14323
  type: string
14131
14324
  type_attachments:AttachmentContentDisposition:
@@ -14135,71 +14328,7 @@ components:
14135
14328
  - value: attachment
14136
14329
  type_attachments:AttachmentContentId:
14137
14330
  type: string
14138
- type_attachments:SendAttachment:
14139
- type: object
14140
- properties:
14141
- filename:
14142
- $ref: '#/components/schemas/type_attachments:AttachmentFilename'
14143
- content_type:
14144
- $ref: '#/components/schemas/type_attachments:AttachmentContentType'
14145
- content_disposition:
14146
- $ref: '#/components/schemas/type_attachments:AttachmentContentDisposition'
14147
- content_id:
14148
- $ref: '#/components/schemas/type_attachments:AttachmentContentId'
14149
- content:
14150
- type: string
14151
- description: Base64 encoded content of attachment.
14152
- url:
14153
- type: string
14154
- description: URL to the attachment.
14155
- type_drafts:DraftInReplyTo:
14156
- type: string
14157
- type_drafts:DraftSendAt:
14158
- type: string
14159
- format: date-time
14160
- type_drafts:DraftClientId:
14161
- type: string
14162
- type_drafts:CreateDraftRequest:
14163
- type: object
14164
- properties:
14165
- labels:
14166
- $ref: '#/components/schemas/type_drafts:DraftLabels'
14167
- reply_to:
14168
- $ref: '#/components/schemas/type_drafts:DraftReplyTo'
14169
- to:
14170
- $ref: '#/components/schemas/type_drafts:DraftTo'
14171
- cc:
14172
- $ref: '#/components/schemas/type_drafts:DraftCc'
14173
- bcc:
14174
- $ref: '#/components/schemas/type_drafts:DraftBcc'
14175
- subject:
14176
- $ref: '#/components/schemas/type_drafts:DraftSubject'
14177
- text:
14178
- $ref: '#/components/schemas/type_drafts:DraftText'
14179
- html:
14180
- $ref: '#/components/schemas/type_drafts:DraftHtml'
14181
- attachments:
14182
- type: array
14183
- items:
14184
- $ref: '#/components/schemas/type_attachments:SendAttachment'
14185
- description: Attachments to include in draft.
14186
- in_reply_to:
14187
- $ref: '#/components/schemas/type_drafts:DraftInReplyTo'
14188
- send_at:
14189
- $ref: '#/components/schemas/type_drafts:DraftSendAt'
14190
- client_id:
14191
- $ref: '#/components/schemas/type_drafts:DraftClientId'
14192
- type_threads:ThreadId:
14193
- type: string
14194
- type_drafts:DraftId:
14195
- type: string
14196
- type_drafts:DraftPreview:
14197
- type: string
14198
- type_attachments:AttachmentId:
14199
- type: string
14200
- type_attachments:AttachmentSize:
14201
- type: integer
14202
- type_attachments:Attachment:
14331
+ type_attachments:AttachmentResponse:
14203
14332
  type: object
14204
14333
  properties:
14205
14334
  attachment_id:
@@ -14214,91 +14343,32 @@ components:
14214
14343
  $ref: '#/components/schemas/type_attachments:AttachmentContentDisposition'
14215
14344
  content_id:
14216
14345
  $ref: '#/components/schemas/type_attachments:AttachmentContentId'
14217
- required:
14218
- - attachment_id
14219
- - size
14220
- type_drafts:DraftAttachments:
14221
- type: array
14222
- items:
14223
- $ref: '#/components/schemas/type_attachments:Attachment'
14224
- type_drafts:DraftSendStatus:
14225
- type: string
14226
- enum:
14227
- - value: scheduled
14228
- - value: sending
14229
- - value: failed
14230
- type_drafts:DraftUpdatedAt:
14231
- type: string
14232
- format: date-time
14233
- type_drafts:Draft:
14234
- type: object
14235
- properties:
14236
- inbox_id:
14237
- $ref: '#/components/schemas/type_inboxes:InboxId'
14238
- thread_id:
14239
- $ref: '#/components/schemas/type_threads:ThreadId'
14240
- draft_id:
14241
- $ref: '#/components/schemas/type_drafts:DraftId'
14242
- client_id:
14243
- $ref: '#/components/schemas/type_drafts:DraftClientId'
14244
- labels:
14245
- $ref: '#/components/schemas/type_drafts:DraftLabels'
14246
- reply_to:
14247
- $ref: '#/components/schemas/type_drafts:DraftReplyTo'
14248
- to:
14249
- $ref: '#/components/schemas/type_drafts:DraftTo'
14250
- cc:
14251
- $ref: '#/components/schemas/type_drafts:DraftCc'
14252
- bcc:
14253
- $ref: '#/components/schemas/type_drafts:DraftBcc'
14254
- subject:
14255
- $ref: '#/components/schemas/type_drafts:DraftSubject'
14256
- preview:
14257
- $ref: '#/components/schemas/type_drafts:DraftPreview'
14258
- text:
14259
- $ref: '#/components/schemas/type_drafts:DraftText'
14260
- html:
14261
- $ref: '#/components/schemas/type_drafts:DraftHtml'
14262
- attachments:
14263
- $ref: '#/components/schemas/type_drafts:DraftAttachments'
14264
- in_reply_to:
14265
- $ref: '#/components/schemas/type_drafts:DraftInReplyTo'
14266
- references:
14267
- type: array
14268
- items:
14269
- type: string
14270
- description: IDs of previous messages in thread.
14271
- send_status:
14272
- $ref: '#/components/schemas/type_drafts:DraftSendStatus'
14273
- send_at:
14274
- $ref: '#/components/schemas/type_drafts:DraftSendAt'
14275
- updated_at:
14276
- $ref: '#/components/schemas/type_drafts:DraftUpdatedAt'
14277
- created_at:
14346
+ download_url:
14347
+ type: string
14348
+ description: URL to download the attachment.
14349
+ expires_at:
14278
14350
  type: string
14279
14351
  format: date-time
14280
- description: Time at which draft was created.
14352
+ description: Time at which the download URL expires.
14281
14353
  required:
14282
- - inbox_id
14283
- - thread_id
14284
- - draft_id
14285
- - labels
14286
- - updated_at
14287
- - created_at
14354
+ - attachment_id
14355
+ - size
14356
+ - download_url
14357
+ - expires_at
14288
14358
 
14289
14359
  ```
14290
14360
 
14291
14361
  ## SDK Code Examples
14292
14362
 
14293
14363
  ```typescript
14294
- import { AgentMailClient } from "agentmail";
14364
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
14295
14365
 
14296
14366
  async function main() {
14297
14367
  const client = new AgentMailClient({
14298
- environment: "https://api.agentmail.to",
14368
+ environment: AgentMailEnvironment.Production,
14299
14369
  apiKey: "YOUR_TOKEN_HERE",
14300
14370
  });
14301
- await client.inboxes.drafts.create("inbox_id", {});
14371
+ await client.inboxes.drafts.getAttachment("inbox_id", "draft_id", "attachment_id");
14302
14372
  }
14303
14373
  main();
14304
14374
 
@@ -14306,14 +14376,17 @@ main();
14306
14376
 
14307
14377
  ```python
14308
14378
  from agentmail import AgentMail
14379
+ from agentmail.environment import AgentMailEnvironment
14309
14380
 
14310
14381
  client = AgentMail(
14311
- base_url="https://api.agentmail.to",
14382
+ environment=AgentMailEnvironment.PRODUCTION,
14312
14383
  api_key="YOUR_TOKEN_HERE"
14313
14384
  )
14314
14385
 
14315
- client.inboxes.drafts.create(
14316
- inbox_id="inbox_id"
14386
+ client.inboxes.drafts.get_attachment(
14387
+ inbox_id="inbox_id",
14388
+ draft_id="draft_id",
14389
+ attachment_id="attachment_id"
14317
14390
  )
14318
14391
 
14319
14392
  ```
@@ -14323,21 +14396,392 @@ package main
14323
14396
 
14324
14397
  import (
14325
14398
  "fmt"
14326
- "strings"
14327
14399
  "net/http"
14328
14400
  "io"
14329
14401
  )
14330
14402
 
14331
14403
  func main() {
14332
14404
 
14333
- url := "https://api.agentmail.to/v0/inboxes/inbox_id/drafts"
14334
-
14335
- payload := strings.NewReader("{}")
14405
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/attachments/attachment_id"
14336
14406
 
14337
- req, _ := http.NewRequest("POST", url, payload)
14407
+ req, _ := http.NewRequest("GET", url, nil)
14338
14408
 
14339
14409
  req.Header.Add("Authorization", "Bearer <api_key>")
14340
- req.Header.Add("Content-Type", "application/json")
14410
+
14411
+ res, _ := http.DefaultClient.Do(req)
14412
+
14413
+ defer res.Body.Close()
14414
+ body, _ := io.ReadAll(res.Body)
14415
+
14416
+ fmt.Println(res)
14417
+ fmt.Println(string(body))
14418
+
14419
+ }
14420
+ ```
14421
+
14422
+ ```ruby
14423
+ require 'uri'
14424
+ require 'net/http'
14425
+
14426
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/attachments/attachment_id")
14427
+
14428
+ http = Net::HTTP.new(url.host, url.port)
14429
+ http.use_ssl = true
14430
+
14431
+ request = Net::HTTP::Get.new(url)
14432
+ request["Authorization"] = 'Bearer <api_key>'
14433
+
14434
+ response = http.request(request)
14435
+ puts response.read_body
14436
+ ```
14437
+
14438
+ ```java
14439
+ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/attachments/attachment_id")
14440
+ .header("Authorization", "Bearer <api_key>")
14441
+ .asString();
14442
+ ```
14443
+
14444
+ ```php
14445
+ <?php
14446
+
14447
+ $client = new \GuzzleHttp\Client();
14448
+
14449
+ $response = $client->request('GET', 'https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/attachments/attachment_id', [
14450
+ 'headers' => [
14451
+ 'Authorization' => 'Bearer <api_key>',
14452
+ ],
14453
+ ]);
14454
+
14455
+ echo $response->getBody();
14456
+ ```
14457
+
14458
+ ```csharp
14459
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/attachments/attachment_id");
14460
+ var request = new RestRequest(Method.GET);
14461
+ request.AddHeader("Authorization", "Bearer <api_key>");
14462
+ IRestResponse response = client.Execute(request);
14463
+ ```
14464
+
14465
+ ```swift
14466
+ import Foundation
14467
+
14468
+ let headers = ["Authorization": "Bearer <api_key>"]
14469
+
14470
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/attachments/attachment_id")! as URL,
14471
+ cachePolicy: .useProtocolCachePolicy,
14472
+ timeoutInterval: 10.0)
14473
+ request.httpMethod = "GET"
14474
+ request.allHTTPHeaderFields = headers
14475
+
14476
+ let session = URLSession.shared
14477
+ let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
14478
+ if (error != nil) {
14479
+ print(error as Any)
14480
+ } else {
14481
+ let httpResponse = response as? HTTPURLResponse
14482
+ print(httpResponse)
14483
+ }
14484
+ })
14485
+
14486
+ dataTask.resume()
14487
+ ```
14488
+
14489
+ # Create Draft
14490
+
14491
+ POST https://api.agentmail.to/v0/inboxes/{inbox_id}/drafts
14492
+ Content-Type: application/json
14493
+
14494
+ Reference: https://docs.agentmail.to/api-reference/inboxes/drafts/create
14495
+
14496
+ ## OpenAPI Specification
14497
+
14498
+ ```yaml
14499
+ openapi: 3.1.1
14500
+ info:
14501
+ title: Create Draft
14502
+ version: endpoint_inboxes/drafts.create
14503
+ paths:
14504
+ /v0/inboxes/{inbox_id}/drafts:
14505
+ post:
14506
+ operationId: create
14507
+ summary: Create Draft
14508
+ tags:
14509
+ - - subpackage_inboxes
14510
+ - subpackage_inboxes/drafts
14511
+ parameters:
14512
+ - name: inbox_id
14513
+ in: path
14514
+ required: true
14515
+ schema:
14516
+ $ref: '#/components/schemas/type_inboxes:InboxId'
14517
+ - name: Authorization
14518
+ in: header
14519
+ description: >-
14520
+ Bearer authentication of the form `Bearer <token>`, where token is
14521
+ your auth token.
14522
+ required: true
14523
+ schema:
14524
+ type: string
14525
+ responses:
14526
+ '200':
14527
+ description: Response with status 200
14528
+ content:
14529
+ application/json:
14530
+ schema:
14531
+ $ref: '#/components/schemas/type_drafts:Draft'
14532
+ '404':
14533
+ description: Error response with status 404
14534
+ content: {}
14535
+ requestBody:
14536
+ content:
14537
+ application/json:
14538
+ schema:
14539
+ $ref: '#/components/schemas/type_drafts:CreateDraftRequest'
14540
+ components:
14541
+ schemas:
14542
+ type_inboxes:InboxId:
14543
+ type: string
14544
+ type_drafts:DraftLabels:
14545
+ type: array
14546
+ items:
14547
+ type: string
14548
+ type_drafts:DraftReplyTo:
14549
+ type: array
14550
+ items:
14551
+ type: string
14552
+ type_drafts:DraftTo:
14553
+ type: array
14554
+ items:
14555
+ type: string
14556
+ type_drafts:DraftCc:
14557
+ type: array
14558
+ items:
14559
+ type: string
14560
+ type_drafts:DraftBcc:
14561
+ type: array
14562
+ items:
14563
+ type: string
14564
+ type_drafts:DraftSubject:
14565
+ type: string
14566
+ type_drafts:DraftText:
14567
+ type: string
14568
+ type_drafts:DraftHtml:
14569
+ type: string
14570
+ type_attachments:AttachmentFilename:
14571
+ type: string
14572
+ type_attachments:AttachmentContentType:
14573
+ type: string
14574
+ type_attachments:AttachmentContentDisposition:
14575
+ type: string
14576
+ enum:
14577
+ - value: inline
14578
+ - value: attachment
14579
+ type_attachments:AttachmentContentId:
14580
+ type: string
14581
+ type_attachments:SendAttachment:
14582
+ type: object
14583
+ properties:
14584
+ filename:
14585
+ $ref: '#/components/schemas/type_attachments:AttachmentFilename'
14586
+ content_type:
14587
+ $ref: '#/components/schemas/type_attachments:AttachmentContentType'
14588
+ content_disposition:
14589
+ $ref: '#/components/schemas/type_attachments:AttachmentContentDisposition'
14590
+ content_id:
14591
+ $ref: '#/components/schemas/type_attachments:AttachmentContentId'
14592
+ content:
14593
+ type: string
14594
+ description: Base64 encoded content of attachment.
14595
+ url:
14596
+ type: string
14597
+ description: URL to the attachment.
14598
+ type_drafts:DraftInReplyTo:
14599
+ type: string
14600
+ type_drafts:DraftSendAt:
14601
+ type: string
14602
+ format: date-time
14603
+ type_drafts:DraftClientId:
14604
+ type: string
14605
+ type_drafts:CreateDraftRequest:
14606
+ type: object
14607
+ properties:
14608
+ labels:
14609
+ $ref: '#/components/schemas/type_drafts:DraftLabels'
14610
+ reply_to:
14611
+ $ref: '#/components/schemas/type_drafts:DraftReplyTo'
14612
+ to:
14613
+ $ref: '#/components/schemas/type_drafts:DraftTo'
14614
+ cc:
14615
+ $ref: '#/components/schemas/type_drafts:DraftCc'
14616
+ bcc:
14617
+ $ref: '#/components/schemas/type_drafts:DraftBcc'
14618
+ subject:
14619
+ $ref: '#/components/schemas/type_drafts:DraftSubject'
14620
+ text:
14621
+ $ref: '#/components/schemas/type_drafts:DraftText'
14622
+ html:
14623
+ $ref: '#/components/schemas/type_drafts:DraftHtml'
14624
+ attachments:
14625
+ type: array
14626
+ items:
14627
+ $ref: '#/components/schemas/type_attachments:SendAttachment'
14628
+ description: Attachments to include in draft.
14629
+ in_reply_to:
14630
+ $ref: '#/components/schemas/type_drafts:DraftInReplyTo'
14631
+ send_at:
14632
+ $ref: '#/components/schemas/type_drafts:DraftSendAt'
14633
+ client_id:
14634
+ $ref: '#/components/schemas/type_drafts:DraftClientId'
14635
+ type_threads:ThreadId:
14636
+ type: string
14637
+ type_drafts:DraftId:
14638
+ type: string
14639
+ type_drafts:DraftPreview:
14640
+ type: string
14641
+ type_attachments:AttachmentId:
14642
+ type: string
14643
+ type_attachments:AttachmentSize:
14644
+ type: integer
14645
+ type_attachments:Attachment:
14646
+ type: object
14647
+ properties:
14648
+ attachment_id:
14649
+ $ref: '#/components/schemas/type_attachments:AttachmentId'
14650
+ filename:
14651
+ $ref: '#/components/schemas/type_attachments:AttachmentFilename'
14652
+ size:
14653
+ $ref: '#/components/schemas/type_attachments:AttachmentSize'
14654
+ content_type:
14655
+ $ref: '#/components/schemas/type_attachments:AttachmentContentType'
14656
+ content_disposition:
14657
+ $ref: '#/components/schemas/type_attachments:AttachmentContentDisposition'
14658
+ content_id:
14659
+ $ref: '#/components/schemas/type_attachments:AttachmentContentId'
14660
+ required:
14661
+ - attachment_id
14662
+ - size
14663
+ type_drafts:DraftAttachments:
14664
+ type: array
14665
+ items:
14666
+ $ref: '#/components/schemas/type_attachments:Attachment'
14667
+ type_drafts:DraftSendStatus:
14668
+ type: string
14669
+ enum:
14670
+ - value: scheduled
14671
+ - value: sending
14672
+ - value: failed
14673
+ type_drafts:DraftUpdatedAt:
14674
+ type: string
14675
+ format: date-time
14676
+ type_drafts:Draft:
14677
+ type: object
14678
+ properties:
14679
+ inbox_id:
14680
+ $ref: '#/components/schemas/type_inboxes:InboxId'
14681
+ thread_id:
14682
+ $ref: '#/components/schemas/type_threads:ThreadId'
14683
+ draft_id:
14684
+ $ref: '#/components/schemas/type_drafts:DraftId'
14685
+ client_id:
14686
+ $ref: '#/components/schemas/type_drafts:DraftClientId'
14687
+ labels:
14688
+ $ref: '#/components/schemas/type_drafts:DraftLabels'
14689
+ reply_to:
14690
+ $ref: '#/components/schemas/type_drafts:DraftReplyTo'
14691
+ to:
14692
+ $ref: '#/components/schemas/type_drafts:DraftTo'
14693
+ cc:
14694
+ $ref: '#/components/schemas/type_drafts:DraftCc'
14695
+ bcc:
14696
+ $ref: '#/components/schemas/type_drafts:DraftBcc'
14697
+ subject:
14698
+ $ref: '#/components/schemas/type_drafts:DraftSubject'
14699
+ preview:
14700
+ $ref: '#/components/schemas/type_drafts:DraftPreview'
14701
+ text:
14702
+ $ref: '#/components/schemas/type_drafts:DraftText'
14703
+ html:
14704
+ $ref: '#/components/schemas/type_drafts:DraftHtml'
14705
+ attachments:
14706
+ $ref: '#/components/schemas/type_drafts:DraftAttachments'
14707
+ in_reply_to:
14708
+ $ref: '#/components/schemas/type_drafts:DraftInReplyTo'
14709
+ references:
14710
+ type: array
14711
+ items:
14712
+ type: string
14713
+ description: IDs of previous messages in thread.
14714
+ send_status:
14715
+ $ref: '#/components/schemas/type_drafts:DraftSendStatus'
14716
+ send_at:
14717
+ $ref: '#/components/schemas/type_drafts:DraftSendAt'
14718
+ updated_at:
14719
+ $ref: '#/components/schemas/type_drafts:DraftUpdatedAt'
14720
+ created_at:
14721
+ type: string
14722
+ format: date-time
14723
+ description: Time at which draft was created.
14724
+ required:
14725
+ - inbox_id
14726
+ - thread_id
14727
+ - draft_id
14728
+ - labels
14729
+ - updated_at
14730
+ - created_at
14731
+
14732
+ ```
14733
+
14734
+ ## SDK Code Examples
14735
+
14736
+ ```typescript
14737
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
14738
+
14739
+ async function main() {
14740
+ const client = new AgentMailClient({
14741
+ environment: AgentMailEnvironment.Production,
14742
+ apiKey: "YOUR_TOKEN_HERE",
14743
+ });
14744
+ await client.inboxes.drafts.create("inbox_id", {});
14745
+ }
14746
+ main();
14747
+
14748
+ ```
14749
+
14750
+ ```python
14751
+ from agentmail import AgentMail
14752
+ from agentmail.environment import AgentMailEnvironment
14753
+
14754
+ client = AgentMail(
14755
+ environment=AgentMailEnvironment.PRODUCTION,
14756
+ api_key="YOUR_TOKEN_HERE"
14757
+ )
14758
+
14759
+ client.inboxes.drafts.create(
14760
+ inbox_id="inbox_id"
14761
+ )
14762
+
14763
+ ```
14764
+
14765
+ ```go
14766
+ package main
14767
+
14768
+ import (
14769
+ "fmt"
14770
+ "strings"
14771
+ "net/http"
14772
+ "io"
14773
+ )
14774
+
14775
+ func main() {
14776
+
14777
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/drafts"
14778
+
14779
+ payload := strings.NewReader("{}")
14780
+
14781
+ req, _ := http.NewRequest("POST", url, payload)
14782
+
14783
+ req.Header.Add("Authorization", "Bearer <api_key>")
14784
+ req.Header.Add("Content-Type", "application/json")
14341
14785
 
14342
14786
  res, _ := http.DefaultClient.Do(req)
14343
14787
 
@@ -14657,11 +15101,11 @@ components:
14657
15101
  ## SDK Code Examples
14658
15102
 
14659
15103
  ```typescript
14660
- import { AgentMailClient } from "agentmail";
15104
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
14661
15105
 
14662
15106
  async function main() {
14663
15107
  const client = new AgentMailClient({
14664
- environment: "https://api.agentmail.to",
15108
+ environment: AgentMailEnvironment.Production,
14665
15109
  apiKey: "YOUR_TOKEN_HERE",
14666
15110
  });
14667
15111
  await client.inboxes.drafts.update("inbox_id", "draft_id", {});
@@ -14672,9 +15116,10 @@ main();
14672
15116
 
14673
15117
  ```python
14674
15118
  from agentmail import AgentMail
15119
+ from agentmail.environment import AgentMailEnvironment
14675
15120
 
14676
15121
  client = AgentMail(
14677
- base_url="https://api.agentmail.to",
15122
+ environment=AgentMailEnvironment.PRODUCTION,
14678
15123
  api_key="YOUR_TOKEN_HERE"
14679
15124
  )
14680
15125
 
@@ -14900,11 +15345,11 @@ components:
14900
15345
  ## SDK Code Examples
14901
15346
 
14902
15347
  ```typescript
14903
- import { AgentMailClient } from "agentmail";
15348
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
14904
15349
 
14905
15350
  async function main() {
14906
15351
  const client = new AgentMailClient({
14907
- environment: "https://api.agentmail.to",
15352
+ environment: AgentMailEnvironment.Production,
14908
15353
  apiKey: "YOUR_TOKEN_HERE",
14909
15354
  });
14910
15355
  await client.inboxes.drafts.send("inbox_id", "draft_id", {});
@@ -14915,9 +15360,10 @@ main();
14915
15360
 
14916
15361
  ```python
14917
15362
  from agentmail import AgentMail
15363
+ from agentmail.environment import AgentMailEnvironment
14918
15364
 
14919
15365
  client = AgentMail(
14920
- base_url="https://api.agentmail.to",
15366
+ environment=AgentMailEnvironment.PRODUCTION,
14921
15367
  api_key="YOUR_TOKEN_HERE"
14922
15368
  )
14923
15369
 
@@ -15100,11 +15546,11 @@ components:
15100
15546
  ## SDK Code Examples
15101
15547
 
15102
15548
  ```typescript
15103
- import { AgentMailClient } from "agentmail";
15549
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
15104
15550
 
15105
15551
  async function main() {
15106
15552
  const client = new AgentMailClient({
15107
- environment: "https://api.agentmail.to",
15553
+ environment: AgentMailEnvironment.Production,
15108
15554
  apiKey: "YOUR_TOKEN_HERE",
15109
15555
  });
15110
15556
  await client.inboxes.drafts.delete("inbox_id", "draft_id");
@@ -15115,9 +15561,10 @@ main();
15115
15561
 
15116
15562
  ```python
15117
15563
  from agentmail import AgentMail
15564
+ from agentmail.environment import AgentMailEnvironment
15118
15565
 
15119
15566
  client = AgentMail(
15120
- base_url="https://api.agentmail.to",
15567
+ environment=AgentMailEnvironment.PRODUCTION,
15121
15568
  api_key="YOUR_TOKEN_HERE"
15122
15569
  )
15123
15570
 
@@ -15363,11 +15810,11 @@ components:
15363
15810
  ## SDK Code Examples
15364
15811
 
15365
15812
  ```typescript
15366
- import { AgentMailClient } from "agentmail";
15813
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
15367
15814
 
15368
15815
  async function main() {
15369
15816
  const client = new AgentMailClient({
15370
- environment: "https://api.agentmail.to",
15817
+ environment: AgentMailEnvironment.Production,
15371
15818
  apiKey: "YOUR_TOKEN_HERE",
15372
15819
  });
15373
15820
  await client.inboxes.metrics.get("inbox_id", {
@@ -15381,10 +15828,11 @@ main();
15381
15828
 
15382
15829
  ```python
15383
15830
  from agentmail import AgentMail
15831
+ from agentmail.environment import AgentMailEnvironment
15384
15832
  from datetime import datetime
15385
15833
 
15386
15834
  client = AgentMail(
15387
- base_url="https://api.agentmail.to",
15835
+ environment=AgentMailEnvironment.PRODUCTION,
15388
15836
  api_key="YOUR_TOKEN_HERE"
15389
15837
  )
15390
15838
 
@@ -15754,11 +16202,11 @@ components:
15754
16202
  ## SDK Code Examples
15755
16203
 
15756
16204
  ```typescript
15757
- import { AgentMailClient } from "agentmail";
16205
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
15758
16206
 
15759
16207
  async function main() {
15760
16208
  const client = new AgentMailClient({
15761
- environment: "https://api.agentmail.to",
16209
+ environment: AgentMailEnvironment.Production,
15762
16210
  apiKey: "YOUR_TOKEN_HERE",
15763
16211
  });
15764
16212
  await client.threads.list({});
@@ -15769,9 +16217,10 @@ main();
15769
16217
 
15770
16218
  ```python
15771
16219
  from agentmail import AgentMail
16220
+ from agentmail.environment import AgentMailEnvironment
15772
16221
 
15773
16222
  client = AgentMail(
15774
- base_url="https://api.agentmail.to",
16223
+ environment=AgentMailEnvironment.PRODUCTION,
15775
16224
  api_key="YOUR_TOKEN_HERE"
15776
16225
  )
15777
16226
 
@@ -16196,11 +16645,11 @@ components:
16196
16645
  ## SDK Code Examples
16197
16646
 
16198
16647
  ```typescript
16199
- import { AgentMailClient } from "agentmail";
16648
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
16200
16649
 
16201
16650
  async function main() {
16202
16651
  const client = new AgentMailClient({
16203
- environment: "https://api.agentmail.to",
16652
+ environment: AgentMailEnvironment.Production,
16204
16653
  apiKey: "YOUR_TOKEN_HERE",
16205
16654
  });
16206
16655
  await client.threads.get("thread_id");
@@ -16211,9 +16660,10 @@ main();
16211
16660
 
16212
16661
  ```python
16213
16662
  from agentmail import AgentMail
16663
+ from agentmail.environment import AgentMailEnvironment
16214
16664
 
16215
16665
  client = AgentMail(
16216
- base_url="https://api.agentmail.to",
16666
+ environment=AgentMailEnvironment.PRODUCTION,
16217
16667
  api_key="YOUR_TOKEN_HERE"
16218
16668
  )
16219
16669
 
@@ -16419,11 +16869,11 @@ components:
16419
16869
  ## SDK Code Examples
16420
16870
 
16421
16871
  ```typescript
16422
- import { AgentMailClient } from "agentmail";
16872
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
16423
16873
 
16424
16874
  async function main() {
16425
16875
  const client = new AgentMailClient({
16426
- environment: "https://api.agentmail.to",
16876
+ environment: AgentMailEnvironment.Production,
16427
16877
  apiKey: "YOUR_TOKEN_HERE",
16428
16878
  });
16429
16879
  await client.threads.getAttachment("thread_id", "attachment_id");
@@ -16434,9 +16884,10 @@ main();
16434
16884
 
16435
16885
  ```python
16436
16886
  from agentmail import AgentMail
16887
+ from agentmail.environment import AgentMailEnvironment
16437
16888
 
16438
16889
  client = AgentMail(
16439
- base_url="https://api.agentmail.to",
16890
+ environment=AgentMailEnvironment.PRODUCTION,
16440
16891
  api_key="YOUR_TOKEN_HERE"
16441
16892
  )
16442
16893
 
@@ -16764,11 +17215,11 @@ components:
16764
17215
  ## SDK Code Examples
16765
17216
 
16766
17217
  ```typescript
16767
- import { AgentMailClient } from "agentmail";
17218
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
16768
17219
 
16769
17220
  async function main() {
16770
17221
  const client = new AgentMailClient({
16771
- environment: "https://api.agentmail.to",
17222
+ environment: AgentMailEnvironment.Production,
16772
17223
  apiKey: "YOUR_TOKEN_HERE",
16773
17224
  });
16774
17225
  await client.drafts.list({});
@@ -16779,9 +17230,10 @@ main();
16779
17230
 
16780
17231
  ```python
16781
17232
  from agentmail import AgentMail
17233
+ from agentmail.environment import AgentMailEnvironment
16782
17234
 
16783
17235
  client = AgentMail(
16784
- base_url="https://api.agentmail.to",
17236
+ environment=AgentMailEnvironment.PRODUCTION,
16785
17237
  api_key="YOUR_TOKEN_HERE"
16786
17238
  )
16787
17239
 
@@ -17064,28 +17516,252 @@ components:
17064
17516
  created_at:
17065
17517
  type: string
17066
17518
  format: date-time
17067
- description: Time at which draft was created.
17519
+ description: Time at which draft was created.
17520
+ required:
17521
+ - inbox_id
17522
+ - thread_id
17523
+ - draft_id
17524
+ - labels
17525
+ - updated_at
17526
+ - created_at
17527
+
17528
+ ```
17529
+
17530
+ ## SDK Code Examples
17531
+
17532
+ ```typescript
17533
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
17534
+
17535
+ async function main() {
17536
+ const client = new AgentMailClient({
17537
+ environment: AgentMailEnvironment.Production,
17538
+ apiKey: "YOUR_TOKEN_HERE",
17539
+ });
17540
+ await client.drafts.get("draft_id");
17541
+ }
17542
+ main();
17543
+
17544
+ ```
17545
+
17546
+ ```python
17547
+ from agentmail import AgentMail
17548
+ from agentmail.environment import AgentMailEnvironment
17549
+
17550
+ client = AgentMail(
17551
+ environment=AgentMailEnvironment.PRODUCTION,
17552
+ api_key="YOUR_TOKEN_HERE"
17553
+ )
17554
+
17555
+ client.drafts.get(
17556
+ draft_id="draft_id"
17557
+ )
17558
+
17559
+ ```
17560
+
17561
+ ```go
17562
+ package main
17563
+
17564
+ import (
17565
+ "fmt"
17566
+ "net/http"
17567
+ "io"
17568
+ )
17569
+
17570
+ func main() {
17571
+
17572
+ url := "https://api.agentmail.to/v0/drafts/draft_id"
17573
+
17574
+ req, _ := http.NewRequest("GET", url, nil)
17575
+
17576
+ req.Header.Add("Authorization", "Bearer <api_key>")
17577
+
17578
+ res, _ := http.DefaultClient.Do(req)
17579
+
17580
+ defer res.Body.Close()
17581
+ body, _ := io.ReadAll(res.Body)
17582
+
17583
+ fmt.Println(res)
17584
+ fmt.Println(string(body))
17585
+
17586
+ }
17587
+ ```
17588
+
17589
+ ```ruby
17590
+ require 'uri'
17591
+ require 'net/http'
17592
+
17593
+ url = URI("https://api.agentmail.to/v0/drafts/draft_id")
17594
+
17595
+ http = Net::HTTP.new(url.host, url.port)
17596
+ http.use_ssl = true
17597
+
17598
+ request = Net::HTTP::Get.new(url)
17599
+ request["Authorization"] = 'Bearer <api_key>'
17600
+
17601
+ response = http.request(request)
17602
+ puts response.read_body
17603
+ ```
17604
+
17605
+ ```java
17606
+ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/drafts/draft_id")
17607
+ .header("Authorization", "Bearer <api_key>")
17608
+ .asString();
17609
+ ```
17610
+
17611
+ ```php
17612
+ <?php
17613
+
17614
+ $client = new \GuzzleHttp\Client();
17615
+
17616
+ $response = $client->request('GET', 'https://api.agentmail.to/v0/drafts/draft_id', [
17617
+ 'headers' => [
17618
+ 'Authorization' => 'Bearer <api_key>',
17619
+ ],
17620
+ ]);
17621
+
17622
+ echo $response->getBody();
17623
+ ```
17624
+
17625
+ ```csharp
17626
+ var client = new RestClient("https://api.agentmail.to/v0/drafts/draft_id");
17627
+ var request = new RestRequest(Method.GET);
17628
+ request.AddHeader("Authorization", "Bearer <api_key>");
17629
+ IRestResponse response = client.Execute(request);
17630
+ ```
17631
+
17632
+ ```swift
17633
+ import Foundation
17634
+
17635
+ let headers = ["Authorization": "Bearer <api_key>"]
17636
+
17637
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/drafts/draft_id")! as URL,
17638
+ cachePolicy: .useProtocolCachePolicy,
17639
+ timeoutInterval: 10.0)
17640
+ request.httpMethod = "GET"
17641
+ request.allHTTPHeaderFields = headers
17642
+
17643
+ let session = URLSession.shared
17644
+ let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
17645
+ if (error != nil) {
17646
+ print(error as Any)
17647
+ } else {
17648
+ let httpResponse = response as? HTTPURLResponse
17649
+ print(httpResponse)
17650
+ }
17651
+ })
17652
+
17653
+ dataTask.resume()
17654
+ ```
17655
+
17656
+ # Get Attachment
17657
+
17658
+ GET https://api.agentmail.to/v0/drafts/{draft_id}/attachments/{attachment_id}
17659
+
17660
+ Reference: https://docs.agentmail.to/api-reference/drafts/get-attachment
17661
+
17662
+ ## OpenAPI Specification
17663
+
17664
+ ```yaml
17665
+ openapi: 3.1.1
17666
+ info:
17667
+ title: Get Attachment
17668
+ version: endpoint_drafts.getAttachment
17669
+ paths:
17670
+ /v0/drafts/{draft_id}/attachments/{attachment_id}:
17671
+ get:
17672
+ operationId: get-attachment
17673
+ summary: Get Attachment
17674
+ tags:
17675
+ - - subpackage_drafts
17676
+ parameters:
17677
+ - name: draft_id
17678
+ in: path
17679
+ required: true
17680
+ schema:
17681
+ $ref: '#/components/schemas/type_drafts:DraftId'
17682
+ - name: attachment_id
17683
+ in: path
17684
+ required: true
17685
+ schema:
17686
+ $ref: '#/components/schemas/type_attachments:AttachmentId'
17687
+ - name: Authorization
17688
+ in: header
17689
+ description: >-
17690
+ Bearer authentication of the form `Bearer <token>`, where token is
17691
+ your auth token.
17692
+ required: true
17693
+ schema:
17694
+ type: string
17695
+ responses:
17696
+ '200':
17697
+ description: Response with status 200
17698
+ content:
17699
+ application/json:
17700
+ schema:
17701
+ $ref: '#/components/schemas/type_attachments:AttachmentResponse'
17702
+ '404':
17703
+ description: Error response with status 404
17704
+ content: {}
17705
+ components:
17706
+ schemas:
17707
+ type_drafts:DraftId:
17708
+ type: string
17709
+ type_attachments:AttachmentId:
17710
+ type: string
17711
+ type_attachments:AttachmentFilename:
17712
+ type: string
17713
+ type_attachments:AttachmentSize:
17714
+ type: integer
17715
+ type_attachments:AttachmentContentType:
17716
+ type: string
17717
+ type_attachments:AttachmentContentDisposition:
17718
+ type: string
17719
+ enum:
17720
+ - value: inline
17721
+ - value: attachment
17722
+ type_attachments:AttachmentContentId:
17723
+ type: string
17724
+ type_attachments:AttachmentResponse:
17725
+ type: object
17726
+ properties:
17727
+ attachment_id:
17728
+ $ref: '#/components/schemas/type_attachments:AttachmentId'
17729
+ filename:
17730
+ $ref: '#/components/schemas/type_attachments:AttachmentFilename'
17731
+ size:
17732
+ $ref: '#/components/schemas/type_attachments:AttachmentSize'
17733
+ content_type:
17734
+ $ref: '#/components/schemas/type_attachments:AttachmentContentType'
17735
+ content_disposition:
17736
+ $ref: '#/components/schemas/type_attachments:AttachmentContentDisposition'
17737
+ content_id:
17738
+ $ref: '#/components/schemas/type_attachments:AttachmentContentId'
17739
+ download_url:
17740
+ type: string
17741
+ description: URL to download the attachment.
17742
+ expires_at:
17743
+ type: string
17744
+ format: date-time
17745
+ description: Time at which the download URL expires.
17068
17746
  required:
17069
- - inbox_id
17070
- - thread_id
17071
- - draft_id
17072
- - labels
17073
- - updated_at
17074
- - created_at
17747
+ - attachment_id
17748
+ - size
17749
+ - download_url
17750
+ - expires_at
17075
17751
 
17076
17752
  ```
17077
17753
 
17078
17754
  ## SDK Code Examples
17079
17755
 
17080
17756
  ```typescript
17081
- import { AgentMailClient } from "agentmail";
17757
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
17082
17758
 
17083
17759
  async function main() {
17084
17760
  const client = new AgentMailClient({
17085
- environment: "https://api.agentmail.to",
17761
+ environment: AgentMailEnvironment.Production,
17086
17762
  apiKey: "YOUR_TOKEN_HERE",
17087
17763
  });
17088
- await client.drafts.get("draft_id");
17764
+ await client.drafts.getAttachment("draft_id", "attachment_id");
17089
17765
  }
17090
17766
  main();
17091
17767
 
@@ -17093,14 +17769,16 @@ main();
17093
17769
 
17094
17770
  ```python
17095
17771
  from agentmail import AgentMail
17772
+ from agentmail.environment import AgentMailEnvironment
17096
17773
 
17097
17774
  client = AgentMail(
17098
- base_url="https://api.agentmail.to",
17775
+ environment=AgentMailEnvironment.PRODUCTION,
17099
17776
  api_key="YOUR_TOKEN_HERE"
17100
17777
  )
17101
17778
 
17102
- client.drafts.get(
17103
- draft_id="draft_id"
17779
+ client.drafts.get_attachment(
17780
+ draft_id="draft_id",
17781
+ attachment_id="attachment_id"
17104
17782
  )
17105
17783
 
17106
17784
  ```
@@ -17116,7 +17794,7 @@ import (
17116
17794
 
17117
17795
  func main() {
17118
17796
 
17119
- url := "https://api.agentmail.to/v0/drafts/draft_id"
17797
+ url := "https://api.agentmail.to/v0/drafts/draft_id/attachments/attachment_id"
17120
17798
 
17121
17799
  req, _ := http.NewRequest("GET", url, nil)
17122
17800
 
@@ -17137,7 +17815,7 @@ func main() {
17137
17815
  require 'uri'
17138
17816
  require 'net/http'
17139
17817
 
17140
- url = URI("https://api.agentmail.to/v0/drafts/draft_id")
17818
+ url = URI("https://api.agentmail.to/v0/drafts/draft_id/attachments/attachment_id")
17141
17819
 
17142
17820
  http = Net::HTTP.new(url.host, url.port)
17143
17821
  http.use_ssl = true
@@ -17150,7 +17828,7 @@ puts response.read_body
17150
17828
  ```
17151
17829
 
17152
17830
  ```java
17153
- HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/drafts/draft_id")
17831
+ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/drafts/draft_id/attachments/attachment_id")
17154
17832
  .header("Authorization", "Bearer <api_key>")
17155
17833
  .asString();
17156
17834
  ```
@@ -17160,7 +17838,7 @@ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/drafts/
17160
17838
 
17161
17839
  $client = new \GuzzleHttp\Client();
17162
17840
 
17163
- $response = $client->request('GET', 'https://api.agentmail.to/v0/drafts/draft_id', [
17841
+ $response = $client->request('GET', 'https://api.agentmail.to/v0/drafts/draft_id/attachments/attachment_id', [
17164
17842
  'headers' => [
17165
17843
  'Authorization' => 'Bearer <api_key>',
17166
17844
  ],
@@ -17170,7 +17848,7 @@ echo $response->getBody();
17170
17848
  ```
17171
17849
 
17172
17850
  ```csharp
17173
- var client = new RestClient("https://api.agentmail.to/v0/drafts/draft_id");
17851
+ var client = new RestClient("https://api.agentmail.to/v0/drafts/draft_id/attachments/attachment_id");
17174
17852
  var request = new RestRequest(Method.GET);
17175
17853
  request.AddHeader("Authorization", "Bearer <api_key>");
17176
17854
  IRestResponse response = client.Execute(request);
@@ -17181,7 +17859,7 @@ import Foundation
17181
17859
 
17182
17860
  let headers = ["Authorization": "Bearer <api_key>"]
17183
17861
 
17184
- let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/drafts/draft_id")! as URL,
17862
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/drafts/draft_id/attachments/attachment_id")! as URL,
17185
17863
  cachePolicy: .useProtocolCachePolicy,
17186
17864
  timeoutInterval: 10.0)
17187
17865
  request.httpMethod = "GET"
@@ -17309,11 +17987,11 @@ components:
17309
17987
  ## SDK Code Examples
17310
17988
 
17311
17989
  ```typescript
17312
- import { AgentMailClient } from "agentmail";
17990
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
17313
17991
 
17314
17992
  async function main() {
17315
17993
  const client = new AgentMailClient({
17316
- environment: "https://api.agentmail.to",
17994
+ environment: AgentMailEnvironment.Production,
17317
17995
  apiKey: "YOUR_TOKEN_HERE",
17318
17996
  });
17319
17997
  await client.domains.list({});
@@ -17324,9 +18002,10 @@ main();
17324
18002
 
17325
18003
  ```python
17326
18004
  from agentmail import AgentMail
18005
+ from agentmail.environment import AgentMailEnvironment
17327
18006
 
17328
18007
  client = AgentMail(
17329
- base_url="https://api.agentmail.to",
18008
+ environment=AgentMailEnvironment.PRODUCTION,
17330
18009
  api_key="YOUR_TOKEN_HERE"
17331
18010
  )
17332
18011
 
@@ -17586,11 +18265,11 @@ components:
17586
18265
  ## SDK Code Examples
17587
18266
 
17588
18267
  ```typescript
17589
- import { AgentMailClient } from "agentmail";
18268
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
17590
18269
 
17591
18270
  async function main() {
17592
18271
  const client = new AgentMailClient({
17593
- environment: "https://api.agentmail.to",
18272
+ environment: AgentMailEnvironment.Production,
17594
18273
  apiKey: "YOUR_TOKEN_HERE",
17595
18274
  });
17596
18275
  await client.domains.get("domain_id");
@@ -17601,9 +18280,10 @@ main();
17601
18280
 
17602
18281
  ```python
17603
18282
  from agentmail import AgentMail
18283
+ from agentmail.environment import AgentMailEnvironment
17604
18284
 
17605
18285
  client = AgentMail(
17606
- base_url="https://api.agentmail.to",
18286
+ environment=AgentMailEnvironment.PRODUCTION,
17607
18287
  api_key="YOUR_TOKEN_HERE"
17608
18288
  )
17609
18289
 
@@ -17763,11 +18443,11 @@ components:
17763
18443
  ## SDK Code Examples
17764
18444
 
17765
18445
  ```typescript
17766
- import { AgentMailClient } from "agentmail";
18446
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
17767
18447
 
17768
18448
  async function main() {
17769
18449
  const client = new AgentMailClient({
17770
- environment: "https://api.agentmail.to",
18450
+ environment: AgentMailEnvironment.Production,
17771
18451
  apiKey: "YOUR_TOKEN_HERE",
17772
18452
  });
17773
18453
  await client.domains.getZoneFile(":domain_id");
@@ -17778,9 +18458,10 @@ main();
17778
18458
 
17779
18459
  ```python
17780
18460
  from agentmail import AgentMail
18461
+ from agentmail.environment import AgentMailEnvironment
17781
18462
 
17782
18463
  client = AgentMail(
17783
- base_url="https://api.agentmail.to",
18464
+ environment=AgentMailEnvironment.PRODUCTION,
17784
18465
  api_key="YOUR_TOKEN_HERE"
17785
18466
  )
17786
18467
 
@@ -18036,11 +18717,11 @@ components:
18036
18717
  ## SDK Code Examples
18037
18718
 
18038
18719
  ```typescript
18039
- import { AgentMailClient } from "agentmail";
18720
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
18040
18721
 
18041
18722
  async function main() {
18042
18723
  const client = new AgentMailClient({
18043
- environment: "https://api.agentmail.to",
18724
+ environment: AgentMailEnvironment.Production,
18044
18725
  apiKey: "YOUR_TOKEN_HERE",
18045
18726
  });
18046
18727
  await client.domains.create({
@@ -18054,9 +18735,10 @@ main();
18054
18735
 
18055
18736
  ```python
18056
18737
  from agentmail import AgentMail
18738
+ from agentmail.environment import AgentMailEnvironment
18057
18739
 
18058
18740
  client = AgentMail(
18059
- base_url="https://api.agentmail.to",
18741
+ environment=AgentMailEnvironment.PRODUCTION,
18060
18742
  api_key="YOUR_TOKEN_HERE"
18061
18743
  )
18062
18744
 
@@ -18237,11 +18919,11 @@ components:
18237
18919
  ## SDK Code Examples
18238
18920
 
18239
18921
  ```typescript
18240
- import { AgentMailClient } from "agentmail";
18922
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
18241
18923
 
18242
18924
  async function main() {
18243
18925
  const client = new AgentMailClient({
18244
- environment: "https://api.agentmail.to",
18926
+ environment: AgentMailEnvironment.Production,
18245
18927
  apiKey: "YOUR_TOKEN_HERE",
18246
18928
  });
18247
18929
  await client.domains.delete("domain_id");
@@ -18252,9 +18934,10 @@ main();
18252
18934
 
18253
18935
  ```python
18254
18936
  from agentmail import AgentMail
18937
+ from agentmail.environment import AgentMailEnvironment
18255
18938
 
18256
18939
  client = AgentMail(
18257
- base_url="https://api.agentmail.to",
18940
+ environment=AgentMailEnvironment.PRODUCTION,
18258
18941
  api_key="YOUR_TOKEN_HERE"
18259
18942
  )
18260
18943
 
@@ -18409,11 +19092,11 @@ components:
18409
19092
  ## SDK Code Examples
18410
19093
 
18411
19094
  ```typescript
18412
- import { AgentMailClient } from "agentmail";
19095
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
18413
19096
 
18414
19097
  async function main() {
18415
19098
  const client = new AgentMailClient({
18416
- environment: "https://api.agentmail.to",
19099
+ environment: AgentMailEnvironment.Production,
18417
19100
  apiKey: "YOUR_TOKEN_HERE",
18418
19101
  });
18419
19102
  await client.domains.verify("domain_id");
@@ -18424,9 +19107,10 @@ main();
18424
19107
 
18425
19108
  ```python
18426
19109
  from agentmail import AgentMail
19110
+ from agentmail.environment import AgentMailEnvironment
18427
19111
 
18428
19112
  client = AgentMail(
18429
- base_url="https://api.agentmail.to",
19113
+ environment=AgentMailEnvironment.PRODUCTION,
18430
19114
  api_key="YOUR_TOKEN_HERE"
18431
19115
  )
18432
19116
 
@@ -18672,11 +19356,11 @@ components:
18672
19356
  ## SDK Code Examples
18673
19357
 
18674
19358
  ```typescript
18675
- import { AgentMailClient } from "agentmail";
19359
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
18676
19360
 
18677
19361
  async function main() {
18678
19362
  const client = new AgentMailClient({
18679
- environment: "https://api.agentmail.to",
19363
+ environment: AgentMailEnvironment.Production,
18680
19364
  apiKey: "YOUR_TOKEN_HERE",
18681
19365
  });
18682
19366
  await client.webhooks.list({});
@@ -18687,9 +19371,10 @@ main();
18687
19371
 
18688
19372
  ```python
18689
19373
  from agentmail import AgentMail
19374
+ from agentmail.environment import AgentMailEnvironment
18690
19375
 
18691
19376
  client = AgentMail(
18692
- base_url="https://api.agentmail.to",
19377
+ environment=AgentMailEnvironment.PRODUCTION,
18693
19378
  api_key="YOUR_TOKEN_HERE"
18694
19379
  )
18695
19380
 
@@ -18908,11 +19593,11 @@ components:
18908
19593
  ## SDK Code Examples
18909
19594
 
18910
19595
  ```typescript
18911
- import { AgentMailClient } from "agentmail";
19596
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
18912
19597
 
18913
19598
  async function main() {
18914
19599
  const client = new AgentMailClient({
18915
- environment: "https://api.agentmail.to",
19600
+ environment: AgentMailEnvironment.Production,
18916
19601
  apiKey: "YOUR_TOKEN_HERE",
18917
19602
  });
18918
19603
  await client.webhooks.get("webhook_id");
@@ -18923,9 +19608,10 @@ main();
18923
19608
 
18924
19609
  ```python
18925
19610
  from agentmail import AgentMail
19611
+ from agentmail.environment import AgentMailEnvironment
18926
19612
 
18927
19613
  client = AgentMail(
18928
- base_url="https://api.agentmail.to",
19614
+ environment=AgentMailEnvironment.PRODUCTION,
18929
19615
  api_key="YOUR_TOKEN_HERE"
18930
19616
  )
18931
19617
 
@@ -19170,11 +19856,11 @@ components:
19170
19856
  ## SDK Code Examples
19171
19857
 
19172
19858
  ```typescript
19173
- import { AgentMailClient } from "agentmail";
19859
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
19174
19860
 
19175
19861
  async function main() {
19176
19862
  const client = new AgentMailClient({
19177
- environment: "https://api.agentmail.to",
19863
+ environment: AgentMailEnvironment.Production,
19178
19864
  apiKey: "YOUR_TOKEN_HERE",
19179
19865
  });
19180
19866
  await client.webhooks.update("webhook_id", {});
@@ -19185,9 +19871,10 @@ main();
19185
19871
 
19186
19872
  ```python
19187
19873
  from agentmail import AgentMail
19874
+ from agentmail.environment import AgentMailEnvironment
19188
19875
 
19189
19876
  client = AgentMail(
19190
- base_url="https://api.agentmail.to",
19877
+ environment=AgentMailEnvironment.PRODUCTION,
19191
19878
  api_key="YOUR_TOKEN_HERE"
19192
19879
  )
19193
19880
 
@@ -19444,11 +20131,11 @@ components:
19444
20131
  ## SDK Code Examples
19445
20132
 
19446
20133
  ```typescript
19447
- import { AgentMailClient } from "agentmail";
20134
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
19448
20135
 
19449
20136
  async function main() {
19450
20137
  const client = new AgentMailClient({
19451
- environment: "https://api.agentmail.to",
20138
+ environment: AgentMailEnvironment.Production,
19452
20139
  apiKey: "YOUR_TOKEN_HERE",
19453
20140
  });
19454
20141
  await client.webhooks.create({
@@ -19465,9 +20152,10 @@ main();
19465
20152
 
19466
20153
  ```python
19467
20154
  from agentmail import AgentMail
20155
+ from agentmail.environment import AgentMailEnvironment
19468
20156
 
19469
20157
  client = AgentMail(
19470
- base_url="https://api.agentmail.to",
20158
+ environment=AgentMailEnvironment.PRODUCTION,
19471
20159
  api_key="YOUR_TOKEN_HERE"
19472
20160
  )
19473
20161
 
@@ -19654,11 +20342,11 @@ components:
19654
20342
  ## SDK Code Examples
19655
20343
 
19656
20344
  ```typescript
19657
- import { AgentMailClient } from "agentmail";
20345
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
19658
20346
 
19659
20347
  async function main() {
19660
20348
  const client = new AgentMailClient({
19661
- environment: "https://api.agentmail.to",
20349
+ environment: AgentMailEnvironment.Production,
19662
20350
  apiKey: "YOUR_TOKEN_HERE",
19663
20351
  });
19664
20352
  await client.webhooks.delete("webhook_id");
@@ -19669,9 +20357,10 @@ main();
19669
20357
 
19670
20358
  ```python
19671
20359
  from agentmail import AgentMail
20360
+ from agentmail.environment import AgentMailEnvironment
19672
20361
 
19673
20362
  client = AgentMail(
19674
- base_url="https://api.agentmail.to",
20363
+ environment=AgentMailEnvironment.PRODUCTION,
19675
20364
  api_key="YOUR_TOKEN_HERE"
19676
20365
  )
19677
20366
 
@@ -21759,11 +22448,11 @@ components:
21759
22448
  ## SDK Code Examples
21760
22449
 
21761
22450
  ```typescript
21762
- import { AgentMailClient } from "agentmail";
22451
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
21763
22452
 
21764
22453
  async function main() {
21765
22454
  const client = new AgentMailClient({
21766
- environment: "https://api.agentmail.to",
22455
+ environment: AgentMailEnvironment.Production,
21767
22456
  apiKey: "YOUR_TOKEN_HERE",
21768
22457
  });
21769
22458
  await client.metrics.list({
@@ -21777,10 +22466,11 @@ main();
21777
22466
 
21778
22467
  ```python
21779
22468
  from agentmail import AgentMail
22469
+ from agentmail.environment import AgentMailEnvironment
21780
22470
  from datetime import datetime
21781
22471
 
21782
22472
  client = AgentMail(
21783
- base_url="https://api.agentmail.to",
22473
+ environment=AgentMailEnvironment.PRODUCTION,
21784
22474
  api_key="YOUR_TOKEN_HERE"
21785
22475
  )
21786
22476
 
@@ -22009,11 +22699,11 @@ components:
22009
22699
  ## SDK Code Examples
22010
22700
 
22011
22701
  ```typescript
22012
- import { AgentMailClient } from "agentmail";
22702
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
22013
22703
 
22014
22704
  async function main() {
22015
22705
  const client = new AgentMailClient({
22016
- environment: "https://api.agentmail.to",
22706
+ environment: AgentMailEnvironment.Production,
22017
22707
  apiKey: "YOUR_TOKEN_HERE",
22018
22708
  });
22019
22709
  await client.apiKeys.list({});
@@ -22024,9 +22714,10 @@ main();
22024
22714
 
22025
22715
  ```python
22026
22716
  from agentmail import AgentMail
22717
+ from agentmail.environment import AgentMailEnvironment
22027
22718
 
22028
22719
  client = AgentMail(
22029
- base_url="https://api.agentmail.to",
22720
+ environment=AgentMailEnvironment.PRODUCTION,
22030
22721
  api_key="YOUR_TOKEN_HERE"
22031
22722
  )
22032
22723
 
@@ -22237,11 +22928,11 @@ components:
22237
22928
  ## SDK Code Examples
22238
22929
 
22239
22930
  ```typescript
22240
- import { AgentMailClient } from "agentmail";
22931
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
22241
22932
 
22242
22933
  async function main() {
22243
22934
  const client = new AgentMailClient({
22244
- environment: "https://api.agentmail.to",
22935
+ environment: AgentMailEnvironment.Production,
22245
22936
  apiKey: "YOUR_TOKEN_HERE",
22246
22937
  });
22247
22938
  await client.apiKeys.create({
@@ -22254,9 +22945,10 @@ main();
22254
22945
 
22255
22946
  ```python
22256
22947
  from agentmail import AgentMail
22948
+ from agentmail.environment import AgentMailEnvironment
22257
22949
 
22258
22950
  client = AgentMail(
22259
- base_url="https://api.agentmail.to",
22951
+ environment=AgentMailEnvironment.PRODUCTION,
22260
22952
  api_key="YOUR_TOKEN_HERE"
22261
22953
  )
22262
22954
 
@@ -22432,11 +23124,11 @@ components:
22432
23124
  ## SDK Code Examples
22433
23125
 
22434
23126
  ```typescript
22435
- import { AgentMailClient } from "agentmail";
23127
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
22436
23128
 
22437
23129
  async function main() {
22438
23130
  const client = new AgentMailClient({
22439
- environment: "https://api.agentmail.to",
23131
+ environment: AgentMailEnvironment.Production,
22440
23132
  apiKey: "YOUR_TOKEN_HERE",
22441
23133
  });
22442
23134
  await client.apiKeys.delete("api_key");
@@ -22447,9 +23139,10 @@ main();
22447
23139
 
22448
23140
  ```python
22449
23141
  from agentmail import AgentMail
23142
+ from agentmail.environment import AgentMailEnvironment
22450
23143
 
22451
23144
  client = AgentMail(
22452
- base_url="https://api.agentmail.to",
23145
+ environment=AgentMailEnvironment.PRODUCTION,
22453
23146
  api_key="YOUR_TOKEN_HERE"
22454
23147
  )
22455
23148
 
@@ -22659,11 +23352,11 @@ components:
22659
23352
  ## SDK Code Examples
22660
23353
 
22661
23354
  ```typescript
22662
- import { AgentMailClient } from "agentmail";
23355
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
22663
23356
 
22664
23357
  async function main() {
22665
23358
  const client = new AgentMailClient({
22666
- environment: "https://api.agentmail.to",
23359
+ environment: AgentMailEnvironment.Production,
22667
23360
  apiKey: "YOUR_TOKEN_HERE",
22668
23361
  });
22669
23362
  await client.pods.list({});
@@ -22674,9 +23367,10 @@ main();
22674
23367
 
22675
23368
  ```python
22676
23369
  from agentmail import AgentMail
23370
+ from agentmail.environment import AgentMailEnvironment
22677
23371
 
22678
23372
  client = AgentMail(
22679
- base_url="https://api.agentmail.to",
23373
+ environment=AgentMailEnvironment.PRODUCTION,
22680
23374
  api_key="YOUR_TOKEN_HERE"
22681
23375
  )
22682
23376
 
@@ -22878,11 +23572,11 @@ components:
22878
23572
  ## SDK Code Examples
22879
23573
 
22880
23574
  ```typescript
22881
- import { AgentMailClient } from "agentmail";
23575
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
22882
23576
 
22883
23577
  async function main() {
22884
23578
  const client = new AgentMailClient({
22885
- environment: "https://api.agentmail.to",
23579
+ environment: AgentMailEnvironment.Production,
22886
23580
  apiKey: "YOUR_TOKEN_HERE",
22887
23581
  });
22888
23582
  await client.pods.get("pod_id");
@@ -22893,9 +23587,10 @@ main();
22893
23587
 
22894
23588
  ```python
22895
23589
  from agentmail import AgentMail
23590
+ from agentmail.environment import AgentMailEnvironment
22896
23591
 
22897
23592
  client = AgentMail(
22898
- base_url="https://api.agentmail.to",
23593
+ environment=AgentMailEnvironment.PRODUCTION,
22899
23594
  api_key="YOUR_TOKEN_HERE"
22900
23595
  )
22901
23596
 
@@ -23107,11 +23802,11 @@ components:
23107
23802
  ## SDK Code Examples
23108
23803
 
23109
23804
  ```typescript
23110
- import { AgentMailClient } from "agentmail";
23805
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
23111
23806
 
23112
23807
  async function main() {
23113
23808
  const client = new AgentMailClient({
23114
- environment: "https://api.agentmail.to",
23809
+ environment: AgentMailEnvironment.Production,
23115
23810
  apiKey: "YOUR_TOKEN_HERE",
23116
23811
  });
23117
23812
  await client.pods.create({});
@@ -23122,9 +23817,10 @@ main();
23122
23817
 
23123
23818
  ```python
23124
23819
  from agentmail import AgentMail
23820
+ from agentmail.environment import AgentMailEnvironment
23125
23821
 
23126
23822
  client = AgentMail(
23127
- base_url="https://api.agentmail.to",
23823
+ environment=AgentMailEnvironment.PRODUCTION,
23128
23824
  api_key="YOUR_TOKEN_HERE"
23129
23825
  )
23130
23826
 
@@ -23296,11 +23992,11 @@ components:
23296
23992
  ## SDK Code Examples
23297
23993
 
23298
23994
  ```typescript
23299
- import { AgentMailClient } from "agentmail";
23995
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
23300
23996
 
23301
23997
  async function main() {
23302
23998
  const client = new AgentMailClient({
23303
- environment: "https://api.agentmail.to",
23999
+ environment: AgentMailEnvironment.Production,
23304
24000
  apiKey: "YOUR_TOKEN_HERE",
23305
24001
  });
23306
24002
  await client.pods.delete("pod_id");
@@ -23311,9 +24007,10 @@ main();
23311
24007
 
23312
24008
  ```python
23313
24009
  from agentmail import AgentMail
24010
+ from agentmail.environment import AgentMailEnvironment
23314
24011
 
23315
24012
  client = AgentMail(
23316
- base_url="https://api.agentmail.to",
24013
+ environment=AgentMailEnvironment.PRODUCTION,
23317
24014
  api_key="YOUR_TOKEN_HERE"
23318
24015
  )
23319
24016
 
@@ -23536,11 +24233,11 @@ components:
23536
24233
  ## SDK Code Examples
23537
24234
 
23538
24235
  ```typescript
23539
- import { AgentMailClient } from "agentmail";
24236
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
23540
24237
 
23541
24238
  async function main() {
23542
24239
  const client = new AgentMailClient({
23543
- environment: "https://api.agentmail.to",
24240
+ environment: AgentMailEnvironment.Production,
23544
24241
  apiKey: "YOUR_TOKEN_HERE",
23545
24242
  });
23546
24243
  await client.pods.inboxes.list("pod_id", {});
@@ -23551,9 +24248,10 @@ main();
23551
24248
 
23552
24249
  ```python
23553
24250
  from agentmail import AgentMail
24251
+ from agentmail.environment import AgentMailEnvironment
23554
24252
 
23555
24253
  client = AgentMail(
23556
- base_url="https://api.agentmail.to",
24254
+ environment=AgentMailEnvironment.PRODUCTION,
23557
24255
  api_key="YOUR_TOKEN_HERE"
23558
24256
  )
23559
24257
 
@@ -23767,11 +24465,11 @@ components:
23767
24465
  ## SDK Code Examples
23768
24466
 
23769
24467
  ```typescript
23770
- import { AgentMailClient } from "agentmail";
24468
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
23771
24469
 
23772
24470
  async function main() {
23773
24471
  const client = new AgentMailClient({
23774
- environment: "https://api.agentmail.to",
24472
+ environment: AgentMailEnvironment.Production,
23775
24473
  apiKey: "YOUR_TOKEN_HERE",
23776
24474
  });
23777
24475
  await client.pods.inboxes.get("pod_id", "inbox_id");
@@ -23782,9 +24480,10 @@ main();
23782
24480
 
23783
24481
  ```python
23784
24482
  from agentmail import AgentMail
24483
+ from agentmail.environment import AgentMailEnvironment
23785
24484
 
23786
24485
  client = AgentMail(
23787
- base_url="https://api.agentmail.to",
24486
+ environment=AgentMailEnvironment.PRODUCTION,
23788
24487
  api_key="YOUR_TOKEN_HERE"
23789
24488
  )
23790
24489
 
@@ -24015,11 +24714,11 @@ components:
24015
24714
  ## SDK Code Examples
24016
24715
 
24017
24716
  ```typescript
24018
- import { AgentMailClient } from "agentmail";
24717
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
24019
24718
 
24020
24719
  async function main() {
24021
24720
  const client = new AgentMailClient({
24022
- environment: "https://api.agentmail.to",
24721
+ environment: AgentMailEnvironment.Production,
24023
24722
  apiKey: "YOUR_TOKEN_HERE",
24024
24723
  });
24025
24724
  await client.pods.inboxes.create("pod_id", {});
@@ -24030,9 +24729,10 @@ main();
24030
24729
 
24031
24730
  ```python
24032
24731
  from agentmail import AgentMail
24732
+ from agentmail.environment import AgentMailEnvironment
24033
24733
 
24034
24734
  client = AgentMail(
24035
- base_url="https://api.agentmail.to",
24735
+ environment=AgentMailEnvironment.PRODUCTION,
24036
24736
  api_key="YOUR_TOKEN_HERE"
24037
24737
  )
24038
24738
 
@@ -24214,11 +24914,11 @@ components:
24214
24914
  ## SDK Code Examples
24215
24915
 
24216
24916
  ```typescript
24217
- import { AgentMailClient } from "agentmail";
24917
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
24218
24918
 
24219
24919
  async function main() {
24220
24920
  const client = new AgentMailClient({
24221
- environment: "https://api.agentmail.to",
24921
+ environment: AgentMailEnvironment.Production,
24222
24922
  apiKey: "YOUR_TOKEN_HERE",
24223
24923
  });
24224
24924
  await client.pods.inboxes.delete("pod_id", "inbox_id");
@@ -24229,9 +24929,10 @@ main();
24229
24929
 
24230
24930
  ```python
24231
24931
  from agentmail import AgentMail
24932
+ from agentmail.environment import AgentMailEnvironment
24232
24933
 
24233
24934
  client = AgentMail(
24234
- base_url="https://api.agentmail.to",
24935
+ environment=AgentMailEnvironment.PRODUCTION,
24235
24936
  api_key="YOUR_TOKEN_HERE"
24236
24937
  )
24237
24938
 
@@ -24589,11 +25290,11 @@ components:
24589
25290
  ## SDK Code Examples
24590
25291
 
24591
25292
  ```typescript
24592
- import { AgentMailClient } from "agentmail";
25293
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
24593
25294
 
24594
25295
  async function main() {
24595
25296
  const client = new AgentMailClient({
24596
- environment: "https://api.agentmail.to",
25297
+ environment: AgentMailEnvironment.Production,
24597
25298
  apiKey: "YOUR_TOKEN_HERE",
24598
25299
  });
24599
25300
  await client.pods.threads.list("pod_id", {});
@@ -24604,9 +25305,10 @@ main();
24604
25305
 
24605
25306
  ```python
24606
25307
  from agentmail import AgentMail
25308
+ from agentmail.environment import AgentMailEnvironment
24607
25309
 
24608
25310
  client = AgentMail(
24609
- base_url="https://api.agentmail.to",
25311
+ environment=AgentMailEnvironment.PRODUCTION,
24610
25312
  api_key="YOUR_TOKEN_HERE"
24611
25313
  )
24612
25314
 
@@ -25041,11 +25743,11 @@ components:
25041
25743
  ## SDK Code Examples
25042
25744
 
25043
25745
  ```typescript
25044
- import { AgentMailClient } from "agentmail";
25746
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
25045
25747
 
25046
25748
  async function main() {
25047
25749
  const client = new AgentMailClient({
25048
- environment: "https://api.agentmail.to",
25750
+ environment: AgentMailEnvironment.Production,
25049
25751
  apiKey: "YOUR_TOKEN_HERE",
25050
25752
  });
25051
25753
  await client.pods.threads.get("pod_id", "thread_id");
@@ -25056,9 +25758,10 @@ main();
25056
25758
 
25057
25759
  ```python
25058
25760
  from agentmail import AgentMail
25761
+ from agentmail.environment import AgentMailEnvironment
25059
25762
 
25060
25763
  client = AgentMail(
25061
- base_url="https://api.agentmail.to",
25764
+ environment=AgentMailEnvironment.PRODUCTION,
25062
25765
  api_key="YOUR_TOKEN_HERE"
25063
25766
  )
25064
25767
 
@@ -25273,11 +25976,11 @@ components:
25273
25976
  ## SDK Code Examples
25274
25977
 
25275
25978
  ```typescript
25276
- import { AgentMailClient } from "agentmail";
25979
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
25277
25980
 
25278
25981
  async function main() {
25279
25982
  const client = new AgentMailClient({
25280
- environment: "https://api.agentmail.to",
25983
+ environment: AgentMailEnvironment.Production,
25281
25984
  apiKey: "YOUR_TOKEN_HERE",
25282
25985
  });
25283
25986
  await client.pods.threads.getAttachment("pod_id", "thread_id", "attachment_id");
@@ -25288,9 +25991,10 @@ main();
25288
25991
 
25289
25992
  ```python
25290
25993
  from agentmail import AgentMail
25994
+ from agentmail.environment import AgentMailEnvironment
25291
25995
 
25292
25996
  client = AgentMail(
25293
- base_url="https://api.agentmail.to",
25997
+ environment=AgentMailEnvironment.PRODUCTION,
25294
25998
  api_key="YOUR_TOKEN_HERE"
25295
25999
  )
25296
26000
 
@@ -25627,11 +26331,11 @@ components:
25627
26331
  ## SDK Code Examples
25628
26332
 
25629
26333
  ```typescript
25630
- import { AgentMailClient } from "agentmail";
26334
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
25631
26335
 
25632
26336
  async function main() {
25633
26337
  const client = new AgentMailClient({
25634
- environment: "https://api.agentmail.to",
26338
+ environment: AgentMailEnvironment.Production,
25635
26339
  apiKey: "YOUR_TOKEN_HERE",
25636
26340
  });
25637
26341
  await client.pods.drafts.list("pod_id", {});
@@ -25642,9 +26346,10 @@ main();
25642
26346
 
25643
26347
  ```python
25644
26348
  from agentmail import AgentMail
26349
+ from agentmail.environment import AgentMailEnvironment
25645
26350
 
25646
26351
  client = AgentMail(
25647
- base_url="https://api.agentmail.to",
26352
+ environment=AgentMailEnvironment.PRODUCTION,
25648
26353
  api_key="YOUR_TOKEN_HERE"
25649
26354
  )
25650
26355
 
@@ -25937,28 +26642,261 @@ components:
25937
26642
  created_at:
25938
26643
  type: string
25939
26644
  format: date-time
25940
- description: Time at which draft was created.
26645
+ description: Time at which draft was created.
26646
+ required:
26647
+ - inbox_id
26648
+ - thread_id
26649
+ - draft_id
26650
+ - labels
26651
+ - updated_at
26652
+ - created_at
26653
+
26654
+ ```
26655
+
26656
+ ## SDK Code Examples
26657
+
26658
+ ```typescript
26659
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
26660
+
26661
+ async function main() {
26662
+ const client = new AgentMailClient({
26663
+ environment: AgentMailEnvironment.Production,
26664
+ apiKey: "YOUR_TOKEN_HERE",
26665
+ });
26666
+ await client.pods.drafts.get("pod_id", "draft_id");
26667
+ }
26668
+ main();
26669
+
26670
+ ```
26671
+
26672
+ ```python
26673
+ from agentmail import AgentMail
26674
+ from agentmail.environment import AgentMailEnvironment
26675
+
26676
+ client = AgentMail(
26677
+ environment=AgentMailEnvironment.PRODUCTION,
26678
+ api_key="YOUR_TOKEN_HERE"
26679
+ )
26680
+
26681
+ client.pods.drafts.get(
26682
+ pod_id="pod_id",
26683
+ draft_id="draft_id"
26684
+ )
26685
+
26686
+ ```
26687
+
26688
+ ```go
26689
+ package main
26690
+
26691
+ import (
26692
+ "fmt"
26693
+ "net/http"
26694
+ "io"
26695
+ )
26696
+
26697
+ func main() {
26698
+
26699
+ url := "https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id"
26700
+
26701
+ req, _ := http.NewRequest("GET", url, nil)
26702
+
26703
+ req.Header.Add("Authorization", "Bearer <api_key>")
26704
+
26705
+ res, _ := http.DefaultClient.Do(req)
26706
+
26707
+ defer res.Body.Close()
26708
+ body, _ := io.ReadAll(res.Body)
26709
+
26710
+ fmt.Println(res)
26711
+ fmt.Println(string(body))
26712
+
26713
+ }
26714
+ ```
26715
+
26716
+ ```ruby
26717
+ require 'uri'
26718
+ require 'net/http'
26719
+
26720
+ url = URI("https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id")
26721
+
26722
+ http = Net::HTTP.new(url.host, url.port)
26723
+ http.use_ssl = true
26724
+
26725
+ request = Net::HTTP::Get.new(url)
26726
+ request["Authorization"] = 'Bearer <api_key>'
26727
+
26728
+ response = http.request(request)
26729
+ puts response.read_body
26730
+ ```
26731
+
26732
+ ```java
26733
+ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id")
26734
+ .header("Authorization", "Bearer <api_key>")
26735
+ .asString();
26736
+ ```
26737
+
26738
+ ```php
26739
+ <?php
26740
+
26741
+ $client = new \GuzzleHttp\Client();
26742
+
26743
+ $response = $client->request('GET', 'https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id', [
26744
+ 'headers' => [
26745
+ 'Authorization' => 'Bearer <api_key>',
26746
+ ],
26747
+ ]);
26748
+
26749
+ echo $response->getBody();
26750
+ ```
26751
+
26752
+ ```csharp
26753
+ var client = new RestClient("https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id");
26754
+ var request = new RestRequest(Method.GET);
26755
+ request.AddHeader("Authorization", "Bearer <api_key>");
26756
+ IRestResponse response = client.Execute(request);
26757
+ ```
26758
+
26759
+ ```swift
26760
+ import Foundation
26761
+
26762
+ let headers = ["Authorization": "Bearer <api_key>"]
26763
+
26764
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id")! as URL,
26765
+ cachePolicy: .useProtocolCachePolicy,
26766
+ timeoutInterval: 10.0)
26767
+ request.httpMethod = "GET"
26768
+ request.allHTTPHeaderFields = headers
26769
+
26770
+ let session = URLSession.shared
26771
+ let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
26772
+ if (error != nil) {
26773
+ print(error as Any)
26774
+ } else {
26775
+ let httpResponse = response as? HTTPURLResponse
26776
+ print(httpResponse)
26777
+ }
26778
+ })
26779
+
26780
+ dataTask.resume()
26781
+ ```
26782
+
26783
+ # Get Attachment
26784
+
26785
+ GET https://api.agentmail.to/v0/pods/{pod_id}/drafts/{draft_id}/attachments/{attachment_id}
26786
+
26787
+ Reference: https://docs.agentmail.to/api-reference/pods/drafts/get-attachment
26788
+
26789
+ ## OpenAPI Specification
26790
+
26791
+ ```yaml
26792
+ openapi: 3.1.1
26793
+ info:
26794
+ title: Get Attachment
26795
+ version: endpoint_pods/drafts.getAttachment
26796
+ paths:
26797
+ /v0/pods/{pod_id}/drafts/{draft_id}/attachments/{attachment_id}:
26798
+ get:
26799
+ operationId: get-attachment
26800
+ summary: Get Attachment
26801
+ tags:
26802
+ - - subpackage_pods
26803
+ - subpackage_pods/drafts
26804
+ parameters:
26805
+ - name: pod_id
26806
+ in: path
26807
+ required: true
26808
+ schema:
26809
+ $ref: '#/components/schemas/type_pods:PodId'
26810
+ - name: draft_id
26811
+ in: path
26812
+ required: true
26813
+ schema:
26814
+ $ref: '#/components/schemas/type_drafts:DraftId'
26815
+ - name: attachment_id
26816
+ in: path
26817
+ required: true
26818
+ schema:
26819
+ $ref: '#/components/schemas/type_attachments:AttachmentId'
26820
+ - name: Authorization
26821
+ in: header
26822
+ description: >-
26823
+ Bearer authentication of the form `Bearer <token>`, where token is
26824
+ your auth token.
26825
+ required: true
26826
+ schema:
26827
+ type: string
26828
+ responses:
26829
+ '200':
26830
+ description: Response with status 200
26831
+ content:
26832
+ application/json:
26833
+ schema:
26834
+ $ref: '#/components/schemas/type_attachments:AttachmentResponse'
26835
+ '404':
26836
+ description: Error response with status 404
26837
+ content: {}
26838
+ components:
26839
+ schemas:
26840
+ type_pods:PodId:
26841
+ type: string
26842
+ type_drafts:DraftId:
26843
+ type: string
26844
+ type_attachments:AttachmentId:
26845
+ type: string
26846
+ type_attachments:AttachmentFilename:
26847
+ type: string
26848
+ type_attachments:AttachmentSize:
26849
+ type: integer
26850
+ type_attachments:AttachmentContentType:
26851
+ type: string
26852
+ type_attachments:AttachmentContentDisposition:
26853
+ type: string
26854
+ enum:
26855
+ - value: inline
26856
+ - value: attachment
26857
+ type_attachments:AttachmentContentId:
26858
+ type: string
26859
+ type_attachments:AttachmentResponse:
26860
+ type: object
26861
+ properties:
26862
+ attachment_id:
26863
+ $ref: '#/components/schemas/type_attachments:AttachmentId'
26864
+ filename:
26865
+ $ref: '#/components/schemas/type_attachments:AttachmentFilename'
26866
+ size:
26867
+ $ref: '#/components/schemas/type_attachments:AttachmentSize'
26868
+ content_type:
26869
+ $ref: '#/components/schemas/type_attachments:AttachmentContentType'
26870
+ content_disposition:
26871
+ $ref: '#/components/schemas/type_attachments:AttachmentContentDisposition'
26872
+ content_id:
26873
+ $ref: '#/components/schemas/type_attachments:AttachmentContentId'
26874
+ download_url:
26875
+ type: string
26876
+ description: URL to download the attachment.
26877
+ expires_at:
26878
+ type: string
26879
+ format: date-time
26880
+ description: Time at which the download URL expires.
25941
26881
  required:
25942
- - inbox_id
25943
- - thread_id
25944
- - draft_id
25945
- - labels
25946
- - updated_at
25947
- - created_at
26882
+ - attachment_id
26883
+ - size
26884
+ - download_url
26885
+ - expires_at
25948
26886
 
25949
26887
  ```
25950
26888
 
25951
26889
  ## SDK Code Examples
25952
26890
 
25953
26891
  ```typescript
25954
- import { AgentMailClient } from "agentmail";
26892
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
25955
26893
 
25956
26894
  async function main() {
25957
26895
  const client = new AgentMailClient({
25958
- environment: "https://api.agentmail.to",
26896
+ environment: AgentMailEnvironment.Production,
25959
26897
  apiKey: "YOUR_TOKEN_HERE",
25960
26898
  });
25961
- await client.pods.drafts.get("pod_id", "draft_id");
26899
+ await client.pods.drafts.getAttachment("pod_id", "draft_id", "attachment_id");
25962
26900
  }
25963
26901
  main();
25964
26902
 
@@ -25966,15 +26904,17 @@ main();
25966
26904
 
25967
26905
  ```python
25968
26906
  from agentmail import AgentMail
26907
+ from agentmail.environment import AgentMailEnvironment
25969
26908
 
25970
26909
  client = AgentMail(
25971
- base_url="https://api.agentmail.to",
26910
+ environment=AgentMailEnvironment.PRODUCTION,
25972
26911
  api_key="YOUR_TOKEN_HERE"
25973
26912
  )
25974
26913
 
25975
- client.pods.drafts.get(
26914
+ client.pods.drafts.get_attachment(
25976
26915
  pod_id="pod_id",
25977
- draft_id="draft_id"
26916
+ draft_id="draft_id",
26917
+ attachment_id="attachment_id"
25978
26918
  )
25979
26919
 
25980
26920
  ```
@@ -25990,7 +26930,7 @@ import (
25990
26930
 
25991
26931
  func main() {
25992
26932
 
25993
- url := "https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id"
26933
+ url := "https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id/attachments/attachment_id"
25994
26934
 
25995
26935
  req, _ := http.NewRequest("GET", url, nil)
25996
26936
 
@@ -26011,7 +26951,7 @@ func main() {
26011
26951
  require 'uri'
26012
26952
  require 'net/http'
26013
26953
 
26014
- url = URI("https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id")
26954
+ url = URI("https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id/attachments/attachment_id")
26015
26955
 
26016
26956
  http = Net::HTTP.new(url.host, url.port)
26017
26957
  http.use_ssl = true
@@ -26024,7 +26964,7 @@ puts response.read_body
26024
26964
  ```
26025
26965
 
26026
26966
  ```java
26027
- HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id")
26967
+ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id/attachments/attachment_id")
26028
26968
  .header("Authorization", "Bearer <api_key>")
26029
26969
  .asString();
26030
26970
  ```
@@ -26034,7 +26974,7 @@ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/pods/po
26034
26974
 
26035
26975
  $client = new \GuzzleHttp\Client();
26036
26976
 
26037
- $response = $client->request('GET', 'https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id', [
26977
+ $response = $client->request('GET', 'https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id/attachments/attachment_id', [
26038
26978
  'headers' => [
26039
26979
  'Authorization' => 'Bearer <api_key>',
26040
26980
  ],
@@ -26044,7 +26984,7 @@ echo $response->getBody();
26044
26984
  ```
26045
26985
 
26046
26986
  ```csharp
26047
- var client = new RestClient("https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id");
26987
+ var client = new RestClient("https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id/attachments/attachment_id");
26048
26988
  var request = new RestRequest(Method.GET);
26049
26989
  request.AddHeader("Authorization", "Bearer <api_key>");
26050
26990
  IRestResponse response = client.Execute(request);
@@ -26055,7 +26995,7 @@ import Foundation
26055
26995
 
26056
26996
  let headers = ["Authorization": "Bearer <api_key>"]
26057
26997
 
26058
- let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id")! as URL,
26998
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/pods/pod_id/drafts/draft_id/attachments/attachment_id")! as URL,
26059
26999
  cachePolicy: .useProtocolCachePolicy,
26060
27000
  timeoutInterval: 10.0)
26061
27001
  request.httpMethod = "GET"
@@ -26192,11 +27132,11 @@ components:
26192
27132
  ## SDK Code Examples
26193
27133
 
26194
27134
  ```typescript
26195
- import { AgentMailClient } from "agentmail";
27135
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
26196
27136
 
26197
27137
  async function main() {
26198
27138
  const client = new AgentMailClient({
26199
- environment: "https://api.agentmail.to",
27139
+ environment: AgentMailEnvironment.Production,
26200
27140
  apiKey: "YOUR_TOKEN_HERE",
26201
27141
  });
26202
27142
  await client.pods.domains.list("pod_id", {});
@@ -26207,9 +27147,10 @@ main();
26207
27147
 
26208
27148
  ```python
26209
27149
  from agentmail import AgentMail
27150
+ from agentmail.environment import AgentMailEnvironment
26210
27151
 
26211
27152
  client = AgentMail(
26212
- base_url="https://api.agentmail.to",
27153
+ environment=AgentMailEnvironment.PRODUCTION,
26213
27154
  api_key="YOUR_TOKEN_HERE"
26214
27155
  )
26215
27156
 
@@ -26490,11 +27431,11 @@ components:
26490
27431
  ## SDK Code Examples
26491
27432
 
26492
27433
  ```typescript
26493
- import { AgentMailClient } from "agentmail";
27434
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
26494
27435
 
26495
27436
  async function main() {
26496
27437
  const client = new AgentMailClient({
26497
- environment: "https://api.agentmail.to",
27438
+ environment: AgentMailEnvironment.Production,
26498
27439
  apiKey: "YOUR_TOKEN_HERE",
26499
27440
  });
26500
27441
  await client.pods.domains.create("pod_id", {
@@ -26508,9 +27449,10 @@ main();
26508
27449
 
26509
27450
  ```python
26510
27451
  from agentmail import AgentMail
27452
+ from agentmail.environment import AgentMailEnvironment
26511
27453
 
26512
27454
  client = AgentMail(
26513
- base_url="https://api.agentmail.to",
27455
+ environment=AgentMailEnvironment.PRODUCTION,
26514
27456
  api_key="YOUR_TOKEN_HERE"
26515
27457
  )
26516
27458
 
@@ -26700,11 +27642,11 @@ components:
26700
27642
  ## SDK Code Examples
26701
27643
 
26702
27644
  ```typescript
26703
- import { AgentMailClient } from "agentmail";
27645
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
26704
27646
 
26705
27647
  async function main() {
26706
27648
  const client = new AgentMailClient({
26707
- environment: "https://api.agentmail.to",
27649
+ environment: AgentMailEnvironment.Production,
26708
27650
  apiKey: "YOUR_TOKEN_HERE",
26709
27651
  });
26710
27652
  await client.pods.domains.delete("pod_id", "domain_id");
@@ -26715,9 +27657,10 @@ main();
26715
27657
 
26716
27658
  ```python
26717
27659
  from agentmail import AgentMail
27660
+ from agentmail.environment import AgentMailEnvironment
26718
27661
 
26719
27662
  client = AgentMail(
26720
- base_url="https://api.agentmail.to",
27663
+ environment=AgentMailEnvironment.PRODUCTION,
26721
27664
  api_key="YOUR_TOKEN_HERE"
26722
27665
  )
26723
27666
 
@@ -26903,11 +27846,11 @@ components:
26903
27846
  ## SDK Code Examples
26904
27847
 
26905
27848
  ```typescript
26906
- import { AgentMailClient } from "agentmail";
27849
+ import { AgentMailClient, AgentMailEnvironment } from "agentmail";
26907
27850
 
26908
27851
  async function main() {
26909
27852
  const client = new AgentMailClient({
26910
- environment: "https://api.agentmail.to",
27853
+ environment: AgentMailEnvironment.Production,
26911
27854
  apiKey: "YOUR_TOKEN_HERE",
26912
27855
  });
26913
27856
  await client.organizations.get();
@@ -26918,9 +27861,10 @@ main();
26918
27861
 
26919
27862
  ```python
26920
27863
  from agentmail import AgentMail
27864
+ from agentmail.environment import AgentMailEnvironment
26921
27865
 
26922
27866
  client = AgentMail(
26923
- base_url="https://api.agentmail.to",
27867
+ environment=AgentMailEnvironment.PRODUCTION,
26924
27868
  api_key="YOUR_TOKEN_HERE"
26925
27869
  )
26926
27870
 
@@ -27042,3 +27986,515 @@ let dataTask = session.dataTask(with: request as URLRequest, completionHandler:
27042
27986
  dataTask.resume()
27043
27987
  ```
27044
27988
 
27989
+ # AgentMail Changelog
27990
+
27991
+ Latest API and SDK updates. [Subscribe via RSS](https://docs.agentmail.to/changelog.rss) · [Discord](https://discord.gg/hTYatWYWBc)
27992
+
27993
+
27994
+ ***
27995
+
27996
+ tags:
27997
+
27998
+ * webhooks
27999
+ * new-feature
28000
+ * sdk
28001
+
28002
+ ***
28003
+
28004
+ ## Summary
28005
+
28006
+ **Webhooks & Events** – receive email and domain events via HTTP callbacks. Subscribe to message lifecycle events (received, sent, delivered, bounced, complained, rejected) and domain verification. Use Svix headers for verification and filter by inbox or pod. Perfect for agents that need reliable, async notifications without keeping a WebSocket open.
28007
+
28008
+ ### What's new?
28009
+
28010
+ **Webhook events:**
28011
+
28012
+ * `message.received` - New inbound email
28013
+ * `message.sent` - Outbound message sent
28014
+ * `message.delivered` - Delivery confirmed
28015
+ * `message.bounced` - Bounce (with type and recipients)
28016
+ * `message.complained` - Spam complaint
28017
+ * `message.rejected` - Rejection (e.g. validation)
28018
+ * `domain.verified` - Domain verification succeeded
28019
+
28020
+ **Delivery & verification:**
28021
+
28022
+ * Svix-style headers: `svix-id`, `svix-signature`, `svix-timestamp` for verification
28023
+ * Filter by inbox or pod (up to 10 per webhook)
28024
+ * Payloads include inbox\_id, thread\_id, message\_id, timestamps, and event-specific data
28025
+
28026
+ ### Use cases
28027
+
28028
+ Build agents that:
28029
+
28030
+ * React to new emails, bounces, and complaints via HTTP
28031
+ * Sync email state to your database or queue
28032
+ * Trigger workflows on domain verification
28033
+ * Verify webhook signatures for security
28034
+
28035
+ <CodeBlocks>
28036
+ ```python title="Python"
28037
+ from agentmail import AgentMail
28038
+
28039
+ client = AgentMail(api_key="your-api-key")
28040
+
28041
+ # in your webhook handler: verify signature and handle event
28042
+ # (use Svix or the raw headers for verification)
28043
+ def handle_webhook(request):
28044
+ event_id = request.headers.get("svix-id")
28045
+ signature = request.headers.get("svix-signature")
28046
+ payload = request.json()
28047
+ if payload.get("event_type") == "message.received":
28048
+ message = payload.get("message")
28049
+ # process new email
28050
+ elif payload.get("event_type") == "domain.verified":
28051
+ domain = payload.get("domain")
28052
+ # domain is verified
28053
+ ```
28054
+
28055
+ ```typescript title="TypeScript"
28056
+ import { AgentMail } from "agentmail";
28057
+
28058
+ const client = new AgentMail({ apiKey: "your-api-key" });
28059
+
28060
+ // in your webhook handler: verify signature and handle event
28061
+ // (use Svix or the raw headers for verification)
28062
+ function handleWebhook(request: Request) {
28063
+ const eventId = request.headers.get("svix-id");
28064
+ const signature = request.headers.get("svix-signature");
28065
+ const payload = request.json();
28066
+ if (payload.event_type === "message.received") {
28067
+ const message = payload.message;
28068
+ // process new email
28069
+ } else if (payload.event_type === "domain.verified") {
28070
+ const domain = payload.domain;
28071
+ // domain is verified
28072
+ }
28073
+ }
28074
+ ```
28075
+ </CodeBlocks>
28076
+
28077
+ <Note>
28078
+ Set up and verify webhooks in our [Webhooks](https://docs.agentmail.to/webhooks/webhooks-overview) documentation.
28079
+ </Note>
28080
+
28081
+
28082
+ ***
28083
+
28084
+ tags:
28085
+
28086
+ * domains-api
28087
+ * new-feature
28088
+ * sdk
28089
+ * custom-domains
28090
+
28091
+ ***
28092
+
28093
+ ## Summary
28094
+
28095
+ Introducing **Custom Domains** – add and verify your own domains for sending and receiving email. Use DNS verification (TXT, CNAME, MX), export zone files for easy DNS setup, and control feedback (bounce and complaint) delivery. Perfect for agents that need to send from your brand's domain with full control over deliverability.
28096
+
28097
+ ### What's new?
28098
+
28099
+ **New endpoints:**
28100
+
28101
+ * `GET /domains` - List all domains
28102
+ * `GET /domains/{domain_id}` - Get domain details and verification records
28103
+ * `POST /domains` - Create (add) a domain
28104
+ * `DELETE /domains/{domain_id}` - Remove a domain
28105
+ * `GET /domains/{domain_id}/zone-file` - Download zone file for DNS setup
28106
+ * `POST /domains/{domain_id}/verify` - Trigger domain verification
28107
+
28108
+ **Domain features:**
28109
+
28110
+ * DNS verification with TXT, CNAME, and MX records
28111
+ * Verification status: NOT\_STARTED, PENDING, VERIFYING, VERIFIED, FAILED, INVALID
28112
+ * Per-record status (MISSING, INVALID, VALID) for targeted fixes
28113
+ * Zone file export for quick import at your DNS provider
28114
+ * Optional feedback (bounce/complaint) delivery per domain
28115
+
28116
+ ### Use cases
28117
+
28118
+ Build systems where:
28119
+
28120
+ * Agents send from your verified custom domain
28121
+ * You manage DNS in one place and sync via zone file
28122
+ * Verification status drives onboarding or monitoring
28123
+ * Bounce and complaint handling is configured per domain
28124
+
28125
+ <CodeBlocks>
28126
+ ```python title="Python"
28127
+ from agentmail import AgentMail
28128
+
28129
+ client = AgentMail(api_key="your-api-key")
28130
+
28131
+ # create a domain
28132
+ domain = client.domains.create(
28133
+ domain="mail.example.com",
28134
+ feedback_enabled=True
28135
+ )
28136
+
28137
+ # get verification records and status
28138
+ domain = client.domains.get(domain_id=domain.domain_id)
28139
+ for record in domain.records:
28140
+ print(f"{record.type} {record.name}: {record.status}")
28141
+
28142
+ # trigger verification after updating DNS
28143
+ client.domains.verify(domain_id=domain.domain_id)
28144
+ ```
28145
+
28146
+ ```typescript title="TypeScript"
28147
+ import { AgentMail } from "agentmail";
28148
+
28149
+ const client = new AgentMail({ apiKey: "your-api-key" });
28150
+
28151
+ // create a domain
28152
+ const domain = await client.domains.create({
28153
+ domain: "mail.example.com",
28154
+ feedbackEnabled: true,
28155
+ });
28156
+
28157
+ // get verification records and status
28158
+ const domainDetails = await client.domains.get(domain.domainId);
28159
+ for (const record of domainDetails.records) {
28160
+ console.log(`${record.type} ${record.name}: ${record.status}`);
28161
+ }
28162
+
28163
+ // trigger verification after updating DNS
28164
+ await client.domains.verify(domain.domainId);
28165
+ ```
28166
+ </CodeBlocks>
28167
+
28168
+ <Note>
28169
+ Learn more in our [Custom Domains](https://docs.agentmail.to/guides/domains/custom-domains) and [Managing Domains](https://docs.agentmail.to/guides/domains/managing-domains) guides.
28170
+ </Note>
28171
+
28172
+
28173
+ ***
28174
+
28175
+ tags:
28176
+
28177
+ * drafts-api
28178
+ * new-feature
28179
+ * sdk
28180
+
28181
+ ***
28182
+
28183
+ ## Summary
28184
+
28185
+ Introducing the **Drafts API** – compose and manage email drafts before sending. Create drafts, update them over time, schedule send times, and send when ready. Perfect for agents that need to build messages incrementally, support reply threading, or queue emails for later delivery.
28186
+
28187
+ ### What's new?
28188
+
28189
+ **New endpoints:**
28190
+
28191
+ * `GET /drafts` - List all drafts (with optional filters)
28192
+ * `GET /drafts/{draft_id}` - Get a draft
28193
+ * `POST /inboxes/{inbox_id}/drafts` - Create a draft in an inbox
28194
+ * `PATCH /inboxes/{inbox_id}/drafts/{draft_id}` - Update a draft
28195
+ * `POST /inboxes/{inbox_id}/drafts/{draft_id}/send` - Send a draft
28196
+ * `DELETE /inboxes/{inbox_id}/drafts/{draft_id}` - Delete a draft
28197
+
28198
+ **Draft features:**
28199
+
28200
+ * Compose with to, cc, bcc, subject, plain text, and HTML body
28201
+ * Reply threading via `in_reply_to` and `references`
28202
+ * Schedule send with `send_at` for delayed delivery
28203
+ * Attachments and labels
28204
+ * List and filter drafts by inbox, labels, or time range
28205
+
28206
+ ### Use cases
28207
+
28208
+ Build agents that:
28209
+
28210
+ * Compose multi-step replies before sending
28211
+ * Schedule follow-up emails for optimal delivery
28212
+ * Queue outbound messages and send in batches
28213
+ * Edit drafts based on new context or user feedback
28214
+ * Maintain proper email threads with `in_reply_to`
28215
+
28216
+ <CodeBlocks>
28217
+ ```python title="Python"
28218
+ from agentmail import AgentMail
28219
+
28220
+ client = AgentMail(api_key="your-api-key")
28221
+
28222
+ # create a draft in an inbox
28223
+ draft = client.inboxes.drafts.create(
28224
+ inbox_id="support@example.com",
28225
+ to=["user@example.com"],
28226
+ subject="Re: Your request",
28227
+ text="We're looking into it.",
28228
+ in_reply_to="<message-id@example.com>"
28229
+ )
28230
+
28231
+ # update the draft
28232
+ client.inboxes.drafts.update(
28233
+ inbox_id="support@example.com",
28234
+ draft_id=draft.draft_id,
28235
+ text="We've resolved your request."
28236
+ )
28237
+
28238
+ # send the draft
28239
+ client.inboxes.drafts.send(
28240
+ inbox_id="support@example.com",
28241
+ draft_id=draft.draft_id
28242
+ )
28243
+ ```
28244
+
28245
+ ```typescript title="TypeScript"
28246
+ import { AgentMail } from "agentmail";
28247
+
28248
+ const client = new AgentMail({ apiKey: "your-api-key" });
28249
+
28250
+ // create a draft in an inbox
28251
+ const draft = await client.inboxes.drafts.create("support@example.com", {
28252
+ to: ["user@example.com"],
28253
+ subject: "Re: Your request",
28254
+ text: "We're looking into it.",
28255
+ inReplyTo: "<message-id@example.com>",
28256
+ });
28257
+
28258
+ // update the draft
28259
+ await client.inboxes.drafts.update(
28260
+ "support@example.com",
28261
+ draft.draftId,
28262
+ { text: "We've resolved your request." }
28263
+ );
28264
+
28265
+ // send the draft
28266
+ await client.inboxes.drafts.send("support@example.com", draft.draftId);
28267
+ ```
28268
+ </CodeBlocks>
28269
+
28270
+ <Note>
28271
+ Learn more about composing and sending in our [Drafts](https://docs.agentmail.to/core-concepts/drafts) documentation.
28272
+ </Note>
28273
+
28274
+
28275
+ ***
28276
+
28277
+ tags:
28278
+
28279
+ * metrics-api
28280
+ * new-feature
28281
+ * sdk
28282
+
28283
+ ***
28284
+
28285
+ ## Summary
28286
+
28287
+ We're excited to introduce **Metrics Endpoints** - two new powerful endpoints that give you deep insights into your email deliverability and agent performance. Track critical events like bounces, deliveries, rejections, and complaints with detailed timestamps to build smarter, self-optimizing email agents.
28288
+
28289
+ ### What's new?
28290
+
28291
+ **New endpoints:**
28292
+
28293
+ * `GET /metrics` - Get comprehensive metrics across all your inboxes
28294
+ * `GET /inboxes/{inbox_id}/metrics` - Get metrics for a specific inbox
28295
+
28296
+ **Metrics tracked:**
28297
+
28298
+ * Delivery events: sent, delivered, bounced, rejected
28299
+ * Error tracking: complaints, spam reports
28300
+ * Time-series data with detailed timestamps
28301
+
28302
+ ### Use cases
28303
+
28304
+ Build agents that:
28305
+
28306
+ * Monitor their own bounce rates in real-time
28307
+ * Optimize send timing based on historical performance
28308
+ * Automatically adjust behavior based on deliverability metrics
28309
+ * Pause campaigns when performance drops below thresholds
28310
+ * Implement intelligent retry strategies for better inbox placement
28311
+
28312
+ <Note>
28313
+ Ready to build smarter agents? Check out our [Metrics API documentation](https://docs.agentmail.to/api-reference/metrics) to get started.
28314
+ </Note>
28315
+
28316
+
28317
+ ***
28318
+
28319
+ tags:
28320
+
28321
+ * websockets
28322
+ * new-feature
28323
+ * sdk
28324
+
28325
+ ***
28326
+
28327
+ ## Summary
28328
+
28329
+ Introducing **WebSocket Streaming** - receive email events in real-time as they happen. Build reactive agents that respond instantly to new messages, deliveries, and bounces without polling. Perfect for building interactive, event-driven email experiences.
28330
+
28331
+ ### What's new?
28332
+
28333
+ **WebSocket endpoint:**
28334
+
28335
+ * `wss://ws.agentmail.to/v0` - Real-time event streaming
28336
+
28337
+ **Events streamed:**
28338
+
28339
+ * `message.received` - New inbound email detected
28340
+ * `message.sent` - Outbound email sent successfully
28341
+ * `message.delivered` - Delivery confirmed by recipient server
28342
+ * `message.bounced` - Bounce detected (permanent or temporary)
28343
+ * `message.complained` - Spam complaint received
28344
+
28345
+ **Connection features:**
28346
+
28347
+ * JWT-based authentication for secure connections
28348
+ * Automatic reconnection with exponential backoff
28349
+ * Event filtering by inbox for targeted subscriptions
28350
+ * Low-latency delivery (typically under 100ms)
28351
+ * Support for thousands of concurrent connections
28352
+
28353
+ ### Use cases
28354
+
28355
+ Build agents that:
28356
+
28357
+ * Respond to emails within seconds of receipt
28358
+ * Monitor deliverability in real-time across all inboxes
28359
+ * Trigger workflows instantly on specific events
28360
+ * Build interactive conversational email experiences
28361
+ * Scale to handle high-volume email operations
28362
+ * React to bounces and complaints immediately
28363
+
28364
+ <CodeBlocks>
28365
+ ```python title="Python"
28366
+ from agentmail import AgentMail
28367
+
28368
+ client = AgentMail(api_key="your-api-key")
28369
+
28370
+ # subscribe to events for an inbox
28371
+ async with client.websockets.subscribe(
28372
+ inbox_id="support@example.com"
28373
+ ) as ws:
28374
+ async for event in ws:
28375
+ if event.type == "message.received":
28376
+ print(f"New email from: {event.data.from_}")
28377
+ response = await generate_response(event.data.text)
28378
+ await client.messages.reply(
28379
+ message_id=event.data.message_id,
28380
+ text=response
28381
+ )
28382
+ ```
28383
+
28384
+ ```typescript title="TypeScript"
28385
+ import { AgentMail } from "agentmail";
28386
+
28387
+ const client = new AgentMail({ apiKey: "your-api-key" });
28388
+
28389
+ // subscribe to events for an inbox
28390
+ for await (const event of client.websockets.subscribe("support@example.com")) {
28391
+ if (event.type === "message.received") {
28392
+ console.log("New email from:", event.data.from);
28393
+ const response = await generateResponse(event.data.text);
28394
+ await client.messages.reply(event.data.messageId, response);
28395
+ }
28396
+ }
28397
+ ```
28398
+ </CodeBlocks>
28399
+
28400
+ <Note>
28401
+ Get started with [WebSocket Streaming](https://docs.agentmail.to/websockets) to build real-time email agents.
28402
+ </Note>
28403
+
28404
+
28405
+ ***
28406
+
28407
+ tags:
28408
+
28409
+ * pods-api
28410
+ * new-feature
28411
+ * sdk
28412
+ * collaboration
28413
+
28414
+ ***
28415
+
28416
+ ## Summary
28417
+
28418
+ Introducing **Pods** - team collaboration spaces for AgentMail. Share inboxes, domains, and resources across your organization while maintaining granular control. Perfect for teams building multi-agent email systems that need organized resource management.
28419
+
28420
+ ### What's new?
28421
+
28422
+ **New endpoints:**
28423
+
28424
+ * `POST /pods` - Create a new pod (team workspace)
28425
+ * `GET /pods` - List all pods in your organization
28426
+ * `GET /pods/{pod_id}` - Get pod details
28427
+ * `DELETE /pods/{pod_id}` - Delete a pod
28428
+ * `POST /pods/{pod_id}/inboxes` - Create inbox within a pod
28429
+ * `POST /pods/{pod_id}/domains` - Add custom domain to a pod
28430
+ * `GET /pods/{pod_id}/threads` - List threads within a pod
28431
+ * `GET /pods/{pod_id}/metrics` - Get metrics for a pod
28432
+
28433
+ **Pod features:**
28434
+
28435
+ * Shared inbox access across team members
28436
+ * Per-pod domain configuration
28437
+ * Isolated metrics and analytics per pod
28438
+ * Organized resource hierarchy
28439
+
28440
+ ### Use cases
28441
+
28442
+ Build systems where:
28443
+
28444
+ * Multiple agents share email infrastructure
28445
+ * Different teams manage their own inboxes independently
28446
+ * Resources are organized by department or project
28447
+ * Analytics are tracked per team workspace
28448
+ * Billing and usage can be attributed to specific teams
28449
+
28450
+ <CodeBlocks>
28451
+ ```python title="Python"
28452
+ from agentmail import AgentMail
28453
+
28454
+ client = AgentMail(api_key="your-api-key")
28455
+
28456
+ # create a pod for your sales team
28457
+ pod = client.pods.create(
28458
+ name="Sales Team",
28459
+ description="Shared resources for sales agents"
28460
+ )
28461
+
28462
+ # create an inbox in the pod
28463
+ inbox = client.pods.inboxes.create(
28464
+ pod_id=pod.pod_id,
28465
+ inbox_id="sales@example.com"
28466
+ )
28467
+
28468
+ # list all pods
28469
+ pods = client.pods.list()
28470
+ for pod in pods.pods:
28471
+ print(f"Pod: {pod.name} ({len(pod.inbox_ids)} inboxes)")
28472
+ ```
28473
+
28474
+ ```typescript title="TypeScript"
28475
+ import { AgentMail } from "agentmail";
28476
+
28477
+ const client = new AgentMail({ apiKey: "your-api-key" });
28478
+
28479
+ // create a pod for your sales team
28480
+ const pod = await client.pods.create({
28481
+ name: "Sales Team",
28482
+ description: "Shared resources for sales agents",
28483
+ });
28484
+
28485
+ // create an inbox in the pod
28486
+ await client.pods.inboxes.create(pod.podId, "sales@example.com");
28487
+
28488
+ // list all pods
28489
+ const { pods } = await client.pods.list();
28490
+ for (const p of pods) {
28491
+ console.log(`Pod: ${p.name} (${p.inboxIds?.length ?? 0} inboxes)`);
28492
+ }
28493
+ ```
28494
+ </CodeBlocks>
28495
+
28496
+ <Note>
28497
+ Learn more about organizing teams with [Pods](https://docs.agentmail.to/core-concepts/pods) in our documentation.
28498
+ </Note>
28499
+
28500
+