agentmail 0.4.6 → 0.4.8

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 (54) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/inboxes/client/Client.d.ts +3 -0
  3. package/dist/cjs/api/resources/inboxes/client/Client.js +11 -6
  4. package/dist/cjs/api/resources/inboxes/resources/index.d.ts +2 -0
  5. package/dist/cjs/api/resources/inboxes/resources/index.js +3 -1
  6. package/dist/cjs/api/resources/inboxes/resources/lists/client/Client.d.ts +69 -0
  7. package/dist/cjs/api/resources/inboxes/resources/lists/client/Client.js +311 -0
  8. package/dist/cjs/api/resources/inboxes/resources/lists/client/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/inboxes/resources/lists/client/index.js +17 -0
  10. package/dist/cjs/api/resources/inboxes/resources/lists/client/requests/InboxListListEntriesRequest.d.ts +9 -0
  11. package/dist/cjs/api/resources/inboxes/resources/lists/client/requests/InboxListListEntriesRequest.js +3 -0
  12. package/dist/cjs/api/resources/inboxes/resources/lists/client/requests/index.d.ts +1 -0
  13. package/dist/cjs/api/resources/inboxes/resources/lists/client/requests/index.js +2 -0
  14. package/dist/cjs/api/resources/inboxes/resources/lists/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/inboxes/resources/lists/index.js +17 -0
  16. package/dist/cjs/api/resources/lists/types/Direction.d.ts +1 -0
  17. package/dist/cjs/api/resources/lists/types/Direction.js +1 -0
  18. package/dist/cjs/serialization/resources/lists/types/Direction.d.ts +1 -1
  19. package/dist/cjs/serialization/resources/lists/types/Direction.js +1 -1
  20. package/dist/cjs/version.d.ts +1 -1
  21. package/dist/cjs/version.js +1 -1
  22. package/dist/cjs/wrapper/mppx.d.ts +1 -0
  23. package/dist/cjs/wrapper/mppx.js +1 -1
  24. package/dist/cjs/wrapper/util.d.ts +1 -1
  25. package/dist/cjs/wrapper/util.js +3 -3
  26. package/dist/esm/BaseClient.mjs +2 -2
  27. package/dist/esm/api/resources/inboxes/client/Client.d.mts +3 -0
  28. package/dist/esm/api/resources/inboxes/client/Client.mjs +5 -0
  29. package/dist/esm/api/resources/inboxes/resources/index.d.mts +2 -0
  30. package/dist/esm/api/resources/inboxes/resources/index.mjs +2 -0
  31. package/dist/esm/api/resources/inboxes/resources/lists/client/Client.d.mts +69 -0
  32. package/dist/esm/api/resources/inboxes/resources/lists/client/Client.mjs +274 -0
  33. package/dist/esm/api/resources/inboxes/resources/lists/client/index.d.mts +1 -0
  34. package/dist/esm/api/resources/inboxes/resources/lists/client/index.mjs +1 -0
  35. package/dist/esm/api/resources/inboxes/resources/lists/client/requests/InboxListListEntriesRequest.d.mts +9 -0
  36. package/dist/esm/api/resources/inboxes/resources/lists/client/requests/InboxListListEntriesRequest.mjs +2 -0
  37. package/dist/esm/api/resources/inboxes/resources/lists/client/requests/index.d.mts +1 -0
  38. package/dist/esm/api/resources/inboxes/resources/lists/client/requests/index.mjs +1 -0
  39. package/dist/esm/api/resources/inboxes/resources/lists/index.d.mts +1 -0
  40. package/dist/esm/api/resources/inboxes/resources/lists/index.mjs +1 -0
  41. package/dist/esm/api/resources/lists/types/Direction.d.mts +1 -0
  42. package/dist/esm/api/resources/lists/types/Direction.mjs +1 -0
  43. package/dist/esm/serialization/resources/lists/types/Direction.d.mts +1 -1
  44. package/dist/esm/serialization/resources/lists/types/Direction.mjs +1 -1
  45. package/dist/esm/version.d.mts +1 -1
  46. package/dist/esm/version.mjs +1 -1
  47. package/dist/esm/wrapper/mppx.d.mts +1 -0
  48. package/dist/esm/wrapper/mppx.mjs +1 -1
  49. package/dist/esm/wrapper/util.d.mts +1 -1
  50. package/dist/esm/wrapper/util.mjs +3 -3
  51. package/dist/llms-full.txt +1769 -455
  52. package/dist/llms.txt +4 -0
  53. package/package.json +1 -1
  54. package/reference.md +295 -0
@@ -2057,20 +2057,41 @@ agents can send to or receive from.
2057
2057
 
2058
2058
  ## What are Lists?
2059
2059
 
2060
- `Lists` allow you to filter emails by allowing or blocking specific email addresses or domains. There are four list types based on two dimensions:
2060
+ `Lists` allow you to filter emails by allowing or blocking specific email addresses or domains. There are six list types based on two dimensions:
2061
2061
 
2062
- * **Direction**: `send` or `receive`
2062
+ * **Direction**: `send`, `receive`, or `reply`
2063
2063
  * **Type**: `allow` or `block`
2064
2064
 
2065
- | List | Description |
2066
- | ------------- | ---------------------------------------------------- |
2067
- | Receive allow | Only accept emails from these addresses or domains |
2068
- | Receive block | Reject emails from these addresses or domains |
2069
- | Send allow | Only send emails to these addresses or domains |
2070
- | Send block | Prevent sending emails to these addresses or domains |
2065
+ | List | Description |
2066
+ | ------------- | -------------------------------------------------------- |
2067
+ | Receive allow | Only accept emails from these addresses or domains |
2068
+ | Receive block | Reject emails from these addresses or domains |
2069
+ | Send allow | Only send emails to these addresses or domains |
2070
+ | Send block | Prevent sending emails to these addresses or domains |
2071
+ | Reply allow | Only accept reply emails from these addresses or domains |
2072
+ | Reply block | Reject reply emails from these addresses or domains |
2071
2073
 
2072
2074
  Each entry can be either a full email address (e.g., `partner@example.com`) or an entire domain (e.g., `example.com`).
2073
2075
 
2076
+ ## Scoping
2077
+
2078
+ Lists can be scoped at three levels. A narrower scope overrides a broader one:
2079
+
2080
+ * **Organization**: Applies to all pods and inboxes in your org. Manage with `client.lists`.
2081
+ * **Pod**: Applies to all inboxes in a pod. Manage with `client.pods.lists`.
2082
+ * **Inbox**: Applies to a single inbox. Manage with `client.inboxes.lists`.
2083
+
2084
+ When evaluating whether to allow or block a message, AgentMail checks the most specific scope first. If an inbox-level list has a match, pod and org lists are not checked.
2085
+
2086
+ ## Reply lists
2087
+
2088
+ The `reply` direction handles inbound emails that are replies to previous outbound messages. When an inbound email arrives, AgentMail checks the `In-Reply-To` header to determine whether it is a reply:
2089
+
2090
+ * **If the email is a reply** to a previous outbound message, only the reply lists are checked. The receive lists are skipped entirely.
2091
+ * **If the email is not a reply**, only the receive lists are checked. The reply lists are skipped entirely.
2092
+
2093
+ The two branches are completely separate. By default, when reply lists are empty, all replies are allowed. You can restrict replies by populating reply allow or reply block lists.
2094
+
2074
2095
  ## SDK examples
2075
2096
 
2076
2097
  ### List entries
@@ -2137,6 +2158,48 @@ Remove an entry from a list.
2137
2158
  ```
2138
2159
  </CodeBlocks>
2139
2160
 
2161
+ ### Inbox-scoped lists
2162
+
2163
+ Manage lists for a specific inbox. The same operations are available at the inbox level.
2164
+
2165
+ <CodeBlocks>
2166
+ ```python title="Python"
2167
+ # Add to an inbox-level receive allowlist
2168
+ client.inboxes.lists.create(
2169
+ "inbox_id", "receive", "allow", entry="vip@example.com"
2170
+ )
2171
+
2172
+ # List inbox-level entries
2173
+ entries = client.inboxes.lists.list("inbox_id", "receive", "allow")
2174
+ ```
2175
+
2176
+ ```typescript title="TypeScript"
2177
+ // Add to an inbox-level receive allowlist
2178
+ await client.inboxes.lists.create("inbox_id", "receive", "allow", {
2179
+ entry: "vip@example.com",
2180
+ });
2181
+
2182
+ // List inbox-level entries
2183
+ const entries = await client.inboxes.lists.list("inbox_id", "receive", "allow");
2184
+ ```
2185
+ </CodeBlocks>
2186
+
2187
+ ### Reply lists
2188
+
2189
+ Control which addresses can send replies to an inbox's outbound messages.
2190
+
2191
+ <CodeBlocks>
2192
+ ```python title="Python"
2193
+ # Only allow replies from a specific domain
2194
+ client.lists.create("reply", "allow", entry="nobu.com")
2195
+ ```
2196
+
2197
+ ```typescript title="TypeScript"
2198
+ // Only allow replies from a specific domain
2199
+ await client.lists.create("reply", "allow", { entry: "nobu.com" });
2200
+ ```
2201
+ </CodeBlocks>
2202
+
2140
2203
  ## Copy for Cursor / Claude
2141
2204
 
2142
2205
  Copy one of the blocks below into Cursor or Claude for complete Lists API knowledge in one shot.
@@ -2144,53 +2207,85 @@ Copy one of the blocks below into Cursor or Claude for complete Lists API knowle
2144
2207
  <CodeBlocks>
2145
2208
  ```python title="Python"
2146
2209
  """
2147
- AgentMail Lists copy into Cursor/Claude.
2210
+ AgentMail Lists, copy into Cursor/Claude.
2148
2211
 
2149
- Filter emails by allow/block for send/receive. Types: receive|send × allow|block.
2212
+ Filter emails by allow/block for send/receive/reply. 6 types: receive|send|reply x allow|block.
2213
+ Lists can be scoped to org, pod, or inbox level.
2150
2214
 
2151
- API reference:
2215
+ API reference (org-level):
2152
2216
  - lists.list(direction, type, limit?, page_token?)
2153
- - lists.create(direction, type, entry, reason?) reason only for block lists
2217
+ - lists.create(direction, type, entry, reason?), reason only for block lists
2154
2218
  - lists.get(direction, type, entry)
2155
2219
  - lists.delete(direction, type, entry)
2156
2220
 
2221
+ Pod-level: pods.lists.list(pod_id, direction, type, ...) and same for create/get/delete.
2222
+ Inbox-level: inboxes.lists.list(inbox_id, direction, type, ...) and same for create/get/delete.
2223
+
2157
2224
  Entry: full email (user@domain.com) or domain (example.com).
2225
+ Cascade: inbox > pod > org (most specific scope wins).
2226
+ Reply lists: inbound replies (detected via In-Reply-To) check reply lists, not receive lists.
2158
2227
  """
2159
2228
  from agentmail import AgentMail
2160
2229
 
2161
2230
  client = AgentMail(api_key="YOUR_API_KEY")
2162
2231
 
2232
+ # Org-level lists
2163
2233
  entries = client.lists.list("receive", "allow", limit=10)
2164
2234
  client.lists.create("receive", "allow", entry="partner@example.com")
2165
2235
  client.lists.create("receive", "block", entry="spam@example.com", reason="spam")
2166
2236
  e = client.lists.get("receive", "allow", entry="partner@example.com")
2167
2237
  client.lists.delete("receive", "allow", entry="partner@example.com")
2238
+
2239
+ # Reply lists
2240
+ client.lists.create("reply", "allow", entry="nobu.com")
2241
+
2242
+ # Inbox-level lists
2243
+ client.inboxes.lists.create("inbox_id", "receive", "allow", entry="vip@example.com")
2244
+ inbox_entries = client.inboxes.lists.list("inbox_id", "receive", "allow")
2168
2245
  ```
2169
2246
 
2170
2247
  ```typescript title="TypeScript"
