agentmail 0.4.16 → 0.4.18

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 (52) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/events/types/EventType.d.ts +2 -0
  3. package/dist/cjs/api/resources/events/types/EventType.js +2 -0
  4. package/dist/cjs/api/resources/events/types/MessageReceivedBlockedEvent.d.ts +11 -0
  5. package/dist/cjs/api/resources/events/types/MessageReceivedBlockedEvent.js +3 -0
  6. package/dist/cjs/api/resources/events/types/MessageReceivedSpamEvent.d.ts +11 -0
  7. package/dist/cjs/api/resources/events/types/MessageReceivedSpamEvent.js +3 -0
  8. package/dist/cjs/api/resources/events/types/index.d.ts +2 -0
  9. package/dist/cjs/api/resources/events/types/index.js +2 -0
  10. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.d.ts +19 -0
  11. package/dist/cjs/api/resources/inboxes/resources/messages/client/Client.js +61 -0
  12. package/dist/cjs/api/resources/websockets/client/Socket.d.ts +1 -1
  13. package/dist/cjs/serialization/resources/events/types/EventType.d.ts +1 -1
  14. package/dist/cjs/serialization/resources/events/types/EventType.js +2 -0
  15. package/dist/cjs/serialization/resources/events/types/MessageReceivedBlockedEvent.d.ts +16 -0
  16. package/dist/cjs/serialization/resources/events/types/MessageReceivedBlockedEvent.js +48 -0
  17. package/dist/cjs/serialization/resources/events/types/MessageReceivedSpamEvent.d.ts +16 -0
  18. package/dist/cjs/serialization/resources/events/types/MessageReceivedSpamEvent.js +48 -0
  19. package/dist/cjs/serialization/resources/events/types/index.d.ts +2 -0
  20. package/dist/cjs/serialization/resources/events/types/index.js +2 -0
  21. package/dist/cjs/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.ts +4 -2
  22. package/dist/cjs/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.js +4 -0
  23. package/dist/cjs/version.d.ts +1 -1
  24. package/dist/cjs/version.js +1 -1
  25. package/dist/esm/BaseClient.mjs +2 -2
  26. package/dist/esm/api/resources/events/types/EventType.d.mts +2 -0
  27. package/dist/esm/api/resources/events/types/EventType.mjs +2 -0
  28. package/dist/esm/api/resources/events/types/MessageReceivedBlockedEvent.d.mts +11 -0
  29. package/dist/esm/api/resources/events/types/MessageReceivedBlockedEvent.mjs +2 -0
  30. package/dist/esm/api/resources/events/types/MessageReceivedSpamEvent.d.mts +11 -0
  31. package/dist/esm/api/resources/events/types/MessageReceivedSpamEvent.mjs +2 -0
  32. package/dist/esm/api/resources/events/types/index.d.mts +2 -0
  33. package/dist/esm/api/resources/events/types/index.mjs +2 -0
  34. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.d.mts +19 -0
  35. package/dist/esm/api/resources/inboxes/resources/messages/client/Client.mjs +61 -0
  36. package/dist/esm/api/resources/websockets/client/Socket.d.mts +1 -1
  37. package/dist/esm/serialization/resources/events/types/EventType.d.mts +1 -1
  38. package/dist/esm/serialization/resources/events/types/EventType.mjs +2 -0
  39. package/dist/esm/serialization/resources/events/types/MessageReceivedBlockedEvent.d.mts +16 -0
  40. package/dist/esm/serialization/resources/events/types/MessageReceivedBlockedEvent.mjs +12 -0
  41. package/dist/esm/serialization/resources/events/types/MessageReceivedSpamEvent.d.mts +16 -0
  42. package/dist/esm/serialization/resources/events/types/MessageReceivedSpamEvent.mjs +12 -0
  43. package/dist/esm/serialization/resources/events/types/index.d.mts +2 -0
  44. package/dist/esm/serialization/resources/events/types/index.mjs +2 -0
  45. package/dist/esm/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.d.mts +4 -2
  46. package/dist/esm/serialization/resources/websockets/client/socket/WebsocketsSocketResponse.mjs +4 -0
  47. package/dist/esm/version.d.mts +1 -1
  48. package/dist/esm/version.mjs +1 -1
  49. package/dist/llms-full.txt +606 -77
  50. package/dist/llms.txt +2 -0
  51. package/package.json +1 -1
  52. package/reference.md +76 -0
@@ -3207,6 +3207,10 @@ A restricted API key cannot create a child key with more permissions than itself
3207
3207
  When a label visibility permission is denied, items with that label are automatically excluded from list results and return "not found" on direct access. For example, setting `label_spam_read` to `false` means the key will never see spam messages in any listing or lookup.
3208
3208
  </Info>
3209
3209
 
3210
+ <Callout intent="info" title="Event subscriptions">
3211
+ Label visibility permissions also control whether an API key can subscribe to the corresponding event types on [webhooks](/events) and [WebSockets](/websockets). An API key without `label_spam_read` cannot create a webhook or WebSocket subscription for `message.received.spam` events, and an API key without `label_blocked_read` cannot subscribe to `message.received.blocked` events.
3212
+ </Callout>
3213
+
3210
3214
  ### Drafts
3211
3215
 
3212
3216
  | Permission | Description |
