agentmail 0.4.7 → 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 (46) 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/esm/BaseClient.mjs +2 -2
  23. package/dist/esm/api/resources/inboxes/client/Client.d.mts +3 -0
  24. package/dist/esm/api/resources/inboxes/client/Client.mjs +5 -0
  25. package/dist/esm/api/resources/inboxes/resources/index.d.mts +2 -0
  26. package/dist/esm/api/resources/inboxes/resources/index.mjs +2 -0
  27. package/dist/esm/api/resources/inboxes/resources/lists/client/Client.d.mts +69 -0
  28. package/dist/esm/api/resources/inboxes/resources/lists/client/Client.mjs +274 -0
  29. package/dist/esm/api/resources/inboxes/resources/lists/client/index.d.mts +1 -0
  30. package/dist/esm/api/resources/inboxes/resources/lists/client/index.mjs +1 -0
  31. package/dist/esm/api/resources/inboxes/resources/lists/client/requests/InboxListListEntriesRequest.d.mts +9 -0
  32. package/dist/esm/api/resources/inboxes/resources/lists/client/requests/InboxListListEntriesRequest.mjs +2 -0
  33. package/dist/esm/api/resources/inboxes/resources/lists/client/requests/index.d.mts +1 -0
  34. package/dist/esm/api/resources/inboxes/resources/lists/client/requests/index.mjs +1 -0
  35. package/dist/esm/api/resources/inboxes/resources/lists/index.d.mts +1 -0
  36. package/dist/esm/api/resources/inboxes/resources/lists/index.mjs +1 -0
  37. package/dist/esm/api/resources/lists/types/Direction.d.mts +1 -0
  38. package/dist/esm/api/resources/lists/types/Direction.mjs +1 -0
  39. package/dist/esm/serialization/resources/lists/types/Direction.d.mts +1 -1
  40. package/dist/esm/serialization/resources/lists/types/Direction.mjs +1 -1
  41. package/dist/esm/version.d.mts +1 -1
  42. package/dist/esm/version.mjs +1 -1
  43. package/dist/llms-full.txt +1344 -32
  44. package/dist/llms.txt +4 -0
  45. package/package.json +1 -1
  46. 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
  ```
@@ -19857,7 +19952,920 @@ func main() {
19857
19952
  require 'uri'
19858
19953
  require 'net/http'
19859
19954
 
19860
- 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")
19861
20869
 
19862
20870
  http = Net::HTTP.new(url.host, url.port)
19863
20871
  http.use_ssl = true
@@ -19865,7 +20873,7 @@ http.use_ssl = true
19865
20873
  request = Net::HTTP::Post.new(url)
19866
20874
  request["Authorization"] = 'Bearer <api_key>'
19867
20875
  request["Content-Type"] = 'application/json'
19868
- request.body = "{}"
20876
+ request.body = "{\n \"entry\": \"entry\"\n}"
19869
20877
 
19870
20878
  response = http.request(request)
19871
20879
  puts response.read_body
@@ -19875,10 +20883,10 @@ puts response.read_body
19875
20883
  import com.mashape.unirest.http.HttpResponse;
19876
20884
  import com.mashape.unirest.http.Unirest;
19877
20885
 
19878
- 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")
19879
20887
  .header("Authorization", "Bearer <api_key>")
19880
20888
  .header("Content-Type", "application/json")
19881
- .body("{}")
20889
+ .body("{\n \"entry\": \"entry\"\n}")
19882
20890
  .asString();
19883
20891
  ```
19884
20892
 
@@ -19888,8 +20896,10 @@ require_once('vendor/autoload.php');
19888
20896
 
19889
20897
  $client = new \GuzzleHttp\Client();
19890
20898
 