2171
2248
  /**
2172
- * AgentMail Lists copy into Cursor/Claude.
2249
+ * AgentMail Lists, copy into Cursor/Claude.
2173
2250
  *
2174
- * Filter emails by allow/block for send/receive. Types: receive|send × allow|block.
2251
+ * Filter emails by allow/block for send/receive/reply. 6 types: receive|send|reply x allow|block.
2252
+ * Lists can be scoped to org, pod, or inbox level.
2175
2253
  *
2176
- * API reference:
2254
+ * API reference (org-level):
2177
2255
  * - lists.list(direction, type, { limit?, pageToken? })
2178
2256
  * - lists.create(direction, type, { entry, reason? }) — reason only for block
2179
2257
  * - lists.get(direction, type, entry)
2180
2258
  * - lists.delete(direction, type, entry)
2181
2259
  *
2260
+ * Pod-level: pods.lists.list(podId, direction, type, ...) and same for create/get/delete.
2261
+ * Inbox-level: inboxes.lists.list(inboxId, direction, type, ...) and same for create/get/delete.
2262
+ *
2182
2263
  * Entry: full email or domain.
2264
+ * Cascade: inbox > pod > org (most specific scope wins).
2265
+ * Reply lists: inbound replies (detected via In-Reply-To) check reply lists, not receive lists.
2183
2266
  */
2184
2267
  import { AgentMailClient } from "agentmail";
2185
2268
 
2186
2269
  const client = new AgentMailClient({ apiKey: "YOUR_API_KEY" });
2187
2270
 
2188
2271
  async function main() {
2272
+ // Org-level lists
2189
2273
  const entries = await client.lists.list("receive", "allow", { limit: 10 });
2190
2274
  await client.lists.create("receive", "allow", { entry: "partner@example.com" });
2191
2275
  await client.lists.create("receive", "block", { entry: "spam@example.com", reason: "spam" });
2192
2276
  const e = await client.lists.get("receive", "allow", "partner@example.com");
2193
2277
  await client.lists.delete("receive", "allow", "partner@example.com");
2278
+
2279
+ // Reply lists
2280
+ await client.lists.create("reply", "allow", { entry: "nobu.com" });
2281
+
2282
+ // Inbox-level lists
2283
+ await client.inboxes.lists.create("inbox_id", "receive", "allow", {
2284
+ entry: "vip@example.com",
2285
+ });
2286
+ const inboxEntries = await client.inboxes.lists.list(
2287
+ "inbox_id", "receive", "allow"
2288
+ );
2194
2289
  }
2195
2290
  main();
2196
2291
  ```
@@ -2999,34 +3094,24 @@ The skill is available at [skills.sh/agentmail-to/agentmail-skills/agentmail](ht
2999
3094
 
3000
3095
  ## Installation
3001
3096
 
3002
- ### OpenClaw
3003
-
3004
- Install the skill using the OpenClaw CLI:
3097
+ Install the skill using the [skills CLI](https://github.com/vercel-labs/skills). This works with Claude Code, Cursor, OpenClaw, Codex, and other compatible agents:
3005
3098
 
3006
3099
  ```bash
3007
- openclaw skills install agentmail-to/agentmail-skills/agentmail
3100
+ npx skills add agentmail-to/agentmail-skills
3008
3101
  ```
3009
3102
 
3010
- Or install via ClawHub:
3103
+ To skip interactive prompts, specify the skill and agent directly:
3011
3104
 
3012
3105
  ```bash
3013
- npx clawhub@latest install agentmail
3106
+ npx skills add agentmail-to/agentmail-skills --skill agentmail --agent claude-code
3014
3107
  ```
3015
3108
 
3016
- ### Claude Code
3017
-
3018
- Add the skill to your Claude Code configuration:
3019
-
3020
- ```bash
3021
- claude-code skills install agentmail-to/agentmail-skills/agentmail
3022
- ```
3023
-
3024
- ### Cursor
3109
+ ### OpenClaw via ClawHub
3025
3110
 
3026
- Install the skill in Cursor:
3111
+ OpenClaw users can also install via ClawHub:
3027
3112
 
3028
3113
  ```bash
3029
- cursor skills install agentmail-to/agentmail-skills/agentmail
3114
+ npx clawhub@latest install agentmail
3030
3115
  ```
3031
3116
 
3032
3117
  ### Manual installation
@@ -3304,13 +3389,7 @@ The easiest way to add email capabilities to OpenClaw is by installing the offic
3304
3389
 
3305
3390
  ### Installation
3306
3391
 
3307
- Install the skill using the OpenClaw CLI:
3308
-
3309
- ```bash
3310
- openclaw skills install agentmail-to/agentmail-skills/agentmail
3311
- ```
3312
-
3313
- Or install via ClawHub:
3392
+ Install the skill via ClawHub:
3314
3393
 
3315
3394
  ```bash
3316
3395
  npx clawhub@latest install agentmail
@@ -17595,405 +17674,411 @@ components:
17595
17674
  $ref: '#/components/schemas/type_attachments:Attachment'
17596
17675
  description: Attachments in draft.
17597
17676
  title: DraftAttachments