@@ -5109,6 +5113,82 @@ python agent.py console
5109
5113
  ```
5110
5114
 
5111
5115
 
5116
+ ***
5117
+
5118
+ title: Sim.ai
5119
+ subtitle: Connect AgentMail to your Sim.ai workflows
5120
+ slug: integrations/sim
5121
+ description: AgentMail's Sim.ai integration
5122
+ -------------------------------------------
5123
+
5124
+ ## Getting started
5125
+
5126
+ [Sim.ai](https://sim.ai) is a platform for building agentic workflows. By connecting AgentMail to Sim, your workflows can create inboxes, send and receive emails, manage threads, handle drafts, and organize conversations with labels, all without writing backend code.
5127
+
5128
+ ## Use cases
5129
+
5130
+ * **Dynamic inbox creation:** Spin up new inboxes on the fly for each agent, workflow, or customer for multi-tenant email handling.
5131
+ * **Automated email processing:** List and read incoming messages, then trigger downstream actions based on content, sender, or labels.
5132
+ * **Conversational email:** Reply to threads and forward messages to keep conversations flowing naturally within automated workflows.
5133
+ * **Draft and review workflows:** Create drafts, update them with AI-generated content, and send when approved for human-in-the-loop patterns.
5134
+ * **Email organization:** Apply labels to threads and messages to categorize, filter, and route emails through your automation pipeline.
5135
+
5136
+ ## Prerequisites
5137
+
5138
+ 1. An [AgentMail account](https://agentmail.to/) with an API key from the [AgentMail Console](https://console.agentmail.to)
5139
+ 2. A [Sim.ai](https://sim.ai) account
5140
+
5141
+ ## Setup
5142
+
5143
+ 1. Open your workflow in the Sim builder.
5144
+ 2. Add the **AgentMail** block from the tools panel.
5145
+ 3. Paste your AgentMail API key into the configuration.
5146
+ 4. Select the operation you need (for example, create inbox, send message, or list threads).
5147
+ 5. Map the input fields to your workflow data and connect the block to the rest of your flow.
5148
+
5149
+ ## Available operations
5150
+
5151
+ Once connected, Sim provides access to the following AgentMail operations:
5152
+
5153
+ ### Inbox management
5154
+
5155
+ | Operation | Description |
5156
+ | ------------ | ---------------------------------------------------------------------- |
5157
+ | Create inbox | Create a new inbox with an optional username, domain, and display name |
5158
+ | Get inbox | Retrieve details for a specific inbox |
5159
+ | Delete inbox | Delete an inbox |
5160
+
5161
+ ### Message operations
5162
+
5163
+ | Operation | Description |
5164
+ | ---------------- | ---------------------------------------- |
5165
+ | Send message | Send a new email from an inbox |
5166
+ | Get message | Retrieve details of a specific message |
5167
+ | Reply to message | Reply to an existing message in a thread |
5168
+ | Forward message | Forward a message to new recipients |
5169
+
5170
+ ### Thread management
5171
+
5172
+ | Operation | Description |
5173
+ | ------------- | ---------------------------------------------------------------------------- |
5174
+ | Get thread | Retrieve a thread and its messages |
5175
+ | Delete thread | Delete a thread (moves to trash, or permanently deletes if already in trash) |
5176
+
5177
+ ### Draft management
5178
+
5179
+ | Operation | Description |
5180
+ | ------------ | ------------------------------------ |
5181
+ | Create draft | Create a new email draft in an inbox |
5182
+ | Get draft | Retrieve details of a specific draft |
5183
+ | Delete draft | Delete a draft |
5184
+
5185
+ ## Resources
5186
+
5187
+ * [Sim.ai AgentMail tool documentation](https://docs.sim.ai/tools/agentmail)
5188
+ * [AgentMail API reference](/api-reference)
5189
+ * [Webhooks overview](/webhooks/webhooks-overview)
5190
+
5191
+
5112
5192
  ***
5113
5193
 
5114
5194
  title: 'Guide: Sending & Receiving Email'
@@ -6367,11 +6447,13 @@ This event-driven approach is more efficient and allows you to build fast, respo
6367
6447
 
6368
6448
  ## Available Events
6369
6449
 
6370
- AgentMail supports seven webhook event types. When creating a webhook, you can subscribe to specific events or receive all of them. See [Webhook Events](/events) for full payload details.
6450
+ AgentMail supports nine webhook event types. When creating a webhook, you can subscribe to specific events or receive all of them. See [Webhook Events](/events) for full payload details.
6371
6451
 
6372
6452
  **Message events:**
6373
6453
 
6374
6454
  * **`message.received`** — New email received and processed in one of your inboxes
6455
+ * **`message.received.spam`** — A message was received and classified as spam (requires `label_spam_read` permission)
6456
+ * **`message.received.blocked`** — A message was received and matched a block list entry (requires `label_blocked_read` permission)
6375
6457
  * **`message.sent`** — Message successfully sent from your inbox
6376
6458
  * **`message.delivered`** — Delivery confirmed by the recipient's mail server
6377
6459
  * **`message.bounced`** — Message failed to deliver and bounced back
@@ -6382,6 +6464,10 @@ AgentMail supports seven webhook event types. When creating a webhook, you can s
6382
6464
 
6383
6465
  * **`domain.verified`** — Custom domain successfully verified
6384
6466
 
6467
+ <Callout intent="info">
6468
+ Spam and blocked events are excluded by default. To receive them, explicitly include `message.received.spam` or `message.received.blocked` in the `event_types` list when creating a webhook. Messages with these labels are no longer sent as `message.received`.
6469
+ </Callout>
6470
+
6385
6471
  ## The Webhook Workflow
6386
6472
 
6387
6473
  The process is straightforward:
@@ -6418,7 +6504,7 @@ The process is straightforward:
6418
6504
  ```
6419
6505
  </CodeBlocks>
6420
6506
 
6421
- Specify which events to receive; omit `event_types` to subscribe to all event types.
6507
+ Specify which events to receive; omit `event_types` to subscribe to all standard event types. Spam and blocked events must always be explicitly included.
6422
6508
  </Step>
6423
6509
 
6424
6510
  <Step title="3. AgentMail Sends Events">
@@ -6539,8 +6625,9 @@ Copy one of the blocks below into Cursor or Claude for complete Webhooks API kno
6539
6625
  - webhooks.update(webhook_id, add_inbox_ids?, remove_inbox_ids?, add_pod_ids?, remove_pod_ids?)
6540
6626
  - webhooks.delete(webhook_id)
6541
6627
 
6542
- Events: message.received, message.sent, message.delivered, message.bounced, message.complained, message.rejected, domain.verified
6628
+ Events: message.received, message.received.spam, message.received.blocked, message.sent, message.delivered, message.bounced, message.complained, message.rejected, domain.verified
6543
6629
  Payload: event_type, event_id, plus message/send/delivery/bounce/complaint/reject/domain. Verify with Svix (webhook.secret).
6630
+ Note: message.received.spam and message.received.blocked are excluded by default. To receive them, explicitly include them in event_types and ensure the API key has label_spam_read / label_blocked_read permissions.
6544
6631
  """
6545
6632
  import os
6546
6633
  from dotenv import load_dotenv
@@ -6567,7 +6654,8 @@ Copy one of the blocks below into Cursor or Claude for complete Webhooks API kno
6567
6654
  * - webhooks.update(webhookId, { addInboxIds?, removeInboxIds?, addPodIds?, removePodIds? })
6568
6655
  * - webhooks.delete(webhookId)
6569
6656
  *
6570
- * Events: message.received, message.sent, message.delivered, message.bounced, message.complained, message.rejected, domain.verified
6657
+ * Events: message.received, message.received.spam, message.received.blocked, message.sent, message.delivered, message.bounced, message.complained, message.rejected, domain.verified
6658
+ * Note: message.received.spam and message.received.blocked are excluded by default. To receive them, explicitly include them in eventTypes and ensure the API key has label_spam_read / label_blocked_read permissions.
6571
6659
  * Verify with Svix using webhook.secret. Use express.raw() for body—signature needs raw payload.
6572
6660
  */
6573
6661
  import { AgentMailClient } from "agentmail";
@@ -6658,6 +6746,12 @@ The AgentMail SDKs export typed classes for each webhook event, so you can parse
6658
6746
  } else if (eventType === "message.rejected") {
6659
6747
  const event = await serialization.events.MessageRejectedEvent.parse(payload);
6660
6748
  console.log(event.reject.reason);
6749
+ } else if (eventType === "message.received.spam") {
6750
+ const event = await serialization.events.MessageReceivedSpamEvent.parse(payload);
6751
+ console.log(event.message.subject);
6752
+ } else if (eventType === "message.received.blocked") {
6753
+ const event = await serialization.events.MessageReceivedBlockedEvent.parse(payload);
6754
+ console.log(event.message.subject);
6661
6755
  } else if (eventType === "domain.verified") {
6662
6756
  const event = await serialization.events.DomainVerifiedEvent.parse(payload);
6663
6757
  console.log(event.domain.status);
@@ -6668,6 +6762,8 @@ The AgentMail SDKs export typed classes for each webhook event, so you can parse
6668
6762
  ```python title="Python"
6669
6763
  from agentmail import (
6670
6764
  MessageReceivedEvent,
6765
+ MessageReceivedSpamEvent,
6766
+ MessageReceivedBlockedEvent,
6671
6767
  MessageSentEvent,
6672
6768
  MessageBouncedEvent,
6673
6769
  MessageDeliveredEvent,
@@ -6699,6 +6795,12 @@ The AgentMail SDKs export typed classes for each webhook event, so you can parse
6699
6795
  elif event_type == "message.rejected":
6700
6796
  event = MessageRejectedEvent(**payload)
6701
6797
  print(event.reject.reason)
6798
+ elif event_type == "message.received.spam":
6799
+ event = MessageReceivedSpamEvent(**payload)
6800
+ print(event.message.subject)
6801
+ elif event_type == "message.received.blocked":
6802
+ event = MessageReceivedBlockedEvent(**payload)
6803
+ print(event.message.subject)
6702
6804
  elif event_type == "domain.verified":
6703
6805
  event = DomainVerifiedEvent(**payload)
6704
6806
  print(event.domain.status)
@@ -6714,12 +6816,15 @@ Copy one of the blocks below into Cursor or Claude for webhook event parsing in
6714
6816
  """