19891
- $response = $client->request('POST', 'https://api.agentmail.to/v0/inboxes/inbox_id/drafts/draft_id/send', [
19892
- 'body' => '{}',
20899
+ $response = $client->request('POST', 'https://api.agentmail.to/v0/inboxes/inbox_id/lists/send/allow', [
20900
+ 'body' => '{
20901
+ "entry": "entry"
20902
+ }',
19893
20903
  'headers' => [
19894
20904
  'Authorization' => 'Bearer <api_key>',
19895
20905
  'Content-Type' => 'application/json',
@@ -19902,11 +20912,11 @@ echo $response->getBody();
19902
20912
  ```csharp
19903
20913
  using RestSharp;
19904
20914
 
19905
- 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");
19906
20916
  var request = new RestRequest(Method.POST);
19907
20917
  request.AddHeader("Authorization", "Bearer <api_key>");
19908
20918
  request.AddHeader("Content-Type", "application/json");
19909
- request.AddParameter("application/json", "{}", ParameterType.RequestBody);
20919
+ request.AddParameter("application/json", "{\n \"entry\": \"entry\"\n}", ParameterType.RequestBody);
19910
20920
  IRestResponse response = client.Execute(request);
19911
20921
  ```
19912
20922
 
@@ -19917,11 +20927,11 @@ let headers = [
19917
20927
  "Authorization": "Bearer <api_key>",
19918
20928
  "Content-Type": "application/json"
19919
20929
  ]
19920
- let parameters = [] as [String : Any]
20930
+ let parameters = ["entry": "entry"] as [String : Any]
19921
20931
 
19922
20932
  let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
19923
20933
 
19924
- 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,
19925
20935
  cachePolicy: .useProtocolCachePolicy,
19926
20936
  timeoutInterval: 10.0)
19927
20937
  request.httpMethod = "POST"
@@ -19941,6 +20951,247 @@ let dataTask = session.dataTask(with: request as URLRequest, completionHandler:
19941
20951
  dataTask.resume()
19942
20952
  ```
19943
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
+
19944
21195
  # Query Metrics
19945
21196
 
19946
21197
  GET https://api.agentmail.to/v0/inboxes/{inbox_id}/metrics
@@ -28498,6 +29749,7 @@ components:
28498
29749
  enum:
28499
29750
  - send
28500
29751
  - receive
29752
+ - reply
28501
29753
  description: Direction of list entry.
28502
29754
  title: Direction
28503
29755
  type_lists:ListType:
@@ -28782,6 +30034,7 @@ components:
28782
30034
  enum:
28783
30035
  - send
28784
30036
  - receive
30037
+ - reply
28785
30038
  description: Direction of list entry.
28786
30039
  title: Direction
28787
30040
  type_lists:ListType:
@@ -29056,6 +30309,7 @@ components:
29056
30309
  enum:
29057
30310
  - send
29058
30311
  - receive
30312
+ - reply
29059
30313
  description: Direction of list entry.
29060
30314
  title: Direction
29061
30315
  type_lists:ListType:
@@ -29357,6 +30611,7 @@ components:
29357
30611
  enum:
29358
30612
  - send
29359
30613
  - receive
30614
+ - reply
29360
30615
  description: Direction of list entry.
29361
30616
  title: Direction
29362
30617
  type_lists:ListType:
@@ -37617,6 +38872,7 @@ components:
37617
38872
  enum:
37618
38873
  - send
37619
38874
  - receive
38875
+ - reply
37620
38876
  description: Direction of list entry.
37621
38877
  title: Direction
37622
38878
  type_lists:ListType:
@@ -37918,6 +39174,7 @@ components:
37918
39174
  enum:
37919
39175
  - send
37920
39176
  - receive
39177
+ - reply
37921
39178
  description: Direction of list entry.
37922
39179
  title: Direction
37923
39180
  type_lists:ListType:
@@ -38209,6 +39466,7 @@ components:
38209
39466
  enum:
38210
39467
  - send
38211
39468
  - receive
39469
+ - reply
38212
39470
  description: Direction of list entry.
38213
39471
  title: Direction
38214
39472
  type_lists:ListType:
@@ -38527,6 +39785,7 @@ components:
38527
39785
  enum:
38528
39786
  - send
38529
39787
  - receive
39788
+ - reply
38530
39789
  description: Direction of list entry.
38531
39790
  title: Direction
38532
39791
  type_lists:ListType:
@@ -40579,14 +41838,16 @@ Allowlists and blocklists let you control who your AI agent can communicate with
40579
41838
 
40580
41839
  ## How Lists work
40581
41840
 
40582
- 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):
40583
41842
 
40584
- | List | What it does |
40585
- | ------------- | ---------------------------------------------------- |
40586
- | Receive allow | Only accept emails from these addresses or domains |
40587
- | Receive block | Reject emails from these addresses or domains |
40588
- | Send allow | Only send emails to these addresses or domains |
40589
- | 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 |
40590
41851
 
40591
41852
  Each entry can be either a full email address (e.g., `partner@example.com`) or an entire domain (e.g., `example.com`).
40592
41853
 
@@ -40625,6 +41886,40 @@ entries = client.lists.list("receive", "allow")
40625
41886
  client.lists.delete("receive", "block", entry="spam@example.com")
40626
41887
  ```
40627
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
+
40628
41923
  ## Common patterns for agents
40629
41924
 
40630
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.
@@ -40650,6 +41945,22 @@ client.lists.create("receive", "allow", entry="trusted-partner.com")
40650
41945
  client.lists.create("receive", "block", entry="spam-domain.com", reason="spam")
40651
41946
  ```
40652
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
+
40653
41964
  ## Why this matters for agents
40654
41965
 
40655
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:
@@ -40657,6 +41968,7 @@ Without guardrails, an autonomous agent could email the wrong people, respond to
40657
41968
  * **Production agents** operating with minimal human oversight
40658
41969
  * **Outreach agents** that should only contact approved recipients
40659
41970
  * **Support agents** that should only respond to known customers
41971
+ * **Task-oriented agents** that send outbound emails and need replies to come through
40660
41972
  * **Any agent** that needs protection from spam, phishing, or abuse
40661
41973
 
40662
41974
  For more details on the Lists API, see the [Lists core concept](/lists) documentation.