17598
- type_drafts:DraftSendStatus:
17599
- type: string
17600
- enum:
17601
- - scheduled
17602
- - sending
17603
- - failed
17604
- description: Schedule send status of draft.
17605
- title: DraftSendStatus
17606
- type_drafts:DraftSendAt:
17607
- type: string
17608
- format: date-time
17609
- description: Time at which to schedule send draft.
17610
- title: DraftSendAt
17611
- type_drafts:DraftUpdatedAt:
17612
- type: string
17613
- format: date-time
17614
- description: Time at which draft was last updated.
17615
- title: DraftUpdatedAt
17616
- type_drafts:DraftItem:
17617
- type: object
17618
- properties:
17619
- inbox_id:
17620
- $ref: '#/components/schemas/type_inboxes:InboxId'
17621
- draft_id:
17622
- $ref: '#/components/schemas/type_drafts:DraftId'
17623
- labels:
17624
- $ref: '#/components/schemas/type_drafts:DraftLabels'
17625
- to:
17626
- $ref: '#/components/schemas/type_drafts:DraftTo'
17627
- cc:
17628
- $ref: '#/components/schemas/type_drafts:DraftCc'
17629
- bcc:
17630
- $ref: '#/components/schemas/type_drafts:DraftBcc'
17631
- subject:
17632
- $ref: '#/components/schemas/type_drafts:DraftSubject'
17633
- preview:
17634
- $ref: '#/components/schemas/type_drafts:DraftPreview'
17635
- attachments:
17636
- $ref: '#/components/schemas/type_drafts:DraftAttachments'
17637
- send_status:
17638
- $ref: '#/components/schemas/type_drafts:DraftSendStatus'
17639
- send_at:
17640
- $ref: '#/components/schemas/type_drafts:DraftSendAt'
17641
- updated_at:
17642
- $ref: '#/components/schemas/type_drafts:DraftUpdatedAt'
17643
- required:
17644
- - inbox_id
17645
- - draft_id
17646
- - labels
17647
- - updated_at
17648
- title: DraftItem
17649
- type_drafts:ListDraftsResponse:
17650
- type: object
17651
- properties:
17652
- count:
17653
- $ref: '#/components/schemas/type_:Count'
17654
- limit:
17655
- $ref: '#/components/schemas/type_:Limit'
17656
- next_page_token:
17657
- $ref: '#/components/schemas/type_:PageToken'
17658
- drafts:
17659
- type: array
17660
- items:
17661
- $ref: '#/components/schemas/type_drafts:DraftItem'
17662
- description: Ordered by `updated_at` descending.
17663
- required:
17664
- - count
17665
- - drafts
17666
- title: ListDraftsResponse
17667
- type_:ErrorName:
17668
- type: string
17669
- description: Name of error.
17670
- title: ErrorName
17671
- type_:ErrorMessage:
17672
- type: string
17673
- description: Error message.
17674
- title: ErrorMessage
17675
- type_:ErrorResponse:
17676
- type: object
17677
- properties:
17678
- name:
17679
- $ref: '#/components/schemas/type_:ErrorName'
17680
- message:
17681
- $ref: '#/components/schemas/type_:ErrorMessage'
17682
- required:
17683
- - name
17684
- - message
17685
- title: ErrorResponse
17686
- securitySchemes:
17687
- Bearer:
17688
- type: http
17689
- scheme: bearer
17690
-
17691
- ```
17692
-
17693
- ## SDK Code Examples
17694
-
17695
- ```typescript
17696
- import { AgentMailClient } from "agentmail";
17697
-
17698
- async function main() {
17699
- const client = new AgentMailClient({
17700
- apiKey: "YOUR_TOKEN_HERE",
17701
- });
17702
- await client.inboxes.drafts.list("inbox_id", {});
17703
- }
17704
- main();
17705
-
17706
- ```
17707
-
17708
- ```python
17709
- from agentmail import AgentMail
17710
-
17711
- client = AgentMail(
17712
- api_key="YOUR_TOKEN_HERE",
17713
- )
17714
-
17715
- client.inboxes.drafts.list(
17716
- inbox_id="inbox_id",
17717
- )
17718
-
17719
- ```
17720
-
17721
- ```go
17722
- package main
17723
-
17724
- import (
17725
- "fmt"
17726
- "net/http"
17727
- "io"
17728
- )
17729
-
17730
- func main() {
17731
-
17732
- url := "https://api.agentmail.to/v0/inboxes/inbox_id/drafts"
17733
-
17734
- req, _ := http.NewRequest("GET", url, nil)
17735
-
17736
- req.Header.Add("Authorization", "Bearer <api_key>")
17737
-
17738
- res, _ := http.DefaultClient.Do(req)
17739
-
17740
- defer res.Body.Close()
17741
- body, _ := io.ReadAll(res.Body)
17742
-
17743
- fmt.Println(res)
17744
- fmt.Println(string(body))
17745
-
17746
- }
17747
- ```
17748
-
17749
- ```ruby
17750
- require 'uri'
17751
- require 'net/http'
17752
-
17753
- url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/drafts")
17754
-
17755
- http = Net::HTTP.new(url.host, url.port)
17756
- http.use_ssl = true
17757
-
17758
- request = Net::HTTP::Get.new(url)
17759
- request["Authorization"] = 'Bearer <api_key>'
17760
-
17761
- response = http.request(request)
17762
- puts response.read_body
17763
- ```
17764
-
17765
- ```java
17766
- import com.mashape.unirest.http.HttpResponse;
17767
- import com.mashape.unirest.http.Unirest;
17768
-
17769
- HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes/inbox_id/drafts")
17770
- .header("Authorization", "Bearer <api_key>")
17771
- .asString();
17772
- ```
17773
-
17774
- ```php
17775
- <?php
17776
- require_once('vendor/autoload.php');
17777
-
17778
- $client = new \GuzzleHttp\Client();
17779
-
17780
- $response = $client->request('GET', 'https://api.agentmail.to/v0/inboxes/inbox_id/drafts', [
17781
- 'headers' => [
17782
- 'Authorization' => 'Bearer <api_key>',
17783
- ],
17784
- ]);
17785
-
17786
- echo $response->getBody();
17787
- ```
17788
-
17789
- ```csharp
17790
- using RestSharp;
17791
-
17792
- var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/drafts");
17793
- var request = new RestRequest(Method.GET);
17794
- request.AddHeader("Authorization", "Bearer <api_key>");
17795
- IRestResponse response = client.Execute(request);
17796
- ```
17797
-
17798
- ```swift
17799
- import Foundation
17800
-
17801
- let headers = ["Authorization": "Bearer <api_key>"]
17802
-
17803
- let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/drafts")! as URL,
17804
- cachePolicy: .useProtocolCachePolicy,
17805
- timeoutInterval: 10.0)
17806
- request.httpMethod = "GET"
17807
- request.allHTTPHeaderFields = headers
17808
-
17809
- let session = URLSession.shared
17810
- let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
17811
- if (error != nil) {
17812
- print(error as Any)
17813
- } else {
17814
- let httpResponse = response as? HTTPURLResponse
17815
- print(httpResponse)
17816
- }
17817
- })
17818
-
17819
- dataTask.resume()
17820
- ```
17821
-
17822
- # Get Draft
17823
-
17824
- GET https://api.agentmail.to/v0/inboxes/{inbox_id}/drafts/{draft_id}
17825
-
17826
- Reference: https://docs.agentmail.to/api-reference/inboxes/drafts/get
17827
-
17828
- ## OpenAPI Specification
17829
-
17830
- ```yaml
17831
- openapi: 3.1.0
17832
- info:
17833
- title: api
17834
- version: 1.0.0
17835
- paths:
17836
- /v0/inboxes/{inbox_id}/drafts/{draft_id}:
17837
- get:
17838
- operationId: get
17839
- summary: Get Draft
17840
- tags:
17841
- - subpackage_inboxes.subpackage_inboxes/drafts
17842
- parameters:
17843
- - name: inbox_id
17844
- in: path
17845
- required: true
17846
- schema:
17847
- $ref: '#/components/schemas/type_inboxes:InboxId'
17848
- - name: draft_id
17849
- in: path
17850
- required: true
17851
- schema:
17852
- $ref: '#/components/schemas/type_drafts:DraftId'
17853
- - name: Authorization
17854
- in: header
17855
- description: Bearer authentication
17856
- required: true
17857
- schema:
17858
- type: string
17859
- responses:
17860
- '200':
17861
- description: Response with status 200
17862
- content:
17863
- application/json:
17864
- schema:
17865
- $ref: '#/components/schemas/type_drafts:Draft'
17866
- '404':
17867
- description: Error response with status 404
17868
- content:
17869
- application/json:
17870
- schema:
17871
- $ref: '#/components/schemas/type_:ErrorResponse'
17872
- servers:
17873
- - url: https://api.agentmail.to
17874
- - url: https://x402.api.agentmail.to
17875
- - url: https://mpp.api.agentmail.to
17876
- - url: https://api.agentmail.eu
17877
- components:
17878
- schemas:
17879
- type_inboxes:InboxId:
17880
- type: string
17881
- description: The ID of the inbox.
17882
- title: InboxId
17883
- type_drafts:DraftId:
17884
- type: string
17885
- description: ID of draft.
17886
- title: DraftId
17887
- type_drafts:DraftClientId:
17888
- type: string
17889
- description: Client ID of draft.
17890
- title: DraftClientId
17891
- type_drafts:DraftLabels:
17892
- type: array
17893
- items:
17894
- type: string
17895
- description: Labels of draft.
17896
- title: DraftLabels
17897
- type_drafts:DraftReplyTo:
17898
- type: array
17899
- items:
17900
- type: string
17901
- description: >-
17902
- Reply-to addresses. In format `username@domain.com` or `Display Name
17903
- <username@domain.com>`.
17904
- title: DraftReplyTo
17905
- type_drafts:DraftTo:
17906
- type: array
17907
- items:
17908
- type: string
17909
- description: >-
17910
- Addresses of recipients. In format `username@domain.com` or `Display
17911
- Name <username@domain.com>`.
17912
- title: DraftTo
17913
- type_drafts:DraftCc:
17914
- type: array
17915
- items:
17916
- type: string
17917
- description: >-
17918
- Addresses of CC recipients. In format `username@domain.com` or `Display
17919
- Name <username@domain.com>`.
17920
- title: DraftCc
17921
- type_drafts:DraftBcc:
17922
- type: array
17923
- items:
17924
- type: string
17925
- description: >-
17926
- Addresses of BCC recipients. In format `username@domain.com` or `Display
17927
- Name <username@domain.com>`.
17928
- title: DraftBcc
17929
- type_drafts:DraftSubject:
17930
- type: string
17931
- description: Subject of draft.
17932
- title: DraftSubject
17933
- type_drafts:DraftPreview:
17934
- type: string
17935
- description: Text preview of draft.
17936
- title: DraftPreview
17937
- type_drafts:DraftText:
17938
- type: string
17939
- description: Plain text body of draft.
17940
- title: DraftText
17941
- type_drafts:DraftHtml:
17942
- type: string
17943
- description: HTML body of draft.
17944
- title: DraftHtml
17945
- type_attachments:AttachmentId:
17946
- type: string
17947
- description: ID of attachment.
17948
- title: AttachmentId
17949
- type_attachments:AttachmentFilename:
17950
- type: string
17951
- description: Filename of attachment.
17952
- title: AttachmentFilename
17953
- type_attachments:AttachmentSize:
17954
- type: integer
17955
- description: Size of attachment in bytes.
17956
- title: AttachmentSize
17957
- type_attachments:AttachmentContentType:
17958
- type: string
17959
- description: Content type of attachment.
17960
- title: AttachmentContentType
17961
- type_attachments:AttachmentContentDisposition:
17962
- type: string
17963
- enum:
17964
- - inline
17965
- - attachment
17966
- description: Content disposition of attachment.
17967
- title: AttachmentContentDisposition
17968
- type_attachments:AttachmentContentId:
17969
- type: string
17970
- description: Content ID of attachment.
17971
- title: AttachmentContentId
17972
- type_attachments:Attachment:
17973
- type: object
17974
- properties:
17975
- attachment_id:
17976
- $ref: '#/components/schemas/type_attachments:AttachmentId'
17977
- filename:
17978
- $ref: '#/components/schemas/type_attachments:AttachmentFilename'
17979
- size:
17980
- $ref: '#/components/schemas/type_attachments:AttachmentSize'
17981
- content_type:
17982
- $ref: '#/components/schemas/type_attachments:AttachmentContentType'
17983
- content_disposition:
17984
- $ref: '#/components/schemas/type_attachments:AttachmentContentDisposition'
17985
- content_id:
17986
- $ref: '#/components/schemas/type_attachments:AttachmentContentId'
17987
- required:
17988
- - attachment_id
17989
- - size
17990
- title: Attachment
17991
- type_drafts:DraftAttachments:
17992
- type: array
17993
- items:
17994
- $ref: '#/components/schemas/type_attachments:Attachment'
17995
- description: Attachments in draft.
17996
- title: DraftAttachments
17677
+ type_drafts:DraftInReplyTo:
17678
+ type: string
17679
+ description: ID of message being replied to.
17680
+ title: DraftInReplyTo
17681
+ type_drafts:DraftSendStatus:
17682
+ type: string
17683
+ enum:
17684
+ - scheduled
17685
+ - sending
17686
+ - failed
17687
+ description: Schedule send status of draft.
17688
+ title: DraftSendStatus
17689
+ type_drafts:DraftSendAt:
17690
+ type: string
17691
+ format: date-time
17692
+ description: Time at which to schedule send draft.
17693
+ title: DraftSendAt
17694
+ type_drafts:DraftUpdatedAt:
17695
+ type: string
17696
+ format: date-time
17697
+ description: Time at which draft was last updated.
17698
+ title: DraftUpdatedAt
17699
+ type_drafts:DraftItem:
17700
+ type: object
17701
+ properties:
17702
+ inbox_id:
17703
+ $ref: '#/components/schemas/type_inboxes:InboxId'
17704
+ draft_id:
17705
+ $ref: '#/components/schemas/type_drafts:DraftId'
17706
+ labels:
17707
+ $ref: '#/components/schemas/type_drafts:DraftLabels'
17708
+ to:
17709
+ $ref: '#/components/schemas/type_drafts:DraftTo'
17710
+ cc:
17711
+ $ref: '#/components/schemas/type_drafts:DraftCc'
17712
+ bcc:
17713
+ $ref: '#/components/schemas/type_drafts:DraftBcc'
17714
+ subject:
17715
+ $ref: '#/components/schemas/type_drafts:DraftSubject'
17716
+ preview:
17717
+ $ref: '#/components/schemas/type_drafts:DraftPreview'
17718
+ attachments:
17719
+ $ref: '#/components/schemas/type_drafts:DraftAttachments'
17720
+ in_reply_to:
17721
+ $ref: '#/components/schemas/type_drafts:DraftInReplyTo'
17722
+ send_status:
17723
+ $ref: '#/components/schemas/type_drafts:DraftSendStatus'
17724
+ send_at:
17725
+ $ref: '#/components/schemas/type_drafts:DraftSendAt'
17726
+ updated_at:
17727
+ $ref: '#/components/schemas/type_drafts:DraftUpdatedAt'
17728
+ required:
17729
+ - inbox_id
17730
+ - draft_id
17731
+ - labels
17732
+ - updated_at
17733
+ title: DraftItem
17734
+ type_drafts:ListDraftsResponse:
17735
+ type: object
17736
+ properties:
17737
+ count:
17738
+ $ref: '#/components/schemas/type_:Count'
17739
+ limit:
17740
+ $ref: '#/components/schemas/type_:Limit'
17741
+ next_page_token:
17742
+ $ref: '#/components/schemas/type_:PageToken'
17743
+ drafts:
17744
+ type: array
17745
+ items:
17746
+ $ref: '#/components/schemas/type_drafts:DraftItem'
17747
+ description: Ordered by `updated_at` descending.
17748
+ required:
17749
+ - count
17750
+ - drafts
17751
+ title: ListDraftsResponse
17752
+ type_:ErrorName:
17753
+ type: string
17754
+ description: Name of error.
17755
+ title: ErrorName
17756
+ type_:ErrorMessage:
17757
+ type: string
17758
+ description: Error message.
17759
+ title: ErrorMessage
17760
+ type_:ErrorResponse:
17761
+ type: object
17762
+ properties:
17763
+ name:
17764
+ $ref: '#/components/schemas/type_:ErrorName'
17765
+ message:
17766
+ $ref: '#/components/schemas/type_:ErrorMessage'
17767
+ required:
17768
+ - name
17769
+ - message
17770
+ title: ErrorResponse
17771
+ securitySchemes:
17772
+ Bearer:
17773
+ type: http
17774
+ scheme: bearer
17775
+
17776
+ ```
17777
+
17778
+ ## SDK Code Examples
17779
+
17780
+ ```typescript
17781
+ import { AgentMailClient } from "agentmail";
17782
+
17783
+ async function main() {
17784
+ const client = new AgentMailClient({
17785
+ apiKey: "YOUR_TOKEN_HERE",
17786
+ });
17787
+ await client.inboxes.drafts.list("inbox_id", {});
17788
+ }
17789
+ main();
17790
+
17791
+ ```
17792
+
17793
+ ```python
17794
+ from agentmail import AgentMail
17795
+
17796
+ client = AgentMail(
17797
+ api_key="YOUR_TOKEN_HERE",
17798
+ )
17799
+
17800
+ client.inboxes.drafts.list(
17801
+ inbox_id="inbox_id",
17802
+ )
17803
+
17804
+ ```
17805
+
17806
+ ```go
17807
+ package main
17808
+
17809
+ import (
17810
+ "fmt"
17811
+ "net/http"
17812
+ "io"
17813
+ )
17814
+
17815
+ func main() {
17816
+
17817
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/drafts"
17818
+
17819
+ req, _ := http.NewRequest("GET", url, nil)
17820
+
17821
+ req.Header.Add("Authorization", "Bearer <api_key>")
17822
+
17823
+ res, _ := http.DefaultClient.Do(req)
17824
+
17825
+ defer res.Body.Close()
17826
+ body, _ := io.ReadAll(res.Body)
17827
+
17828
+ fmt.Println(res)
17829
+ fmt.Println(string(body))
17830
+
17831
+ }
17832
+ ```
17833
+
17834
+ ```ruby
17835
+ require 'uri'
17836
+ require 'net/http'
17837
+
17838
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/drafts")
17839
+
17840
+ http = Net::HTTP.new(url.host, url.port)
17841
+ http.use_ssl = true
17842
+
17843
+ request = Net::HTTP::Get.new(url)
17844
+ request["Authorization"] = 'Bearer <api_key>'
17845
+
17846
+ response = http.request(request)
17847
+ puts response.read_body
17848
+ ```
17849
+
17850
+ ```java
17851
+ import com.mashape.unirest.http.HttpResponse;
17852
+ import com.mashape.unirest.http.Unirest;
17853
+
17854
+ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes/inbox_id/drafts")
17855
+ .header("Authorization", "Bearer <api_key>")
17856
+ .asString();
17857
+ ```
17858
+
17859
+ ```php
17860
+ <?php
17861
+ require_once('vendor/autoload.php');
17862
+
17863
+ $client = new \GuzzleHttp\Client();
17864
+
17865
+ $response = $client->request('GET', 'https://api.agentmail.to/v0/inboxes/inbox_id/drafts', [
17866
+ 'headers' => [
17867
+ 'Authorization' => 'Bearer <api_key>',
17868
+ ],
17869
+ ]);
17870
+
17871
+ echo $response->getBody();
17872
+ ```
17873
+
17874
+ ```csharp
17875
+ using RestSharp;
17876
+
17877
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/drafts");
17878
+ var request = new RestRequest(Method.GET);
17879
+ request.AddHeader("Authorization", "Bearer <api_key>");
17880
+ IRestResponse response = client.Execute(request);
17881
+ ```
17882
+
17883
+ ```swift
17884
+ import Foundation
17885
+
17886
+ let headers = ["Authorization": "Bearer <api_key>"]
17887
+
17888
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/drafts")! as URL,
17889
+ cachePolicy: .useProtocolCachePolicy,
17890
+ timeoutInterval: 10.0)
17891
+ request.httpMethod = "GET"
17892
+ request.allHTTPHeaderFields = headers
17893
+
17894
+ let session = URLSession.shared
17895
+ let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
17896
+ if (error != nil) {
17897
+ print(error as Any)
17898
+ } else {
17899
+ let httpResponse = response as? HTTPURLResponse
17900
+ print(httpResponse)
17901
+ }
17902
+ })
17903
+
17904
+ dataTask.resume()
17905
+ ```
17906
+
17907
+ # Get Draft
17908
+
17909
+ GET https://api.agentmail.to/v0/inboxes/{inbox_id}/drafts/{draft_id}
17910
+
17911
+ Reference: https://docs.agentmail.to/api-reference/inboxes/drafts/get
17912
+
17913
+ ## OpenAPI Specification
17914
+
17915
+ ```yaml
17916
+ openapi: 3.1.0
17917
+ info:
17918
+ title: api
17919
+ version: 1.0.0
17920
+ paths:
17921
+ /v0/inboxes/{inbox_id}/drafts/{draft_id}:
17922
+ get:
17923
+ operationId: get
17924
+ summary: Get Draft
17925
+ tags:
17926
+ - subpackage_inboxes.subpackage_inboxes/drafts
17927
+ parameters:
17928
+ - name: inbox_id
17929
+ in: path
17930
+ required: true
17931
+ schema:
17932
+ $ref: '#/components/schemas/type_inboxes:InboxId'
17933
+ - name: draft_id
17934
+ in: path
17935
+ required: true
17936
+ schema:
17937
+ $ref: '#/components/schemas/type_drafts:DraftId'
17938
+ - name: Authorization
17939
+ in: header
17940
+ description: Bearer authentication
17941
+ required: true
17942
+ schema:
17943
+ type: string
17944
+ responses:
17945
+ '200':
17946
+ description: Response with status 200
17947
+ content:
17948
+ application/json:
17949
+ schema:
17950
+ $ref: '#/components/schemas/type_drafts:Draft'
17951
+ '404':
17952
+ description: Error response with status 404
17953
+ content:
17954
+ application/json:
17955
+ schema:
17956
+ $ref: '#/components/schemas/type_:ErrorResponse'
17957
+ servers:
17958
+ - url: https://api.agentmail.to
17959
+ - url: https://x402.api.agentmail.to
17960
+ - url: https://mpp.api.agentmail.to
17961
+ - url: https://api.agentmail.eu
17962
+ components:
17963
+ schemas:
17964
+ type_inboxes:InboxId:
17965
+ type: string
17966
+ description: The ID of the inbox.
17967
+ title: InboxId
17968
+ type_drafts:DraftId:
17969
+ type: string
17970
+ description: ID of draft.
17971
+ title: DraftId
17972
+ type_drafts:DraftClientId:
17973
+ type: string
17974
+ description: Client ID of draft.
17975
+ title: DraftClientId
17976
+ type_drafts:DraftLabels:
17977
+ type: array
17978
+ items:
17979
+ type: string
17980
+ description: Labels of draft.
17981
+ title: DraftLabels
17982
+ type_drafts:DraftReplyTo:
17983
+ type: array
17984
+ items:
17985
+ type: string
17986
+ description: >-
17987
+ Reply-to addresses. In format `username@domain.com` or `Display Name
17988
+ <username@domain.com>`.
17989
+ title: DraftReplyTo
17990
+ type_drafts:DraftTo:
17991
+ type: array
17992
+ items:
17993
+ type: string
17994
+ description: >-
17995
+ Addresses of recipients. In format `username@domain.com` or `Display
17996
+ Name <username@domain.com>`.
17997
+ title: DraftTo
17998
+ type_drafts:DraftCc:
17999
+ type: array
18000
+ items:
18001
+ type: string
18002
+ description: >-
18003
+ Addresses of CC recipients. In format `username@domain.com` or `Display
18004
+ Name <username@domain.com>`.
18005
+ title: DraftCc
18006
+ type_drafts:DraftBcc:
18007
+ type: array
18008
+ items:
18009
+ type: string
18010
+ description: >-
18011
+ Addresses of BCC recipients. In format `username@domain.com` or `Display
18012
+ Name <username@domain.com>`.
18013
+ title: DraftBcc
18014
+ type_drafts:DraftSubject:
18015
+ type: string
18016
+ description: Subject of draft.
18017
+ title: DraftSubject
18018
+ type_drafts:DraftPreview:
18019
+ type: string
18020
+ description: Text preview of draft.
18021
+ title: DraftPreview
18022
+ type_drafts:DraftText:
18023
+ type: string
18024
+ description: Plain text body of draft.
18025
+ title: DraftText
18026
+ type_drafts:DraftHtml:
18027
+ type: string
18028
+ description: HTML body of draft.
18029
+ title: DraftHtml
18030
+ type_attachments:AttachmentId:
18031
+ type: string
18032
+ description: ID of attachment.
18033
+ title: AttachmentId
18034
+ type_attachments:AttachmentFilename:
18035
+ type: string
18036
+ description: Filename of attachment.
18037
+ title: AttachmentFilename
18038
+ type_attachments:AttachmentSize:
18039
+ type: integer
18040
+ description: Size of attachment in bytes.
18041
+ title: AttachmentSize
18042
+ type_attachments:AttachmentContentType:
18043
+ type: string
18044
+ description: Content type of attachment.
18045
+ title: AttachmentContentType
18046
+ type_attachments:AttachmentContentDisposition:
18047
+ type: string
18048
+ enum:
18049
+ - inline
18050
+ - attachment
18051
+ description: Content disposition of attachment.
18052
+ title: AttachmentContentDisposition
18053
+ type_attachments:AttachmentContentId:
18054
+ type: string
18055
+ description: Content ID of attachment.
18056
+ title: AttachmentContentId
18057
+ type_attachments:Attachment:
18058
+ type: object
18059
+ properties:
18060
+ attachment_id:
18061
+ $ref: '#/components/schemas/type_attachments:AttachmentId'
18062
+ filename:
18063
+ $ref: '#/components/schemas/type_attachments:AttachmentFilename'
18064
+ size:
18065
+ $ref: '#/components/schemas/type_attachments:AttachmentSize'
18066
+ content_type:
18067
+ $ref: '#/components/schemas/type_attachments:AttachmentContentType'
18068
+ content_disposition:
18069
+ $ref: '#/components/schemas/type_attachments:AttachmentContentDisposition'
18070
+ content_id:
18071
+ $ref: '#/components/schemas/type_attachments:AttachmentContentId'
18072
+ required:
18073
+ - attachment_id
18074
+ - size
18075
+ title: Attachment
18076
+ type_drafts:DraftAttachments:
18077
+ type: array
18078
+ items:
18079
+ $ref: '#/components/schemas/type_attachments:Attachment'
18080
+ description: Attachments in draft.
18081
+ title: DraftAttachments
17997
18082
  type_drafts:DraftInReplyTo:
17998
18083
  type: string
17999
18084
  description: ID of message being replied to.
@@ -19867,7 +19952,920 @@ func main() {
19867
19952
  require 'uri'
19868
19953
  require 'net/http'
19869
19954
 
19870
- url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/send")
19955
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/send")
19956
+
19957
+ http = Net::HTTP.new(url.host, url.port)
19958
+ http.use_ssl = true
19959
+
19960
+ request = Net::HTTP::Post.new(url)
19961
+ request["Authorization"] = 'Bearer <api_key>'
19962
+ request["Content-Type"] = 'application/json'
19963
+ request.body = "{}"
19964
+
19965
+ response = http.request(request)
19966
+ puts response.read_body
19967
+ ```
19968
+
19969
+ ```java
19970
+ import com.mashape.unirest.http.HttpResponse;
19971
+ import com.mashape.unirest.http.Unirest;
19972
+
19973
+ HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/send")
19974
+ .header("Authorization", "Bearer <api_key>")
19975
+ .header("Content-Type", "application/json")
19976
+ .body("{}")
19977
+ .asString();
19978
+ ```
19979
+
19980
+ ```php
19981
+ <?php
19982
+ require_once('vendor/autoload.php');
19983
+
19984
+ $client = new \GuzzleHttp\Client();
19985
+
19986
+ $response = $client->request('POST', 'https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/send', [
19987
+ 'body' => '{}',
19988
+ 'headers' => [
19989
+ 'Authorization' => 'Bearer <api_key>',
19990
+ 'Content-Type' => 'application/json',
19991
+ ],
19992
+ ]);
19993
+
19994
+ echo $response->getBody();
19995
+ ```
19996
+
19997
+ ```csharp
19998
+ using RestSharp;
19999
+
20000
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/send");
20001
+ var request = new RestRequest(Method.POST);
20002
+ request.AddHeader("Authorization", "Bearer <api_key>");
20003
+ request.AddHeader("Content-Type", "application/json");
20004
+ request.AddParameter("application/json", "{}", ParameterType.RequestBody);
20005
+ IRestResponse response = client.Execute(request);
20006
+ ```
20007
+
20008
+ ```swift
20009
+ import Foundation
20010
+
20011
+ let headers = [
20012
+ "Authorization": "Bearer <api_key>",
20013
+ "Content-Type": "application/json"
20014
+ ]
20015
+ let parameters = [] as [String : Any]
20016
+
20017
+ let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
20018
+
20019
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/send")! as URL,
20020
+ cachePolicy: .useProtocolCachePolicy,
20021
+ timeoutInterval: 10.0)
20022
+ request.httpMethod = "POST"
20023
+ request.allHTTPHeaderFields = headers
20024
+ request.httpBody = postData as Data
20025
+
20026
+ let session = URLSession.shared
20027
+ let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
20028
+ if (error != nil) {
20029
+ print(error as Any)
20030
+ } else {
20031
+ let httpResponse = response as? HTTPURLResponse
20032
+ print(httpResponse)
20033
+ }
20034
+ })
20035
+
20036
+ dataTask.resume()
20037
+ ```
20038
+
20039
+ # List Entries
20040
+
20041
+ GET https://api.agentmail.to/v0/inboxes/{inbox_id}/lists/{direction}/{type}
20042
+
20043
+ Reference: https://docs.agentmail.to/api-reference/inboxes/lists/list
20044
+
20045
+ ## OpenAPI Specification
20046
+
20047
+ ```yaml
20048
+ openapi: 3.1.0
20049
+ info:
20050
+ title: api
20051
+ version: 1.0.0
20052
+ paths:
20053
+ /v0/inboxes/{inbox_id}/lists/{direction}/{type}:
20054
+ get:
20055
+ operationId: list
20056
+ summary: List Entries
20057
+ tags:
20058
+ - subpackage_inboxes.subpackage_inboxes/lists
20059
+ parameters:
20060
+ - name: inbox_id
20061
+ in: path
20062
+ required: true
20063
+ schema:
20064
+ $ref: '#/components/schemas/type_inboxes:InboxId'
20065
+ - name: direction
20066
+ in: path
20067
+ required: true
20068
+ schema:
20069
+ $ref: '#/components/schemas/type_lists:Direction'
20070
+ - name: type
20071
+ in: path
20072
+ required: true
20073
+ schema:
20074
+ $ref: '#/components/schemas/type_lists:ListType'
20075
+ - name: limit
20076
+ in: query
20077
+ required: false
20078
+ schema:
20079
+ $ref: '#/components/schemas/type_:Limit'
20080
+ - name: page_token
20081
+ in: query
20082
+ required: false
20083
+ schema:
20084
+ $ref: '#/components/schemas/type_:PageToken'
20085
+ - name: Authorization
20086
+ in: header
20087
+ description: Bearer authentication
20088
+ required: true
20089
+ schema:
20090
+ type: string
20091
+ responses:
20092
+ '200':
20093
+ description: Response with status 200
20094
+ content:
20095
+ application/json:
20096
+ schema:
20097
+ $ref: '#/components/schemas/type_lists:PodListListEntriesResponse'
20098
+ servers:
20099
+ - url: https://api.agentmail.to
20100
+ - url: https://x402.api.agentmail.to
20101
+ - url: https://mpp.api.agentmail.to
20102
+ - url: https://api.agentmail.eu
20103
+ components:
20104
+ schemas:
20105
+ type_inboxes:InboxId:
20106
+ type: string
20107
+ description: The ID of the inbox.
20108
+ title: InboxId
20109
+ type_lists:Direction:
20110
+ type: string
20111
+ enum:
20112
+ - send
20113
+ - receive
20114
+ - reply
20115
+ description: Direction of list entry.
20116
+ title: Direction
20117
+ type_lists:ListType:
20118
+ type: string
20119
+ enum:
20120
+ - allow
20121
+ - block
20122
+ description: Type of list entry.
20123
+ title: ListType
20124
+ type_:Limit:
20125
+ type: integer
20126
+ description: Limit of number of items returned.
20127
+ title: Limit
20128
+ type_:PageToken:
20129
+ type: string
20130
+ description: Page token for pagination.
20131
+ title: PageToken
20132
+ type_:Count:
20133
+ type: integer
20134
+ description: Number of items returned.
20135
+ title: Count
20136
+ type_:OrganizationId:
20137
+ type: string
20138
+ description: ID of organization.
20139
+ title: OrganizationId
20140
+ type_lists:EntryType:
20141
+ type: string
20142
+ enum:
20143
+ - email
20144
+ - domain
20145
+ description: Whether the entry is an email address or domain.
20146
+ title: EntryType
20147
+ type_lists:PodListEntry:
20148
+ type: object
20149
+ properties:
20150
+ entry:
20151
+ type: string
20152
+ description: Email address or domain of list entry.
20153
+ organization_id:
20154
+ $ref: '#/components/schemas/type_:OrganizationId'
20155
+ reason:
20156
+ type: string
20157
+ description: Reason for adding the entry.
20158
+ direction:
20159
+ $ref: '#/components/schemas/type_lists:Direction'
20160
+ list_type:
20161
+ $ref: '#/components/schemas/type_lists:ListType'
20162
+ entry_type:
20163
+ $ref: '#/components/schemas/type_lists:EntryType'
20164
+ created_at:
20165
+ type: string
20166
+ format: date-time
20167
+ description: Time at which entry was created.
20168
+ pod_id:
20169
+ type: string
20170
+ description: ID of pod.
20171
+ inbox_id:
20172
+ type: string
20173
+ description: ID of inbox, if entry is inbox-scoped.
20174
+ required:
20175
+ - entry
20176
+ - organization_id
20177
+ - direction
20178
+ - list_type
20179
+ - entry_type
20180
+ - created_at
20181
+ - pod_id
20182
+ title: PodListEntry
20183
+ type_lists:PodListListEntriesResponse:
20184
+ type: object
20185
+ properties:
20186
+ count:
20187
+ $ref: '#/components/schemas/type_:Count'
20188
+ limit:
20189
+ $ref: '#/components/schemas/type_:Limit'
20190
+ next_page_token:
20191
+ $ref: '#/components/schemas/type_:PageToken'
20192
+ entries:
20193
+ type: array
20194
+ items:
20195
+ $ref: '#/components/schemas/type_lists:PodListEntry'
20196
+ description: Ordered by entry ascending.
20197
+ required:
20198
+ - count
20199
+ - entries
20200
+ title: PodListListEntriesResponse
20201
+ securitySchemes:
20202
+ Bearer:
20203
+ type: http
20204
+ scheme: bearer
20205
+
20206
+ ```
20207
+
20208
+ ## SDK Code Examples
20209
+
20210
+ ```typescript
20211
+ import { AgentMailClient } from "agentmail";
20212
+
20213
+ async function main() {
20214
+ const client = new AgentMailClient({
20215
+ apiKey: "YOUR_TOKEN_HERE",
20216
+ });
20217
+ await client.inboxes.lists.list("inbox_id", "send", "allow", {});
20218
+ }
20219
+ main();
20220
+
20221
+ ```
20222
+
20223
+ ```python
20224
+ from agentmail import AgentMail
20225
+
20226
+ client = AgentMail(
20227
+ api_key="YOUR_TOKEN_HERE",
20228
+ )
20229
+
20230
+ client.inboxes.lists.list(
20231
+ inbox_id="inbox_id",
20232
+ direction="send",
20233
+ type="allow",
20234
+ )
20235
+
20236
+ ```
20237
+
20238
+ ```go
20239
+ package main
20240
+
20241
+ import (
20242
+ "fmt"
20243
+ "net/http"
20244
+ "io"
20245
+ )
20246
+
20247
+ func main() {
20248
+
20249
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow"
20250
+
20251
+ req, _ := http.NewRequest("GET", url, nil)
20252
+
20253
+ req.Header.Add("Authorization", "Bearer <api_key>")
20254
+
20255
+ res, _ := http.DefaultClient.Do(req)
20256
+
20257
+ defer res.Body.Close()
20258
+ body, _ := io.ReadAll(res.Body)
20259
+
20260
+ fmt.Println(res)
20261
+ fmt.Println(string(body))
20262
+
20263
+ }
20264
+ ```
20265
+
20266
+ ```ruby
20267
+ require 'uri'
20268
+ require 'net/http'
20269
+
20270
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow")
20271
+
20272
+ http = Net::HTTP.new(url.host, url.port)
20273
+ http.use_ssl = true
20274
+
20275
+ request = Net::HTTP::Get.new(url)
20276
+ request["Authorization"] = 'Bearer <api_key>'
20277
+
20278
+ response = http.request(request)
20279
+ puts response.read_body
20280
+ ```
20281
+
20282
+ ```java
20283
+ import com.mashape.unirest.http.HttpResponse;
20284
+ import com.mashape.unirest.http.Unirest;
20285
+
20286
+ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow")
20287
+ .header("Authorization", "Bearer <api_key>")
20288
+ .asString();
20289
+ ```
20290
+
20291
+ ```php
20292
+ <?php
20293
+ require_once('vendor/autoload.php');
20294
+
20295
+ $client = new \GuzzleHttp\Client();
20296
+
20297
+ $response = $client->request('GET', 'https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow', [
20298
+ 'headers' => [
20299
+ 'Authorization' => 'Bearer <api_key>',
20300
+ ],
20301
+ ]);
20302
+
20303
+ echo $response->getBody();
20304
+ ```
20305
+
20306
+ ```csharp
20307
+ using RestSharp;
20308
+
20309
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow");
20310
+ var request = new RestRequest(Method.GET);
20311
+ request.AddHeader("Authorization", "Bearer <api_key>");
20312
+ IRestResponse response = client.Execute(request);
20313
+ ```
20314
+
20315
+ ```swift
20316
+ import Foundation
20317
+
20318
+ let headers = ["Authorization": "Bearer <api_key>"]
20319
+
20320
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow")! as URL,
20321
+ cachePolicy: .useProtocolCachePolicy,
20322
+ timeoutInterval: 10.0)
20323
+ request.httpMethod = "GET"
20324
+ request.allHTTPHeaderFields = headers
20325
+
20326
+ let session = URLSession.shared
20327
+ let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
20328
+ if (error != nil) {
20329
+ print(error as Any)
20330
+ } else {
20331
+ let httpResponse = response as? HTTPURLResponse
20332
+ print(httpResponse)
20333
+ }
20334
+ })
20335
+
20336
+ dataTask.resume()
20337
+ ```
20338
+
20339
+ # Get List Entry
20340
+
20341
+ GET https://api.agentmail.to/v0/inboxes/{inbox_id}/lists/{direction}/{type}/{entry}
20342
+
20343
+ Reference: https://docs.agentmail.to/api-reference/inboxes/lists/get
20344
+
20345
+ ## OpenAPI Specification
20346
+
20347
+ ```yaml
20348
+ openapi: 3.1.0
20349
+ info:
20350
+ title: api
20351
+ version: 1.0.0
20352
+ paths:
20353
+ /v0/inboxes/{inbox_id}/lists/{direction}/{type}/{entry}:
20354
+ get:
20355
+ operationId: get
20356
+ summary: Get List Entry
20357
+ tags:
20358
+ - subpackage_inboxes.subpackage_inboxes/lists
20359
+ parameters:
20360
+ - name: inbox_id
20361
+ in: path
20362
+ required: true
20363
+ schema:
20364
+ $ref: '#/components/schemas/type_inboxes:InboxId'
20365
+ - name: direction
20366
+ in: path
20367
+ required: true
20368
+ schema:
20369
+ $ref: '#/components/schemas/type_lists:Direction'
20370
+ - name: type
20371
+ in: path
20372
+ required: true
20373
+ schema:
20374
+ $ref: '#/components/schemas/type_lists:ListType'
20375
+ - name: entry
20376
+ in: path
20377
+ description: Email address or domain.
20378
+ required: true
20379
+ schema:
20380
+ type: string
20381
+ - name: Authorization
20382
+ in: header
20383
+ description: Bearer authentication
20384
+ required: true
20385
+ schema:
20386
+ type: string
20387
+ responses:
20388
+ '200':
20389
+ description: Response with status 200
20390
+ content:
20391
+ application/json:
20392
+ schema:
20393
+ $ref: '#/components/schemas/type_lists:PodListEntry'
20394
+ '404':
20395
+ description: Error response with status 404
20396
+ content:
20397
+ application/json:
20398
+ schema:
20399
+ $ref: '#/components/schemas/type_:ErrorResponse'
20400
+ servers:
20401
+ - url: https://api.agentmail.to
20402
+ - url: https://x402.api.agentmail.to
20403
+ - url: https://mpp.api.agentmail.to
20404
+ - url: https://api.agentmail.eu
20405
+ components:
20406
+ schemas:
20407
+ type_inboxes:InboxId:
20408
+ type: string
20409
+ description: The ID of the inbox.
20410
+ title: InboxId
20411
+ type_lists:Direction:
20412
+ type: string
20413
+ enum:
20414
+ - send
20415
+ - receive
20416
+ - reply
20417
+ description: Direction of list entry.
20418
+ title: Direction
20419
+ type_lists:ListType:
20420
+ type: string
20421
+ enum:
20422
+ - allow
20423
+ - block
20424
+ description: Type of list entry.
20425
+ title: ListType
20426
+ type_:OrganizationId:
20427
+ type: string
20428
+ description: ID of organization.
20429
+ title: OrganizationId
20430
+ type_lists:EntryType:
20431
+ type: string
20432
+ enum:
20433
+ - email
20434
+ - domain
20435
+ description: Whether the entry is an email address or domain.
20436
+ title: EntryType
20437
+ type_lists:PodListEntry:
20438
+ type: object
20439
+ properties:
20440
+ entry:
20441
+ type: string
20442
+ description: Email address or domain of list entry.
20443
+ organization_id:
20444
+ $ref: '#/components/schemas/type_:OrganizationId'
20445
+ reason:
20446
+ type: string
20447
+ description: Reason for adding the entry.
20448
+ direction:
20449
+ $ref: '#/components/schemas/type_lists:Direction'
20450
+ list_type:
20451
+ $ref: '#/components/schemas/type_lists:ListType'
20452
+ entry_type:
20453
+ $ref: '#/components/schemas/type_lists:EntryType'
20454
+ created_at:
20455
+ type: string
20456
+ format: date-time
20457
+ description: Time at which entry was created.
20458
+ pod_id:
20459
+ type: string
20460
+ description: ID of pod.
20461
+ inbox_id:
20462
+ type: string
20463
+ description: ID of inbox, if entry is inbox-scoped.
20464
+ required:
20465
+ - entry
20466
+ - organization_id
20467
+ - direction
20468
+ - list_type
20469
+ - entry_type
20470
+ - created_at
20471
+ - pod_id
20472
+ title: PodListEntry
20473
+ type_:ErrorName:
20474
+ type: string
20475
+ description: Name of error.
20476
+ title: ErrorName
20477
+ type_:ErrorMessage:
20478
+ type: string
20479
+ description: Error message.
20480
+ title: ErrorMessage
20481
+ type_:ErrorResponse:
20482
+ type: object
20483
+ properties:
20484
+ name:
20485
+ $ref: '#/components/schemas/type_:ErrorName'
20486
+ message:
20487
+ $ref: '#/components/schemas/type_:ErrorMessage'
20488
+ required:
20489
+ - name
20490
+ - message
20491
+ title: ErrorResponse
20492
+ securitySchemes:
20493
+ Bearer:
20494
+ type: http
20495
+ scheme: bearer
20496
+
20497
+ ```
20498
+
20499
+ ## SDK Code Examples
20500
+
20501
+ ```typescript
20502
+ import { AgentMailClient } from "agentmail";
20503
+
20504
+ async function main() {
20505
+ const client = new AgentMailClient({
20506
+ apiKey: "YOUR_TOKEN_HERE",
20507
+ });
20508
+ await client.inboxes.lists.get("inbox_id", "send", "allow", "entry");
20509
+ }
20510
+ main();
20511
+
20512
+ ```
20513
+
20514
+ ```python
20515
+ from agentmail import AgentMail
20516
+
20517
+ client = AgentMail(
20518
+ api_key="YOUR_TOKEN_HERE",
20519
+ )
20520
+
20521
+ client.inboxes.lists.get(
20522
+ inbox_id="inbox_id",
20523
+ direction="send",
20524
+ type="allow",
20525
+ entry="entry",
20526
+ )
20527
+
20528
+ ```
20529
+
20530
+ ```go
20531
+ package main
20532
+
20533
+ import (
20534
+ "fmt"
20535
+ "net/http"
20536
+ "io"
20537
+ )
20538
+
20539
+ func main() {
20540
+
20541
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow/entry"
20542
+
20543
+ req, _ := http.NewRequest("GET", url, nil)
20544
+
20545
+ req.Header.Add("Authorization", "Bearer <api_key>")
20546
+
20547
+ res, _ := http.DefaultClient.Do(req)
20548
+
20549
+ defer res.Body.Close()
20550
+ body, _ := io.ReadAll(res.Body)
20551
+
20552
+ fmt.Println(res)
20553
+ fmt.Println(string(body))
20554
+
20555
+ }
20556
+ ```
20557
+
20558
+ ```ruby
20559
+ require 'uri'
20560
+ require 'net/http'
20561
+
20562
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow/entry")
20563
+
20564
+ http = Net::HTTP.new(url.host, url.port)
20565
+ http.use_ssl = true
20566
+
20567
+ request = Net::HTTP::Get.new(url)
20568
+ request["Authorization"] = 'Bearer <api_key>'
20569
+
20570
+ response = http.request(request)
20571
+ puts response.read_body
20572
+ ```
20573
+
20574
+ ```java
20575
+ import com.mashape.unirest.http.HttpResponse;
20576
+ import com.mashape.unirest.http.Unirest;
20577
+
20578
+ HttpResponse<String> response = Unirest.get("https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow/entry")
20579
+ .header("Authorization", "Bearer <api_key>")
20580
+ .asString();
20581
+ ```
20582
+
20583
+ ```php
20584
+ <?php
20585
+ require_once('vendor/autoload.php');
20586
+
20587
+ $client = new \GuzzleHttp\Client();
20588
+
20589
+ $response = $client->request('GET', 'https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow/entry', [
20590
+ 'headers' => [
20591
+ 'Authorization' => 'Bearer <api_key>',
20592
+ ],
20593
+ ]);
20594
+
20595
+ echo $response->getBody();
20596
+ ```
20597
+
20598
+ ```csharp
20599
+ using RestSharp;
20600
+
20601
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow/entry");
20602
+ var request = new RestRequest(Method.GET);
20603
+ request.AddHeader("Authorization", "Bearer <api_key>");
20604
+ IRestResponse response = client.Execute(request);
20605
+ ```
20606
+
20607
+ ```swift
20608
+ import Foundation
20609
+
20610
+ let headers = ["Authorization": "Bearer <api_key>"]
20611
+
20612
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow/entry")! as URL,
20613
+ cachePolicy: .useProtocolCachePolicy,
20614
+ timeoutInterval: 10.0)
20615
+ request.httpMethod = "GET"
20616
+ request.allHTTPHeaderFields = headers
20617
+
20618
+ let session = URLSession.shared
20619
+ let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
20620
+ if (error != nil) {
20621
+ print(error as Any)
20622
+ } else {
20623
+ let httpResponse = response as? HTTPURLResponse
20624
+ print(httpResponse)
20625
+ }
20626
+ })
20627
+
20628
+ dataTask.resume()
20629
+ ```
20630
+
20631
+ # Create List Entry
20632
+
20633
+ POST https://api.agentmail.to/v0/inboxes/{inbox_id}/lists/{direction}/{type}
20634
+ Content-Type: application/json
20635
+
20636
+ Reference: https://docs.agentmail.to/api-reference/inboxes/lists/create
20637
+
20638
+ ## OpenAPI Specification
20639
+
20640
+ ```yaml
20641
+ openapi: 3.1.0
20642
+ info:
20643
+ title: api
20644
+ version: 1.0.0
20645
+ paths:
20646
+ /v0/inboxes/{inbox_id}/lists/{direction}/{type}:
20647
+ post:
20648
+ operationId: create
20649
+ summary: Create List Entry
20650
+ tags:
20651
+ - subpackage_inboxes.subpackage_inboxes/lists
20652
+ parameters:
20653
+ - name: inbox_id
20654
+ in: path
20655
+ required: true
20656
+ schema:
20657
+ $ref: '#/components/schemas/type_inboxes:InboxId'
20658
+ - name: direction
20659
+ in: path
20660
+ required: true
20661
+ schema:
20662
+ $ref: '#/components/schemas/type_lists:Direction'
20663
+ - name: type
20664
+ in: path
20665
+ required: true
20666
+ schema:
20667
+ $ref: '#/components/schemas/type_lists:ListType'
20668
+ - name: Authorization
20669
+ in: header
20670
+ description: Bearer authentication
20671
+ required: true
20672
+ schema:
20673
+ type: string
20674
+ responses:
20675
+ '200':
20676
+ description: Response with status 200
20677
+ content:
20678
+ application/json:
20679
+ schema:
20680
+ $ref: '#/components/schemas/type_lists:PodListEntry'
20681
+ '400':
20682
+ description: Error response with status 400
20683
+ content:
20684
+ application/json:
20685
+ schema:
20686
+ $ref: '#/components/schemas/type_:ValidationErrorResponse'
20687
+ requestBody:
20688
+ content:
20689
+ application/json:
20690
+ schema:
20691
+ $ref: '#/components/schemas/type_lists:CreateListEntryRequest'
20692
+ servers:
20693
+ - url: https://api.agentmail.to
20694
+ - url: https://x402.api.agentmail.to
20695
+ - url: https://mpp.api.agentmail.to
20696
+ - url: https://api.agentmail.eu
20697
+ components:
20698
+ schemas:
20699
+ type_inboxes:InboxId:
20700
+ type: string
20701
+ description: The ID of the inbox.
20702
+ title: InboxId
20703
+ type_lists:Direction:
20704
+ type: string
20705
+ enum:
20706
+ - send
20707
+ - receive
20708
+ - reply
20709
+ description: Direction of list entry.
20710
+ title: Direction
20711
+ type_lists:ListType:
20712
+ type: string
20713
+ enum:
20714
+ - allow
20715
+ - block
20716
+ description: Type of list entry.
20717
+ title: ListType
20718
+ type_lists:CreateListEntryRequest:
20719
+ type: object
20720
+ properties:
20721
+ entry:
20722
+ type: string
20723
+ description: Email address or domain to add.
20724
+ reason:
20725
+ type: string
20726
+ description: Reason for adding the entry.
20727
+ required:
20728
+ - entry
20729
+ title: CreateListEntryRequest
20730
+ type_:OrganizationId:
20731
+ type: string
20732
+ description: ID of organization.
20733
+ title: OrganizationId
20734
+ type_lists:EntryType:
20735
+ type: string
20736
+ enum:
20737
+ - email
20738
+ - domain
20739
+ description: Whether the entry is an email address or domain.
20740
+ title: EntryType
20741
+ type_lists:PodListEntry:
20742
+ type: object
20743
+ properties:
20744
+ entry:
20745
+ type: string
20746
+ description: Email address or domain of list entry.
20747
+ organization_id:
20748
+ $ref: '#/components/schemas/type_:OrganizationId'
20749
+ reason:
20750
+ type: string
20751
+ description: Reason for adding the entry.
20752
+ direction:
20753
+ $ref: '#/components/schemas/type_lists:Direction'
20754
+ list_type:
20755
+ $ref: '#/components/schemas/type_lists:ListType'
20756
+ entry_type:
20757
+ $ref: '#/components/schemas/type_lists:EntryType'
20758
+ created_at:
20759
+ type: string
20760
+ format: date-time
20761
+ description: Time at which entry was created.
20762
+ pod_id:
20763
+ type: string
20764
+ description: ID of pod.
20765
+ inbox_id:
20766
+ type: string
20767
+ description: ID of inbox, if entry is inbox-scoped.
20768
+ required:
20769
+ - entry
20770
+ - organization_id
20771
+ - direction
20772
+ - list_type
20773
+ - entry_type
20774
+ - created_at
20775
+ - pod_id
20776
+ title: PodListEntry
20777
+ type_:ErrorName:
20778
+ type: string
20779
+ description: Name of error.
20780
+ title: ErrorName
20781
+ type_:ValidationErrorResponse:
20782
+ type: object
20783
+ properties:
20784
+ name:
20785
+ $ref: '#/components/schemas/type_:ErrorName'
20786
+ errors:
20787
+ description: Validation errors.
20788
+ required:
20789
+ - name
20790
+ - errors
20791
+ title: ValidationErrorResponse
20792
+ securitySchemes:
20793
+ Bearer:
20794
+ type: http
20795
+ scheme: bearer
20796
+
20797
+ ```
20798
+
20799
+ ## SDK Code Examples
20800
+
20801
+ ```typescript
20802
+ import { AgentMailClient } from "agentmail";
20803
+
20804
+ async function main() {
20805
+ const client = new AgentMailClient({
20806
+ apiKey: "YOUR_TOKEN_HERE",
20807
+ });
20808
+ await client.inboxes.lists.create("inbox_id", "send", "allow", {
20809
+ entry: "entry",
20810
+ });
20811
+ }
20812
+ main();
20813
+
20814
+ ```
20815
+
20816
+ ```python
20817
+ from agentmail import AgentMail
20818
+
20819
+ client = AgentMail(
20820
+ api_key="YOUR_TOKEN_HERE",
20821
+ )
20822
+
20823
+ client.inboxes.lists.create(
20824
+ inbox_id="inbox_id",
20825
+ direction="send",
20826
+ type="allow",
20827
+ entry="entry",
20828
+ )
20829
+
20830
+ ```
20831
+
20832
+ ```go
20833
+ package main
20834
+
20835
+ import (
20836
+ "fmt"
20837
+ "strings"
20838
+ "net/http"
20839
+ "io"
20840
+ )
20841
+
20842
+ func main() {
20843
+
20844
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow"
20845
+
20846
+ payload := strings.NewReader("{\n \"entry\": \"entry\"\n}")
20847
+
20848
+ req, _ := http.NewRequest("POST", url, payload)
20849
+
20850
+ req.Header.Add("Authorization", "Bearer <api_key>")
20851
+ req.Header.Add("Content-Type", "application/json")
20852
+
20853
+ res, _ := http.DefaultClient.Do(req)
20854
+
20855
+ defer res.Body.Close()
20856
+ body, _ := io.ReadAll(res.Body)
20857
+
20858
+ fmt.Println(res)
20859
+ fmt.Println(string(body))
20860
+
20861
+ }
20862
+ ```
20863
+
20864
+ ```ruby
20865
+ require 'uri'
20866
+ require 'net/http'
20867
+
20868
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow")
19871
20869
 