6715
6817
  AgentMail Webhook Events — copy into Cursor/Claude.
6716
6818
 
6717
- Parse typed events: MessageReceivedEvent (has message+thread), MessageSentEvent (send), MessageBouncedEvent (bounce),
6718
- MessageDeliveredEvent (delivery), MessageComplainedEvent (complaint), MessageRejectedEvent (reject), DomainVerifiedEvent (domain).
6719
- Only message.received includes full message+thread; others have send/delivery/bounce/complaint/reject/domain.
6819
+ Parse typed events: MessageReceivedEvent (message.received), MessageReceivedSpamEvent (message.received.spam), MessageReceivedBlockedEvent (message.received.blocked),
6820
+ MessageSentEvent (send), MessageBouncedEvent (bounce), MessageDeliveredEvent (delivery), MessageComplainedEvent (complaint),
6821
+ MessageRejectedEvent (reject), DomainVerifiedEvent (domain).
6822
+ Only message.received* includes full message+thread; others have send/delivery/bounce/complaint/reject/domain.
6823
+ Note: message.received.spam and message.received.blocked require label_spam_read / label_blocked_read permissions.
6720
6824
  """
6721
6825
  from agentmail import (
6722
- MessageReceivedEvent, MessageSentEvent, MessageBouncedEvent,
6826
+ MessageReceivedEvent, MessageReceivedSpamEvent, MessageReceivedBlockedEvent,
6827
+ MessageSentEvent, MessageBouncedEvent,
6723
6828
  MessageDeliveredEvent, MessageComplainedEvent, MessageRejectedEvent, DomainVerifiedEvent,
6724
6829
  )
6725
6830
 
@@ -6731,6 +6836,8 @@ Copy one of the blocks below into Cursor or Claude for webhook event parsing in
6731
6836
  elif t == "message.delivered": e = MessageDeliveredEvent(**payload)
6732
6837
  elif t == "message.complained": e = MessageComplainedEvent(**payload)
6733
6838
  elif t == "message.rejected": e = MessageRejectedEvent(**payload); print(e.reject.reason)
6839
+ elif t == "message.received.spam": e = MessageReceivedSpamEvent(**payload); print(e.message.subject)
6840
+ elif t == "message.received.blocked": e = MessageReceivedBlockedEvent(**payload); print(e.message.subject)
6734
6841
  elif t == "domain.verified": e = DomainVerifiedEvent(**payload); print(e.domain.status)
6735
6842
  ```
6736
6843
 
@@ -6738,8 +6845,10 @@ Copy one of the blocks below into Cursor or Claude for webhook event parsing in
6738
6845
  /**
6739
6846
  * AgentMail Webhook Events — copy into Cursor/Claude.
6740
6847
  *
6741
- * Parse with serialization.events.MessageReceivedEvent.parse(payload), etc.
6742
- * Only message.received has message+thread; others have send/delivery/bounce/complaint/reject/domain.
6848
+ * Parse with serialization.events.<EventType>.parse(payload).
6849
+ * message.received MessageReceivedEvent, message.received.spam MessageReceivedSpamEvent, message.received.blocked → MessageReceivedBlockedEvent.
6850
+ * Only message.received* has message+thread; others have send/delivery/bounce/complaint/reject/domain.
6851
+ * message.received.spam and message.received.blocked require label_spam_read / label_blocked_read permissions.
6743
6852
  */
6744
6853
  import { serialization } from "agentmail";
6745
6854
 
@@ -6763,6 +6872,12 @@ Copy one of the blocks below into Cursor or Claude for webhook event parsing in
6763
6872
  } else if (t === "message.rejected") {
6764
6873
  const e = await serialization.events.MessageRejectedEvent.parse(payload);
6765
6874
  console.log(e.reject);
6875
+ } else if (t === "message.received.spam") {
6876
+ const e = await serialization.events.MessageReceivedSpamEvent.parse(payload);
6877
+ console.log(e.message.subject);
6878
+ } else if (t === "message.received.blocked") {
6879
+ const e = await serialization.events.MessageReceivedBlockedEvent.parse(payload);
6880
+ console.log(e.message.subject);
6766
6881
  } else if (t === "domain.verified") {
6767
6882
  const e = await serialization.events.DomainVerifiedEvent.parse(payload);
6768
6883
  console.log(e.domain);
@@ -6833,6 +6948,106 @@ Copy one of the blocks below into Cursor or Claude for webhook event parsing in
6833
6948
  ```
6834
6949
  </CodeGroup>
6835
6950
 
6951
+ ### `message.received.spam`
6952
+
6953
+ * **Description:** Triggered when a new email is received and classified as spam. The payload structure is the same as `message.received`. Messages classified as spam are not delivered as `message.received` events.
6954
+ * **Example use-case:** Route spam to a review queue or log spam patterns for analysis.
6955
+
6956
+ <Callout intent="warn">
6957
+ This event is only delivered if the API key used to create the webhook has the `label_spam_read` permission. Without this permission, the webhook creation will be rejected with a `403 Forbidden` error.
6958
+ </Callout>
6959
+
6960
+ <CodeGroup>
6961
+ ```json
6962
+ {
6963
+ "type": "event",
6964
+ "event_type": "message.received.spam",
6965
+ "event_id": "evt_spam123",
6966
+ "message": {
6967
+ "inbox_id": "inbox_456def",
6968
+ "thread_id": "thd_789ghi",
6969
+ "message_id": "<spam123@example.com>",
6970
+ "labels": ["spam"],
6971
+ "timestamp": "2023-10-27T10:00:00Z",
6972
+ "from": "spammer@example.com",
6973
+ "to": ["agent@agentmail.to"],
6974
+ "subject": "Suspicious offer",
6975
+ "preview": "You've been selected...",
6976
+ "text": "Full spam message body.",
6977
+ "html": "<html>...</html>",
6978
+ "size": 1024,
6979
+ "updated_at": "2023-10-27T10:00:00Z",
6980
+ "created_at": "2023-10-27T10:00:00Z"
6981
+ },
6982
+ "thread": {
6983
+ "inbox_id": "inbox_456def",
6984
+ "thread_id": "thd_789ghi",
6985
+ "labels": ["spam"],
6986
+ "timestamp": "2023-10-27T10:00:00Z",
6987
+ "senders": ["spammer@example.com"],
6988
+ "recipients": ["agent@agentmail.to"],
6989
+ "subject": "Suspicious offer",
6990
+ "preview": "You've been selected...",
6991
+ "last_message_id": "<spam123@example.com>",
6992
+ "message_count": 1,
6993
+ "size": 1024,
6994
+ "updated_at": "2023-10-27T10:00:00Z",
6995
+ "created_at": "2023-10-27T10:00:00Z"
6996
+ }
6997
+ }
6998
+ ```
6999
+ </CodeGroup>
7000
+
7001
+ ### `message.received.blocked`
7002
+
7003
+ * **Description:** Triggered when a new email is received and matched a block list entry. The payload structure is the same as `message.received`. Messages that match a block list are not delivered as `message.received` events.
7004
+ * **Example use-case:** Audit blocked senders or maintain a log of blocked messages.
7005
+
7006
+ <Callout intent="warn">
7007
+ This event is only delivered if the API key used to create the webhook has the `label_blocked_read` permission. Without this permission, the webhook creation will be rejected with a `403 Forbidden` error.
7008
+ </Callout>
7009
+
7010
+ <CodeGroup>
7011
+ ```json
7012
+ {
7013
+ "type": "event",
7014
+ "event_type": "message.received.blocked",
7015
+ "event_id": "evt_blocked456",
7016
+ "message": {
7017
+ "inbox_id": "inbox_456def",
7018
+ "thread_id": "thd_789ghi",
7019
+ "message_id": "<blocked456@example.com>",
7020
+ "labels": ["blocked"],
7021
+ "timestamp": "2023-10-27T10:00:00Z",
7022
+ "from": "blocked-sender@example.com",
7023
+ "to": ["agent@agentmail.to"],
7024
+ "subject": "Blocked message",
7025
+ "preview": "This message was blocked...",
7026
+ "text": "Full blocked message body.",
7027
+ "html": "<html>...</html>",
7028
+ "size": 512,
7029
+ "updated_at": "2023-10-27T10:00:00Z",
7030
+ "created_at": "2023-10-27T10:00:00Z"
7031
+ },
7032
+ "thread": {
7033
+ "inbox_id": "inbox_456def",
7034
+ "thread_id": "thd_789ghi",
7035
+ "labels": ["blocked"],
7036
+ "timestamp": "2023-10-27T10:00:00Z",
7037
+ "senders": ["blocked-sender@example.com"],
7038
+ "recipients": ["agent@agentmail.to"],
7039
+ "subject": "Blocked message",
7040
+ "preview": "This message was blocked...",
7041
+ "last_message_id": "<blocked456@example.com>",
7042
+ "message_count": 1,
7043
+ "size": 512,
7044
+ "updated_at": "2023-10-27T10:00:00Z",
7045
+ "created_at": "2023-10-27T10:00:00Z"
7046
+ }
7047
+ }
7048
+ ```
7049
+ </CodeGroup>
7050
+
6836
7051
  ### `message.sent`
6837
7052
 
6838
7053
  * **Description:** Triggered when a message is successfully sent from one of your `Inboxes`.
@@ -7020,6 +7235,10 @@ When creating a webhook, you can specify which events to subscribe to. This allo
7020
7235
 
7021
7236
  For example, if you only need to trigger workflows on incoming messages, you can subscribe to just `message.received`. If you're building a delivery tracking system, you might subscribe to `message.sent`, `message.delivered`, and `message.bounced`.
7022
7237
 
7238
+ <Callout intent="info">
7239
+ By default, spam and blocked events are **not** delivered. To receive them, you must explicitly include `message.received.spam` or `message.received.blocked` in the `event_types` list when creating your webhook. The API key must also have the corresponding `label_spam_read` or `label_blocked_read` permission.
7240
+ </Callout>
7241
+
7023
7242
  If you have any specific webhook notifications you would like, please ping us in the `#feature-requests` channel in the [Discord](https://discord.gg/hTYatWYWBc)
7024
7243
 
7025
7244
 
@@ -8024,6 +8243,12 @@ Subscribe(
8024
8243
  inbox_ids=["agent@agentmail.to"],
8025
8244
  event_types=["message.received", "message.sent"]
8026
8245
  )
8246
+
8247
+ # Subscribe to spam and blocked events (requires label_spam_read / label_blocked_read permissions)
8248
+ Subscribe(
8249
+ inbox_ids=["agent@agentmail.to"],
8250
+ event_types=["message.received", "message.received.spam", "message.received.blocked"]
8251
+ )
8027
8252
  ```
8028
8253
 
8029
8254
  **TypeScript:**
@@ -8047,8 +8272,19 @@ socket.sendSubscribe({
8047
8272
  inboxIds: ["agent@agentmail.to"],
8048
8273
  eventTypes: ["message.received", "message.sent"],
8049
8274
  });
8275
+
8276
+ // Subscribe to spam and blocked events (requires label_spam_read / label_blocked_read permissions)
8277
+ socket.sendSubscribe({
8278
+ type: "subscribe",
8279
+ inboxIds: ["agent@agentmail.to"],
8280
+ eventTypes: ["message.received", "message.received.spam", "message.received.blocked"],
8281
+ });
8050
8282
  ```
8051
8283
 
8284
+ <Callout intent="info">
8285
+ By default (when no `event_types` are specified), spam and blocked events are excluded from the subscription. To receive spam events, explicitly include `message.received.spam` in `event_types` and ensure the API key has the `label_spam_read` permission. The same applies to `message.received.blocked` with the `label_blocked_read` permission.
8286
+ </Callout>
8287
+
8052
8288
  ***
8053
8289
 
8054
8290
  ## Event Types
@@ -8061,14 +8297,16 @@ socket.sendSubscribe({
8061
8297
 
8062
8298
  ### Message Events
8063
8299
 
8064
- | Event | Python | TypeScript | Description |
8065
- | -------------------- | ------------------------ | ---------------------------------- | -------------------- |
8066
- | `message_received` | `MessageReceivedEvent` | `AgentMail.MessageReceivedEvent` | New email received |
8067
- | `message_sent` | `MessageSentEvent` | `AgentMail.MessageSentEvent` | Email was sent |
8068
- | `message_delivered` | `MessageDeliveredEvent` | `AgentMail.MessageDeliveredEvent` | Email was delivered |
8069
- | `message_bounced` | `MessageBouncedEvent` | `AgentMail.MessageBouncedEvent` | Email bounced |
8070
- | `message_complained` | `MessageComplainedEvent` | `AgentMail.MessageComplainedEvent` | Email marked as spam |
8071
- | `message_rejected` | `MessageRejectedEvent` | `AgentMail.MessageRejectedEvent` | Email was rejected |
8300
+ | Event | Python | TypeScript | Description |
8301
+ | -------------------------- | ----------------------------- | --------------------------------------- | ------------------------------------------ |
8302
+ | `message_received` | `MessageReceivedEvent` | `AgentMail.MessageReceivedEvent` | New email received |
8303
+ | `message_received_spam` | `MessageReceivedSpamEvent` | `AgentMail.MessageReceivedSpamEvent` | Email received, classified as spam |
8304
+ | `message_received_blocked` | `MessageReceivedBlockedEvent` | `AgentMail.MessageReceivedBlockedEvent` | Email received, matched a block list entry |
8305
+ | `message_sent` | `MessageSentEvent` | `AgentMail.MessageSentEvent` | Email was sent |
8306
+ | `message_delivered` | `MessageDeliveredEvent` | `AgentMail.MessageDeliveredEvent` | Email was delivered |
8307
+ | `message_bounced` | `MessageBouncedEvent` | `AgentMail.MessageBouncedEvent` | Email bounced |
8308
+ | `message_complained` | `MessageComplainedEvent` | `AgentMail.MessageComplainedEvent` | Email marked as spam |
8309
+ | `message_rejected` | `MessageRejectedEvent` | `AgentMail.MessageRejectedEvent` | Email was rejected |
8072
8310
 
8073
8311
  ### Domain Events
8074
8312
 
@@ -8180,7 +8418,8 @@ Copy one of the blocks below into Cursor or Claude for WebSockets in one shot.
8180
8418
  Sync: with client.websockets.connect() as socket: socket.send_subscribe(Subscribe(inbox_ids=[...])); for event in socket: ...
8181
8419
  Async: async with client.websockets.connect() as socket: await socket.send_subscribe(...); async for event in socket: ...
8182
8420
  Subscribe(inbox_ids=[...], pod_ids=[...], event_types=[...])
8183
- Event types: Subscribed, MessageReceivedEvent, MessageSentEvent, MessageDeliveredEvent, MessageBouncedEvent, MessageComplainedEvent, MessageRejectedEvent, DomainVerifiedEvent
8421
+ Event types: Subscribed, MessageReceivedEvent, MessageReceivedSpamEvent, MessageReceivedBlockedEvent, MessageSentEvent, MessageDeliveredEvent, MessageBouncedEvent, MessageComplainedEvent, MessageRejectedEvent, DomainVerifiedEvent
8422
+ Spam/blocked events require explicit opt-in via event_types and label_spam_read / label_blocked_read permissions.
8184
8423
  """