19872
20870
  http = Net::HTTP.new(url.host, url.port)
19873
20871
  http.use_ssl = true
@@ -19875,7 +20873,7 @@ http.use_ssl = true
19875
20873
  request = Net::HTTP::Post.new(url)
19876
20874
  request["Authorization"] = 'Bearer <api_key>'
19877
20875
  request["Content-Type"] = 'application/json'
19878
- request.body = "{}"
20876
+ request.body = "{\n \"entry\": \"entry\"\n}"
19879
20877
 
19880
20878
  response = http.request(request)
19881
20879
  puts response.read_body
@@ -19885,10 +20883,10 @@ puts response.read_body
19885
20883
  import com.mashape.unirest.http.HttpResponse;
19886
20884
  import com.mashape.unirest.http.Unirest;
19887
20885
 
19888
- HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/send")
20886
+ HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow")
19889
20887
  .header("Authorization", "Bearer <api_key>")
19890
20888
  .header("Content-Type", "application/json")
19891
- .body("{}")
20889
+ .body("{\n \"entry\": \"entry\"\n}")
19892
20890
  .asString();
19893
20891
  ```
19894
20892
 
@@ -19898,8 +20896,10 @@ require_once('vendor/autoload.php');
19898
20896
 
19899
20897
  $client = new \GuzzleHttp\Client();
19900
20898
 
19901
- $response = $client->request('POST', 'https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/send', [
19902
- 'body' => '{}',
20899
+ $response = $client->request('POST', 'https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow', [
20900
+ 'body' => '{
20901
+ "entry": "entry"
20902
+ }',
19903
20903
  'headers' => [
19904
20904
  'Authorization' => 'Bearer <api_key>',
19905
20905
  'Content-Type' => 'application/json',
@@ -19912,11 +20912,11 @@ echo $response->getBody();
19912
20912
  ```csharp
19913
20913
  using RestSharp;
19914
20914
 
19915
- var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/send");
20915
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow");
19916
20916
  var request = new RestRequest(Method.POST);
19917
20917
  request.AddHeader("Authorization", "Bearer <api_key>");
19918
20918
  request.AddHeader("Content-Type", "application/json");
19919
- request.AddParameter("application/json", "{}", ParameterType.RequestBody);
20919
+ request.AddParameter("application/json", "{\n \"entry\": \"entry\"\n}", ParameterType.RequestBody);
19920
20920
  IRestResponse response = client.Execute(request);
19921
20921
  ```
19922
20922
 
@@ -19927,11 +20927,11 @@ let headers = [
19927
20927
  "Authorization": "Bearer <api_key>",
19928
20928
  "Content-Type": "application/json"
19929
20929
  ]
19930
- let parameters = [] as [String : Any]
20930
+ let parameters = ["entry": "entry"] as [String : Any]
19931
20931
 
19932
20932
  let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
19933
20933
 
19934
- let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/send")! as URL,
20934
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow")! as URL,
19935
20935
  cachePolicy: .useProtocolCachePolicy,
19936
20936
  timeoutInterval: 10.0)
19937
20937
  request.httpMethod = "POST"
@@ -19951,6 +20951,247 @@ let dataTask = session.dataTask(with: request as URLRequest, completionHandler:
19951
20951
  dataTask.resume()
19952
20952
  ```