8185
8424
  from agentmail import AgentMail, Subscribe, Subscribed, MessageReceivedEvent
8186
8425
 
@@ -17882,6 +18121,242 @@ let dataTask = session.dataTask(with: request as URLRequest, completionHandler:
17882
18121
  dataTask.resume()
17883
18122
  ```
17884
18123
 
18124
+ # Delete Message
18125
+
18126
+ DELETE https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/{message_id}
18127
+
18128
+ Permanently deletes a message.
18129
+
18130
+ **CLI:**
18131
+ ```bash
18132
+ agentmail inboxes:messages delete --inbox-id <inbox_id> --message-id <message_id>
18133
+ ```
18134
+
18135
+ Reference: https://docs.agentmail.to/api-reference/inboxes/messages/delete
18136
+
18137
+ ## OpenAPI Specification
18138
+
18139
+ ```yaml
18140
+ openapi: 3.1.0
18141
+ info:
18142
+ title: api
18143
+ version: 1.0.0
18144
+ paths:
18145
+ /v0/inboxes/{inbox_id}/messages/{message_id}:
18146
+ delete:
18147
+ operationId: delete
18148
+ summary: Delete Message
18149
+ description: >-
18150
+ Permanently deletes a message.
18151
+
18152
+
18153
+ **CLI:**
18154
+
18155
+ ```bash
18156
+
18157
+ agentmail inboxes:messages delete --inbox-id <inbox_id> --message-id
18158
+ <message_id>
18159
+
18160
+ ```
18161
+ tags:
18162
+ - subpackage_inboxes.subpackage_inboxes/messages
18163
+ parameters:
18164
+ - name: inbox_id
18165
+ in: path
18166
+ required: true
18167
+ schema:
18168
+ $ref: '#/components/schemas/type_inboxes:InboxId'
18169
+ - name: message_id
18170
+ in: path
18171
+ required: true
18172
+ schema:
18173
+ $ref: '#/components/schemas/type_messages:MessageId'
18174
+ - name: Authorization
18175
+ in: header
18176
+ description: Bearer authentication
18177
+ required: true
18178
+ schema:
18179
+ type: string
18180
+ responses:
18181
+ '200':
18182
+ description: Successful response
18183
+ '404':
18184
+ description: Error response with status 404
18185
+ content:
18186
+ application/json:
18187
+ schema:
18188
+ $ref: '#/components/schemas/type_:ErrorResponse'
18189
+ servers:
18190
+ - url: https://api.agentmail.to
18191
+ - url: https://x402.api.agentmail.to
18192
+ - url: https://mpp.api.agentmail.to
18193
+ - url: https://api.agentmail.eu
18194
+ components:
18195
+ schemas:
18196
+ type_inboxes:InboxId:
18197
+ type: string
18198
+ description: The ID of the inbox.
18199
+ title: InboxId
18200
+ type_messages:MessageId:
18201
+ type: string
18202
+ description: ID of message.
18203
+ title: MessageId
18204
+ type_:ErrorName:
18205
+ type: string
18206
+ description: Name of error.
18207
+ title: ErrorName
18208
+ type_:ErrorMessage:
18209
+ type: string
18210
+ description: Error message.
18211
+ title: ErrorMessage
18212
+ type_:ErrorResponse:
18213
+ type: object
18214
+ properties:
18215
+ name:
18216
+ $ref: '#/components/schemas/type_:ErrorName'
18217
+ message:
18218
+ $ref: '#/components/schemas/type_:ErrorMessage'
18219
+ required:
18220
+ - name
18221
+ - message
18222
+ title: ErrorResponse
18223
+ securitySchemes:
18224
+ Bearer:
18225
+ type: http
18226
+ scheme: bearer
18227
+
18228
+ ```
18229
+
18230
+ ## SDK Code Examples
18231
+
18232
+ ```typescript
18233
+ import { AgentMailClient } from "agentmail";
18234
+
18235
+ async function main() {
18236
+ const client = new AgentMailClient({
18237
+ apiKey: "YOUR_TOKEN_HERE",
18238
+ });
18239
+ await client.inboxes.messages.delete("inbox_id", "message_id");
18240
+ }
18241
+ main();
18242
+
18243
+ ```
18244
+
18245
+ ```python
18246
+ from agentmail import AgentMail
18247
+
18248
+ client = AgentMail(
18249
+ api_key="YOUR_TOKEN_HERE",
18250
+ )
18251
+
18252
+ client.inboxes.messages.delete(
18253
+ inbox_id="inbox_id",
18254
+ message_id="message_id",
18255
+ )
18256
+
18257
+ ```
18258
+
18259
+ ```go
18260
+ package main
18261
+
18262
+ import (
18263
+ "fmt"
18264
+ "net/http"
18265
+ "io"
18266
+ )
18267
+
18268
+ func main() {
18269
+
18270
+ url := "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id"
18271
+
18272
+ req, _ := http.NewRequest("DELETE", url, nil)
18273
+
18274
+ req.Header.Add("Authorization", "Bearer <api_key>")
18275
+
18276
+ res, _ := http.DefaultClient.Do(req)
18277
+
18278
+ defer res.Body.Close()
18279
+ body, _ := io.ReadAll(res.Body)
18280
+
18281
+ fmt.Println(res)
18282
+ fmt.Println(string(body))
18283
+
18284
+ }
18285
+ ```
18286
+
18287
+ ```ruby
18288
+ require 'uri'
18289
+ require 'net/http'
18290
+
18291
+ url = URI("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id")
18292
+
18293
+ http = Net::HTTP.new(url.host, url.port)
18294
+ http.use_ssl = true
18295
+
18296
+ request = Net::HTTP::Delete.new(url)
18297
+ request["Authorization"] = 'Bearer <api_key>'
18298
+
18299
+ response = http.request(request)
18300
+ puts response.read_body
18301
+ ```
18302
+
18303
+ ```java
18304
+ import com.mashape.unirest.http.HttpResponse;
18305
+ import com.mashape.unirest.http.Unirest;
18306
+
18307
+ HttpResponse<String> response = Unirest.delete("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id")
18308
+ .header("Authorization", "Bearer <api_key>")
18309
+ .asString();
18310
+ ```
18311
+
18312
+ ```php
18313
+ <?php
18314
+ require_once('vendor/autoload.php');
18315
+
18316
+ $client = new \GuzzleHttp\Client();
18317
+
18318
+ $response = $client->request('DELETE', 'https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id', [
18319
+ 'headers' => [
18320
+ 'Authorization' => 'Bearer <api_key>',
18321
+ ],
18322
+ ]);
18323
+
18324
+ echo $response->getBody();
18325
+ ```
18326
+
18327
+ ```csharp
18328
+ using RestSharp;
18329
+
18330
+ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id");
18331
+ var request = new RestRequest(Method.DELETE);
18332
+ request.AddHeader("Authorization", "Bearer <api_key>");
18333
+ IRestResponse response = client.Execute(request);
18334
+ ```
18335
+
18336
+ ```swift
18337
+ import Foundation
18338
+
18339
+ let headers = ["Authorization": "Bearer <api_key>"]
18340
+
18341
+ let request = NSMutableURLRequest(url: NSURL(string: "https://api.agentmail.to/v0/inboxes/inbox_id/messages/message_id")! as URL,
18342
+ cachePolicy: .useProtocolCachePolicy,
18343
+ timeoutInterval: 10.0)
18344
+ request.httpMethod = "DELETE"
18345
+ request.allHTTPHeaderFields = headers
18346
+
18347
+ let session = URLSession.shared
18348
+ let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
18349
+ if (error != nil) {
18350
+ print(error as Any)
18351
+ } else {
18352
+ let httpResponse = response as? HTTPURLResponse
18353
+ print(httpResponse)
18354
+ }
18355
+ })
18356
+
18357
+ dataTask.resume()
18358
+ ```
18359
+
17885
18360
  # Send Message
17886
18361
 
17887
18362
  POST https://api.agentmail.to/v0/inboxes/{inbox_id}/messages/send
@@ -24315,8 +24790,6 @@ components:
24315
24790
  $ref: '#/components/schemas/type_api-keys:Name'
24316
24791
  permissions:
24317
24792
  $ref: '#/components/schemas/type_api-keys:ApiKeyPermissions'
24318
- required:
24319
- - name
24320
24793
  title: CreateApiKeyRequest
24321
24794
  type_api-keys:ApiKeyId:
24322
24795
  type: string
@@ -24406,9 +24879,7 @@ async function main() {
24406
24879
  const client = new AgentMailClient({
24407
24880
  apiKey: "YOUR_TOKEN_HERE",
24408
24881
  });
24409
- await client.inboxes.apiKeys.create("inbox_id", {
24410
- name: "name",
24411
- });
24882
+ await client.inboxes.apiKeys.create("inbox_id", {});
24412
24883
  }
24413
24884
  main();
24414
24885
 
@@ -24423,7 +24894,6 @@ client = AgentMail(
24423
24894
 
24424
24895
  client.inboxes.api_keys.create(
24425
24896
  inbox_id="inbox_id",
24426
- name="name",
24427
24897
  )
24428
24898
 
24429
24899
  ```