19953
20953
 
20954
+ # Delete List Entry
20955
+
20956
+ DELETE https://api.agentmail.to/v0/inboxes/{inbox_id}/lists/{direction}/{type}/{entry}
20957
+
20958
+ Reference: https://docs.agentmail.to/api-reference/inboxes/lists/delete
20959
+
20960
+ ## OpenAPI Specification
20961
+
20962
+ ```yaml
20963
+ openapi: 3.1.0
20964
+ info:
20965
+ title: api
20966
+ version: 1.0.0
20967
+ paths:
20968
+ /v0/inboxes/{inbox_id}/lists/{direction}/{type}/{entry}:
20969
+ delete:
20970
+ operationId: delete
20971
+ summary: Delete List Entry
20972
+ tags:
20973
+ - subpackage_inboxes.subpackage_inboxes/lists
20974
+ parameters:
20975
+ - name: inbox_id
20976
+ in: path
20977
+ required: true
20978
+ schema:
20979
+ $ref: '#/components/schemas/type_inboxes:InboxId'
20980
+ - name: direction
20981
+ in: path
20982
+ required: true
20983
+ schema:
20984
+ $ref: '#/components/schemas/type_lists:Direction'
20985
+ - name: type
20986
+ in: path
20987
+ required: true
20988
+ schema:
20989
+ $ref: '#/components/schemas/type_lists:ListType'
20990
+ - name: entry
20991
+ in: path
20992
+ description: Email address or domain.
20993
+ required: true
20994
+ schema:
20995
+ type: string
20996
+ - name: Authorization
20997
+ in: header
20998
+ description: Bearer authentication
20999
+ required: true
21000
+ schema:
21001
+ type: string
21002
+ responses:
21003
+ '200':
21004
+ description: Successful response
21005
+ '404':
21006
+ description: Error response with status 404
21007
+ content:
21008
+ application/json:
21009
+ schema:
21010
+ $ref: '#/components/schemas/type_:ErrorResponse'
21011
+ servers:
21012
+ - url: https://api.agentmail.to
21013
+ - url: https://x402.api.agentmail.to
21014
+ - url: https://mpp.api.agentmail.to
21015
+ - url: https://api.agentmail.eu
21016
+ components:
21017
+ schemas:
21018
+ type_inboxes:InboxId:
21019
+ type: string
21020
+ description: The ID of the inbox.
21021
+ title: InboxId
21022
+ type_lists:Direction:
21023
+ type: string
21024
+ enum:
21025
+ - send
21026
+ - receive
21027
+ - reply
21028
+ description: Direction of list entry.
21029
+ title: Direction
21030
+ type_lists:ListType:
21031
+ type: string
21032
+ enum:
21033
+ - allow
21034
+ - block
21035
+ description: Type of list entry.
21036
+ title: ListType
21037
+ type_:ErrorName:
21038
+ type: string
21039
+ description: Name of error.
21040
+ title: ErrorName
21041
+ type_:ErrorMessage:
21042
+ type: string
21043
+ description: Error message.
21044
+ title: ErrorMessage
21045
+ type_:ErrorResponse:
21046
+ type: object
21047
+ properties:
21048
+ name:
21049
+ $ref: '#/components/schemas/type_:ErrorName'
21050
+ message:
21051
+ $ref: '#/components/schemas/type_:ErrorMessage'
21052
+ required:
21053
+ - name
21054
+ - message
21055
+ title: ErrorResponse
21056
+ securitySchemes:
21057
+ Bearer:
21058
+ type: http
21059
+ scheme: bearer
21060
+
21061
+ ```
21062
+
21063
+ ## SDK Code Examples
21064
+
21065
+ ```typescript
21066
+ import { AgentMailClient } from "agentmail";
21067
+
21068
+ async function main() {
21069
+ const client = new AgentMailClient({
21070
+ apiKey: "YOUR_TOKEN_HERE",
21071
+ });
21072
+ await client.inboxes.lists.delete("inbox_id", "send", "allow", "entry");
21073
+ }
21074
+ main();
21075
+
21076
+ ```
21077
+
21078
+ ```python
21079
+ from agentmail import AgentMail
21080
+
21081
+ client = AgentMail(
21082
+ api_key="YOUR_TOKEN_HERE",
21083
+ )
21084
+
21085
+ client.inboxes.lists.delete(
21086
+ inbox_id="inbox_id",
21087
+ direction="send",
21088
+ type="allow",
21089
+ entry="entry",
21090
+ )
21091
+
21092
+ ```
21093
+
21094
+ ```go
21095
+ package main
21096
+
21097
+ import (
21098
+ "fmt"
21099
+ "net/http"
21100
+ "io"
21101
+ )
21102
+
21103
+ func main() {
21104
+
21105
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow/entry"
21106
+
21107
+ req, _ := http.NewRequest("DELETE", url, nil)
21108
+
21109
+ req.Header.Add("Authorization", "Bearer <api_key>")
21110
+
21111
+ res, _ := http.DefaultClient.Do(req)
21112
+
21113
+ defer res.Body.Close()
21114
+ body, _ := io.ReadAll(res.Body)
21115
+
21116
+ fmt.Println(res)
21117
+ fmt.Println(string(body))
21118
+
21119
+ }
21120
+ ```
21121
+
21122
+ ```ruby
21123
+ require 'uri'
21124
+ require 'net/http'
21125
+
21126
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow/entry")
21127
+
21128
+ http = Net::HTTP.new(url.host, url.port)
21129
+ http.use_ssl = true
21130
+
21131
+ request = Net::HTTP::Delete.new(url)
21132
+ request["Authorization"] = 'Bearer <api_key>'
21133
+
21134
+ response = http.request(request)
21135
+ puts response.read_body
21136
+ ```
21137
+
21138
+ ```java
21139
+ import com.mashape.unirest.http.HttpResponse;
21140
+ import com.mashape.unirest.http.Unirest;
21141
+
21142
+ HttpResponse<String> response = Unirest.delete("https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow/entry")
21143
+ .header("Authorization", "Bearer <api_key>")
21144
+ .asString();
21145
+ ```
21146
+
21147
+ ```php
21148
+ <?php
21149
+ require_once('vendor/autoload.php');
21150
+
21151
+ $client = new \GuzzleHttp\Client();
21152
+
21153
+ $response = $client->request('DELETE', 'https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow/entry', [
21154
+ 'headers' => [
21155
+ 'Authorization' => 'Bearer <api_key>',
21156
+ ],
21157
+ ]);
21158
+
21159
+ echo $response->getBody();
21160
+ ```
21161
+
21162
+ ```csharp
21163
+ using RestSharp;
21164
+
21165
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow/entry");
21166
+ var request = new RestRequest(Method.DELETE);
21167
+ request.AddHeader("Authorization", "Bearer <api_key>");
21168
+ IRestResponse response = client.Execute(request);
21169
+ ```
21170
+
21171
+ ```swift
21172
+ import Foundation
21173
+
21174
+ let headers = ["Authorization": "Bearer <api_key>"]
21175
+
21176
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow/entry")! as URL,
21177
+ cachePolicy: .useProtocolCachePolicy,
21178
+ timeoutInterval: 10.0)
21179
+ request.httpMethod = "DELETE"
21180
+ request.allHTTPHeaderFields = headers
21181
+
21182
+ let session = URLSession.shared
21183
+ let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
21184
+ if (error != nil) {
21185
+ print(error as Any)
21186
+ } else {
21187
+ let httpResponse = response as? HTTPURLResponse
21188
+ print(httpResponse)
21189
+ }
21190
+ })
21191
+
21192
+ dataTask.resume()
21193
+ ```
21194
+
19954
21195
  # Query Metrics
19955
21196
 
19956
21197
  GET https://api.agentmail.to/v0/inboxes/{inbox_id}/metrics
@@ -21983,6 +23224,10 @@ components:
21983
23224
  $ref: '#/components/schemas/type_attachments:Attachment'
21984
23225
  description: Attachments in draft.
21985
23226
  title: DraftAttachments
23227
+ type_drafts:DraftInReplyTo:
23228
+ type: string
23229
+ description: ID of message being replied to.
23230
+ title: DraftInReplyTo
21986
23231
  type_drafts:DraftSendStatus:
21987
23232
  type: string
21988
23233
  enum:
@@ -22022,6 +23267,8 @@ components:
22022
23267
  $ref: '#/components/schemas/type_drafts:DraftPreview'
22023
23268
  attachments:
22024
23269
  $ref: '#/components/schemas/type_drafts:DraftAttachments'
23270
+ in_reply_to:
23271
+ $ref: '#/components/schemas/type_drafts:DraftInReplyTo'
22025
23272
  send_status:
22026
23273
  $ref: '#/components/schemas/type_drafts:DraftSendStatus'
22027
23274
  send_at:
@@ -28502,6 +29749,7 @@ components:
28502
29749
  enum:
28503
29750
  - send
28504
29751
  - receive
29752
+ - reply
28505
29753
  description: Direction of list entry.
28506
29754
  title: Direction
28507
29755
  type_lists:ListType:
@@ -28786,6 +30034,7 @@ components:
28786
30034
  enum:
28787
30035
  - send
28788
30036
  - receive
30037
+ - reply
28789
30038
  description: Direction of list entry.
28790
30039
  title: Direction
28791
30040
  type_lists:ListType:
@@ -29060,6 +30309,7 @@ components:
29060
30309
  enum:
29061
30310
  - send
29062
30311
  - receive
30312
+ - reply
29063
30313
  description: Direction of list entry.
29064
30314
  title: Direction
29065
30315
  type_lists:ListType:
@@ -29361,6 +30611,7 @@ components:
29361
30611
  enum:
29362
30612
  - send
29363
30613
  - receive
30614
+ - reply
29364
30615
  description: Direction of list entry.
29365
30616
  title: Direction
29366
30617
  type_lists:ListType:
@@ -34663,6 +35914,10 @@ components:
34663
35914
  $ref: '#/components/schemas/type_attachments:Attachment'
34664
35915
  description: Attachments in draft.
34665
35916
  title: DraftAttachments
35917
+ type_drafts:DraftInReplyTo:
35918
+ type: string
35919
+ description: ID of message being replied to.
35920
+ title: DraftInReplyTo
34666
35921
  type_drafts:DraftSendStatus:
34667
35922
  type: string
34668
35923
  enum:
@@ -34702,6 +35957,8 @@ components:
34702
35957
  $ref: '#/components/schemas/type_drafts:DraftPreview'
34703
35958
  attachments:
34704
35959
  $ref: '#/components/schemas/type_drafts:DraftAttachments'
35960
+ in_reply_to:
35961
+ $ref: '#/components/schemas/type_drafts:DraftInReplyTo'
34705
35962
  send_status:
34706
35963
  $ref: '#/components/schemas/type_drafts:DraftSendStatus'
34707
35964
  send_at:
@@ -37615,6 +38872,7 @@ components:
37615
38872
  enum:
37616
38873
  - send
37617
38874
  - receive
38875
+ - reply
37618
38876
  description: Direction of list entry.
37619
38877
  title: Direction
37620
38878
  type_lists:ListType:
@@ -37916,6 +39174,7 @@ components:
37916
39174
  enum:
37917
39175
  - send
37918
39176
  - receive
39177
+ - reply
37919
39178
  description: Direction of list entry.
37920
39179
  title: Direction
37921
39180
  type_lists:ListType:
@@ -38207,6 +39466,7 @@ components:
38207
39466
  enum:
38208
39467
  - send
38209
39468
  - receive
39469
+ - reply
38210
39470
  description: Direction of list entry.
38211
39471
  title: Direction
38212
39472
  type_lists:ListType:
@@ -38525,6 +39785,7 @@ components:
38525
39785
  enum:
38526
39786
  - send
38527
39787
  - receive
39788
+ - reply
38528
39789
  description: Direction of list entry.
38529
39790
  title: Direction
38530
39791
  type_lists:ListType:
@@ -40577,14 +41838,16 @@ Allowlists and blocklists let you control who your AI agent can communicate with
40577
41838
 
40578
41839
  ## How Lists work
40579
41840
 
40580
- AgentMail provides four list types based on two dimensions, **direction** (send or receive) and **type** (allow or block):
41841
+ AgentMail provides six list types based on two dimensions, **direction** (send, receive, or reply) and **type** (allow or block):
40581
41842
 
40582
- | List | What it does |
40583
- | ------------- | ---------------------------------------------------- |
40584
- | Receive allow | Only accept emails from these addresses or domains |
40585
- | Receive block | Reject emails from these addresses or domains |
40586
- | Send allow | Only send emails to these addresses or domains |
40587
- | Send block | Prevent sending emails to these addresses or domains |
41843
+ | List | What it does |
41844
+ | ------------- | -------------------------------------------------------- |
41845
+ | Receive allow | Only accept emails from these addresses or domains |
41846
+ | Receive block | Reject emails from these addresses or domains |
41847
+ | Send allow | Only send emails to these addresses or domains |
41848
+ | Send block | Prevent sending emails to these addresses or domains |
41849
+ | Reply allow | Only accept reply emails from these addresses or domains |
41850
+ | Reply block | Reject reply emails from these addresses or domains |
40588
41851
 
40589
41852
  Each entry can be either a full email address (e.g., `partner@example.com`) or an entire domain (e.g., `example.com`).
40590
41853
 
@@ -40623,6 +41886,40 @@ entries = client.lists.list("receive", "allow")
40623
41886
  client.lists.delete("receive", "block", entry="spam@example.com")
40624
41887
  ```
40625
41888
 
41889
+ ### Inbox-scoped lists
41890
+
41891
+ Lists can be applied at the inbox level for per-inbox filtering. For example, one inbox might only accept emails from `meta.com`, while another inbox in the same pod accepts from `partner.com`.
41892
+
41893
+ ```python title="Python"
41894
+ # This inbox only accepts emails from meta.com
41895
+ client.inboxes.lists.create(
41896
+ "support@yourdomain.com", "receive", "allow", entry="meta.com"
41897
+ )
41898
+
41899
+ # A different inbox accepts from partner.com
41900
+ client.inboxes.lists.create(
41901
+ "sales@yourdomain.com", "receive", "allow", entry="partner.com"
41902
+ )
41903
+ ```
41904
+
41905
+ Inbox-level lists override pod-level and org-level lists. If the inbox-level list has a match, pod and org lists are not checked.
41906
+
41907
+ ### Reply lists
41908
+
41909
+ Reply lists control filtering for inbound emails that are replies to previous outbound messages. When an inbound email arrives, AgentMail checks the `In-Reply-To` header:
41910
+
41911
+ * If the email **is a reply** to a previous outbound message, only the reply lists are checked. Receive lists are skipped.
41912
+ * If the email **is not a reply**, only the receive lists are checked. Reply lists are skipped.
41913
+
41914
+ By default, when reply lists are empty, all replies are allowed. This is useful for agents that initiate outbound emails (such as making reservations or sending inquiries) and need to receive the responses.
41915
+
41916
+ ```python title="Python"
41917
+ # Block replies from a specific sender
41918
+ client.inboxes.lists.create(
41919
+ "agent@yourdomain.com", "reply", "block", entry="spam-restaurant.com"
41920
+ )
41921
+ ```
41922
+
40626
41923
  ## Common patterns for agents
40627
41924
 
40628
41925
  **Outreach agent:** Use a send allowlist to restrict your agent to only email verified prospects. This prevents the agent from accidentally emailing the wrong people.
@@ -40648,6 +41945,22 @@ client.lists.create("receive", "allow", entry="trusted-partner.com")
40648
41945
  client.lists.create("receive", "block", entry="spam-domain.com", reason="spam")
40649
41946
  ```
40650
41947
 
41948
+ **Task-oriented agent (making reservations, bookings, etc.):** Use a receive allowlist to restrict inbound to your organization's domain, but leave reply lists open (default) so replies to agent-initiated outbound emails come through.
41949
+
41950
+ ```python title="Python"
41951
+ # Only accept unsolicited emails from your org
41952
+ client.inboxes.lists.create(
41953
+ "agent@yourdomain.com", "receive", "allow", entry="yourdomain.com"
41954
+ )
41955
+
41956
+ # Replies to emails the agent sends (e.g., restaurant reservations)
41957
+ # are allowed by default, no reply list configuration needed.
41958
+ # Optionally block specific reply senders:
41959
+ client.inboxes.lists.create(
41960
+ "agent@yourdomain.com", "reply", "block", entry="spam-restaurant.com"
41961
+ )
41962
+ ```
41963
+
40651
41964
  ## Why this matters for agents
40652
41965
 
40653
41966
  Without guardrails, an autonomous agent could email the wrong people, respond to phishing attempts, or get caught in infinite email loops with another bot. Lists are your safety rails. They are especially important for:
@@ -40655,6 +41968,7 @@ Without guardrails, an autonomous agent could email the wrong people, respond to
40655
41968
  * **Production agents** operating with minimal human oversight
40656
41969
  * **Outreach agents** that should only contact approved recipients
40657
41970
  * **Support agents** that should only respond to known customers
41971
+ * **Task-oriented agents** that send outbound emails and need replies to come through
40658
41972
  * **Any agent** that needs protection from spam, phishing, or abuse
40659
41973
 
40660
41974
  For more details on the Lists API, see the [Lists core concept](/lists) documentation.