@@ -24442,7 +24912,7 @@ func main() {
24442
24912
 
24443
24913
  url := "https://api.agentmail.to/v0/inboxes/inbox_id/api-keys"
24444
24914
 
24445
- payload := strings.NewReader("{\n \"name\": \"name\"\n}")
24915
+ payload := strings.NewReader("{}")
24446
24916
 
24447
24917
  req, _ := http.NewRequest("POST", url, payload)
24448
24918
 
@@ -24472,7 +24942,7 @@ http.use_ssl = true
24472
24942
  request = Net::HTTP::Post.new(url)
24473
24943
  request["Authorization"] = 'Bearer <api_key>'
24474
24944
  request["Content-Type"] = 'application/json'
24475
- request.body = "{\n \"name\": \"name\"\n}"
24945
+ request.body = "{}"
24476
24946
 
24477
24947
  response = http.request(request)
24478
24948
  puts response.read_body
@@ -24485,7 +24955,7 @@ import com.mashape.unirest.http.Unirest;
24485
24955
  HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/inboxes/inbox_id/api-keys")
24486
24956
  .header("Authorization", "Bearer <api_key>")
24487
24957
  .header("Content-Type", "application/json")
24488
- .body("{\n \"name\": \"name\"\n}")
24958
+ .body("{}")
24489
24959
  .asString();
24490
24960
  ```
24491
24961
 
@@ -24496,9 +24966,7 @@ require_once('vendor/autoload.php');
24496
24966
  $client = new \GuzzleHttp\Client();
24497
24967
 
24498
24968
  $response = $client->request('POST', 'https://api.agentmail.to/v0/inboxes/inbox_id/api-keys', [
24499
- 'body' => '{
24500
- "name": "name"
24501
- }',
24969
+ 'body' => '{}',
24502
24970
  'headers' => [
24503
24971
  'Authorization' => 'Bearer <api_key>',
24504
24972
  'Content-Type' => 'application/json',
@@ -24515,7 +24983,7 @@ var client = new RestClient("https://api.agentmail.to/v0/inboxes/inbox_id/api-ke
24515
24983
  var request = new RestRequest(Method.POST);
24516
24984
  request.AddHeader("Authorization", "Bearer <api_key>");
24517
24985
  request.AddHeader("Content-Type", "application/json");
24518
- request.AddParameter("application/json", "{\n \"name\": \"name\"\n}", ParameterType.RequestBody);
24986
+ request.AddParameter("application/json", "{}", ParameterType.RequestBody);
24519
24987
  IRestResponse response = client.Execute(request);
24520
24988
  ```
24521
24989
 
@@ -24526,7 +24994,7 @@ let headers = [
24526
24994
  "Authorization": "Bearer <api_key>",
24527
24995
  "Content-Type": "application/json"
24528
24996
  ]
24529
- let parameters = ["name": "name"] as [String : Any]
24997
+ let parameters = [] as [String : Any]
24530
24998
 
24531
24999
  let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
24532
25000
 
@@ -27889,6 +28357,8 @@ components:
27889
28357
  type: string
27890
28358
  enum:
27891
28359
  - message.received
28360
+ - message.received.spam
28361
+ - message.received.blocked
27892
28362
  - message.sent
27893
28363
  - message.delivered
27894
28364
  - message.bounced
@@ -28181,6 +28651,8 @@ components:
28181
28651
  type: string
28182
28652
  enum:
28183
28653
  - message.received
28654
+ - message.received.spam
28655
+ - message.received.blocked
28184
28656
  - message.sent
28185
28657
  - message.delivered
28186
28658
  - message.bounced
@@ -28477,6 +28949,8 @@ components:
28477
28949
  type: string
28478
28950
  enum:
28479
28951
  - message.received
28952
+ - message.received.spam
28953
+ - message.received.blocked
28480
28954
  - message.sent
28481
28955
  - message.delivered
28482
28956
  - message.bounced
@@ -28871,6 +29345,8 @@ components:
28871
29345
  type: string
28872
29346
  enum:
28873
29347
  - message.received
29348
+ - message.received.spam
29349
+ - message.received.blocked
28874
29350
  - message.sent
28875
29351
  - message.delivered
28876
29352
  - message.bounced
@@ -30640,19 +31116,23 @@ channels:
30640
31116
  - $ref: >-
30641
31117
  #/components/messages/subpackage_websockets.websockets-server-1-message_received
30642
31118
  - $ref: >-
30643
- #/components/messages/subpackage_websockets.websockets-server-2-message_sent
31119
+ #/components/messages/subpackage_websockets.websockets-server-2-message_received_spam
30644
31120
  - $ref: >-
30645
- #/components/messages/subpackage_websockets.websockets-server-3-message_delivered
31121
+ #/components/messages/subpackage_websockets.websockets-server-3-message_received_blocked
30646
31122
  - $ref: >-
30647
- #/components/messages/subpackage_websockets.websockets-server-4-message_bounced
31123
+ #/components/messages/subpackage_websockets.websockets-server-4-message_sent
30648
31124
  - $ref: >-
30649
- #/components/messages/subpackage_websockets.websockets-server-5-message_complained
31125
+ #/components/messages/subpackage_websockets.websockets-server-5-message_delivered
30650
31126
  - $ref: >-
30651
- #/components/messages/subpackage_websockets.websockets-server-6-message_rejected
31127
+ #/components/messages/subpackage_websockets.websockets-server-6-message_bounced
30652
31128
  - $ref: >-
30653
- #/components/messages/subpackage_websockets.websockets-server-7-domain_verified
31129
+ #/components/messages/subpackage_websockets.websockets-server-7-message_complained
30654
31130
  - $ref: >-
30655
- #/components/messages/subpackage_websockets.websockets-server-8-error
31131
+ #/components/messages/subpackage_websockets.websockets-server-8-message_rejected
31132
+ - $ref: >-
31133
+ #/components/messages/subpackage_websockets.websockets-server-9-domain_verified
31134
+ - $ref: >-
31135
+ #/components/messages/subpackage_websockets.websockets-server-10-error
30656
31136
  subscribe:
30657
31137
  operationId: websockets-subscribe
30658
31138
  summary: Client message
@@ -30684,31 +31164,39 @@ components:
30684
31164
  name: message_received
30685
31165
  payload:
30686
31166
  $ref: '#/components/schemas/type_events:MessageReceivedEvent'
30687
- subpackage_websockets.websockets-server-2-message_sent:
31167
+ subpackage_websockets.websockets-server-2-message_received_spam:
31168
+ name: message_received_spam
31169
+ payload:
31170
+ $ref: '#/components/schemas/type_events:MessageReceivedSpamEvent'
31171
+ subpackage_websockets.websockets-server-3-message_received_blocked:
31172
+ name: message_received_blocked
31173
+ payload:
31174
+ $ref: '#/components/schemas/type_events:MessageReceivedBlockedEvent'
31175
+ subpackage_websockets.websockets-server-4-message_sent:
30688
31176
  name: message_sent
30689
31177
  payload:
30690
31178
  $ref: '#/components/schemas/type_events:MessageSentEvent'
30691
- subpackage_websockets.websockets-server-3-message_delivered:
31179
+ subpackage_websockets.websockets-server-5-message_delivered:
30692
31180
  name: message_delivered
30693
31181
  payload:
30694
31182
  $ref: '#/components/schemas/type_events:MessageDeliveredEvent'
30695
- subpackage_websockets.websockets-server-4-message_bounced:
31183
+ subpackage_websockets.websockets-server-6-message_bounced:
30696
31184
  name: message_bounced
30697
31185
  payload:
30698
31186
  $ref: '#/components/schemas/type_events:MessageBouncedEvent'
30699
- subpackage_websockets.websockets-server-5-message_complained:
31187
+ subpackage_websockets.websockets-server-7-message_complained:
30700
31188
  name: message_complained
30701
31189
  payload:
30702
31190
  $ref: '#/components/schemas/type_events:MessageComplainedEvent'
30703
- subpackage_websockets.websockets-server-6-message_rejected:
31191
+ subpackage_websockets.websockets-server-8-message_rejected:
30704
31192
  name: message_rejected
30705
31193
  payload:
30706
31194
  $ref: '#/components/schemas/type_events:MessageRejectedEvent'
30707
- subpackage_websockets.websockets-server-7-domain_verified:
31195
+ subpackage_websockets.websockets-server-9-domain_verified:
30708
31196
  name: domain_verified
30709
31197
  payload:
30710
31198
  $ref: '#/components/schemas/type_events:DomainVerifiedEvent'
30711
- subpackage_websockets.websockets-server-8-error:
31199
+ subpackage_websockets.websockets-server-10-error:
30712
31200
  name: error
30713
31201
  payload:
30714
31202
  $ref: '#/components/schemas/type_websockets:Error'
@@ -30717,6 +31205,8 @@ components:
30717
31205
  type: string
30718
31206
  enum:
30719
31207
  - message.received
31208
+ - message.received.spam
31209
+ - message.received.blocked
30720
31210
  - message.sent
30721
31211
  - message.delivered
30722
31212
  - message.bounced
@@ -31126,6 +31616,60 @@ components:
31126
31616
  - message
31127
31617
  - thread
31128
31618
  title: MessageReceivedEvent
31619
+ type_events:MessageReceivedSpamEvent:
31620
+ type: object
31621
+ properties:
31622
+ type:
31623
+ type: string
31624
+ enum:
31625
+ - event
31626
+ event_type:
31627
+ type: string
31628
+ enum:
31629
+ - message.received.spam
31630
+ event_id:
31631
+ $ref: '#/components/schemas/type_events:EventId'
31632
+ message:
31633
+ $ref: '#/components/schemas/type_messages:Message'
31634
+ thread:
31635
+ $ref: '#/components/schemas/type_threads:ThreadItem'
31636
+ required:
31637
+ - type
31638
+ - event_type
31639
+ - event_id
31640
+ - message
31641
+ - thread
31642
+ description: >-
31643
+ A message was received and classified as spam. Requires
31644
+ `label_spam_read` permission.
31645
+ title: MessageReceivedSpamEvent
31646
+ type_events:MessageReceivedBlockedEvent:
31647
+ type: object
31648
+ properties:
31649
+ type:
31650
+ type: string
31651
+ enum:
31652
+ - event
31653
+ event_type:
31654
+ type: string
31655
+ enum:
31656
+ - message.received.blocked
31657
+ event_id:
31658
+ $ref: '#/components/schemas/type_events:EventId'
31659
+ message:
31660
+ $ref: '#/components/schemas/type_messages:Message'
31661
+ thread:
31662
+ $ref: '#/components/schemas/type_threads:ThreadItem'
31663
+ required:
31664
+ - type
31665
+ - event_type
31666
+ - event_id
31667
+ - message
31668
+ - thread
31669
+ description: >-
31670
+ A message was received and matched a block list entry. Requires
31671
+ `label_blocked_read` permission.
31672
+ title: MessageReceivedBlockedEvent
31129
31673
  type_events:Timestamp:
31130
31674
  type: string
31131
31675
  format: date-time
@@ -35560,8 +36104,6 @@ components:
35560
36104
  $ref: '#/components/schemas/type_api-keys:Name'
35561
36105
  permissions:
35562
36106
  $ref: '#/components/schemas/type_api-keys:ApiKeyPermissions'
35563
- required:
35564
- - name
35565
36107
  title: CreateApiKeyRequest
35566
36108
  type_api-keys:ApiKeyId:
35567
36109
  type: string
@@ -35636,9 +36178,7 @@ async function main() {
35636
36178
  const client = new AgentMailClient({
35637
36179
  apiKey: "YOUR_TOKEN_HERE",
35638
36180
  });
35639
- await client.apiKeys.create({
35640
- name: "name",
35641
- });
36181
+ await client.apiKeys.create({});
35642
36182
  }
35643
36183
  main();
35644
36184
 
@@ -35651,9 +36191,7 @@ client = AgentMail(
35651
36191
  api_key="YOUR_TOKEN_HERE",
35652
36192
  )
35653
36193
 
35654
- client.api_keys.create(
35655
- name="name",
35656
- )
36194
+ client.api_keys.create()
35657
36195
 
35658
36196
  ```
35659
36197
 
@@ -35671,7 +36209,7 @@ func main() {
35671
36209
 
35672
36210
  url := "https://api.agentmail.to/v0/api-keys"
35673
36211
 
35674
- payload := strings.NewReader("{\n \"name\": \"name\"\n}")
36212
+ payload := strings.NewReader("{}")
35675
36213
 
35676
36214
  req, _ := http.NewRequest("POST", url, payload)
35677
36215
 
@@ -35701,7 +36239,7 @@ http.use_ssl = true
35701
36239
  request = Net::HTTP::Post.new(url)
35702
36240
  request["Authorization"] = 'Bearer <api_key>'
35703
36241
  request["Content-Type"] = 'application/json'
35704
- request.body = "{\n \"name\": \"name\"\n}"
36242
+ request.body = "{}"
35705
36243
 
35706
36244
  response = http.request(request)
35707
36245
  puts response.read_body
@@ -35714,7 +36252,7 @@ import com.mashape.unirest.http.Unirest;
35714
36252
  HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/api-keys")
35715
36253
  .header("Authorization", "Bearer <api_key>")
35716
36254
  .header("Content-Type", "application/json")
35717
- .body("{\n \"name\": \"name\"\n}")
36255
+ .body("{}")
35718
36256
  .asString();
35719
36257
  ```
35720
36258
 
@@ -35725,9 +36263,7 @@ require_once('vendor/autoload.php');
35725
36263
  $client = new \GuzzleHttp\Client();
35726
36264
 
35727
36265
  $response = $client->request('POST', 'https://api.agentmail.to/v0/api-keys', [
35728
- 'body' => '{
35729
- "name": "name"
35730
- }',
36266
+ 'body' => '{}',
35731
36267
  'headers' => [
35732
36268
  'Authorization' => 'Bearer <api_key>',
35733
36269
  'Content-Type' => 'application/json',
@@ -35744,7 +36280,7 @@ var client = new RestClient("https://api.agentmail.to/v0/api-keys");
35744
36280
  var request = new RestRequest(Method.POST);
35745
36281
  request.AddHeader("Authorization", "Bearer <api_key>");
35746
36282
  request.AddHeader("Content-Type", "application/json");
35747
- request.AddParameter("application/json", "{\n \"name\": \"name\"\n}", ParameterType.RequestBody);
36283
+ request.AddParameter("application/json", "{}", ParameterType.RequestBody);
35748
36284
  IRestResponse response = client.Execute(request);
35749
36285
  ```
35750
36286
 
@@ -35755,7 +36291,7 @@ let headers = [
35755
36291
  "Authorization": "Bearer <api_key>",
35756
36292
  "Content-Type": "application/json"
35757
36293
  ]
35758
- let parameters = ["name": "name"] as [String : Any]
36294
+ let parameters = [] as [String : Any]
35759
36295
 
35760
36296
  let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
35761
36297
 
@@ -45750,8 +46286,6 @@ components:
45750
46286
  $ref: '#/components/schemas/type_api-keys:Name'
45751
46287
  permissions:
45752
46288
  $ref: '#/components/schemas/type_api-keys:ApiKeyPermissions'
45753
- required:
45754
- - name
45755
46289
  title: CreateApiKeyRequest
45756
46290
  type_api-keys:ApiKeyId:
45757
46291
  type: string
@@ -45841,9 +46375,7 @@ async function main() {
45841
46375
  const client = new AgentMailClient({
45842
46376
  apiKey: "YOUR_TOKEN_HERE",
45843
46377
  });
45844
- await client.pods.apiKeys.create("pod_id", {
45845
- name: "name",
45846
- });
46378
+ await client.pods.apiKeys.create("pod_id", {});
45847
46379
  }
45848
46380
  main();
45849
46381
 
@@ -45858,7 +46390,6 @@ client = AgentMail(
45858
46390
 
45859
46391
  client.pods.api_keys.create(
45860
46392
  pod_id="pod_id",
45861
- name="name",
45862
46393
  )
45863
46394
 
45864
46395
  ```
@@ -45877,7 +46408,7 @@ func main() {
45877
46408
 
45878
46409
  url := "https://api.agentmail.to/v0/pods/pod_id/api-keys"
45879
46410
 
45880
- payload := strings.NewReader("{\n \"name\": \"name\"\n}")
46411
+ payload := strings.NewReader("{}")
45881
46412
 
45882
46413
  req, _ := http.NewRequest("POST", url, payload)
45883
46414
 
@@ -45907,7 +46438,7 @@ http.use_ssl = true
45907
46438
  request = Net::HTTP::Post.new(url)
45908
46439
  request["Authorization"] = 'Bearer <api_key>'
45909
46440
  request["Content-Type"] = 'application/json'
45910
- request.body = "{\n \"name\": \"name\"\n}"
46441
+ request.body = "{}"
45911
46442
 
45912
46443
  response = http.request(request)
45913
46444
  puts response.read_body
@@ -45920,7 +46451,7 @@ import com.mashape.unirest.http.Unirest;
45920
46451
  HttpResponse<String> response = Unirest.post("https://api.agentmail.to/v0/pods/pod_id/api-keys")
45921
46452
  .header("Authorization", "Bearer <api_key>")
45922
46453
  .header("Content-Type", "application/json")
45923
- .body("{\n \"name\": \"name\"\n}")
46454
+ .body("{}")
45924
46455
  .asString();
45925
46456
  ```
45926
46457
 
@@ -45931,9 +46462,7 @@ require_once('vendor/autoload.php');
45931
46462
  $client = new \GuzzleHttp\Client();
45932
46463
 
45933
46464
  $response = $client->request('POST', 'https://api.agentmail.to/v0/pods/pod_id/api-keys', [
45934
- 'body' => '{
45935
- "name": "name"
45936
- }',
46465
+ 'body' => '{}',
45937
46466
  'headers' => [
45938
46467
  'Authorization' => 'Bearer <api_key>',
45939
46468
  'Content-Type' => 'application/json',
@@ -45950,7 +46479,7 @@ var client = new RestClient("https://api.agentmail.to/v0/pods/pod_id/api-keys");
45950
46479
  var request = new RestRequest(Method.POST);
45951
46480
  request.AddHeader("Authorization", "Bearer <api_key>");
45952
46481
  request.AddHeader("Content-Type", "application/json");
45953
- request.AddParameter("application/json", "{\n \"name\": \"name\"\n}", ParameterType.RequestBody);
46482
+ request.AddParameter("application/json", "{}", ParameterType.RequestBody);
45954
46483
  IRestResponse response = client.Execute(request);
45955
46484
  ```
45956
46485
 
@@ -45961,7 +46490,7 @@ let headers = [
45961
46490
  "Authorization": "Bearer <api_key>",
45962
46491
  "Content-Type": "application/json"
45963
46492
  ]
45964
- let parameters = ["name": "name"] as [String : Any]
46493
+ let parameters = [] as [String : Any]
45965
46494
 
45966
46495
  let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
45967
46496