For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
contact@agentmail.ccDiscord
DocumentationAPI ReferenceKnowledge BaseChangelog
DocumentationAPI ReferenceKnowledge BaseChangelog
  • API Reference
      • GETList Webhooks
      • GETGet Webhook
      • POSTCreate Webhook
      • PATCHUpdate Webhook
      • DELDelete Webhook
LogoLogo
contact@agentmail.ccDiscord
API ReferenceWebhooks

Update Webhook

PATCH
/v0/webhooks/:webhook_id
PATCH
/v0/webhooks/:webhook_id
1from agentmail import AgentMail
2
3client = AgentMail(
4 api_key="YOUR_TOKEN_HERE",
5)
6
7client.webhooks.update(
8 webhook_id="webhook_id",
9)
1{
2 "webhook_id": "webhook_id",
3 "url": "url",
4 "secret": "secret",
5 "enabled": true,
6 "updated_at": "2024-01-15T09:30:00Z",
7 "created_at": "2024-01-15T09:30:00Z",
8 "event_types": [
9 "message.received",
10 "message.received"
11 ],
12 "pod_ids": [
13 "pod_ids",
14 "pod_ids"
15 ],
16 "inbox_ids": [
17 "inbox_ids",
18 "inbox_ids"
19 ],
20 "client_id": "client_id"
21}
Update inbox or pod subscriptions, or replace the webhook's `event_types` in full when you pass a non-empty `event_types` array (see request field docs). Inbox and pod changes use add/remove lists. **CLI:** ```bash agentmail webhooks update --webhook-id <webhook_id> --add-inbox-id <inbox_id> ```
Was this page helpful?
Previous

Delete Webhook

Next
Built with

Update inbox or pod subscriptions, or replace the webhook’s event_types in full when you pass a non-empty event_types array (see request field docs). Inbox and pod changes use add/remove lists.

CLI:

$agentmail webhooks update --webhook-id <webhook_id> --add-inbox-id <inbox_id>

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

webhook_idstringRequired
ID of webhook.

Request

This endpoint expects an object.
add_inbox_idslist of stringsOptional
Inbox IDs to subscribe to the webhook.
remove_inbox_idslist of stringsOptional
Inbox IDs to unsubscribe from the webhook.
add_pod_idslist of stringsOptional
Pod IDs to subscribe to the webhook.
remove_pod_idslist of stringsOptional
Pod IDs to unsubscribe from the webhook.
event_typeslist of enumsOptional

When you send a non-empty list, it replaces the webhook’s subscribed event types in full (the same “set the list” behavior as create). It is not a merge or diff: include every event type you want after the update. Sending a one-element array means the webhook will only receive that one type afterward. Omit this field or send an empty array to leave event types unchanged. Clearing all types with an empty list is not supported. Subscribing to message.received.spam, message.received.blocked, or message.received.unauthenticated requires the matching label permission on the API key.

Response

This endpoint returns an object.
webhook_idstring
ID of webhook.
urlstring
URL of webhook endpoint.
secretstring
Secret for webhook signature verification.
enabledboolean
Webhook is enabled.
updated_atdatetime
Time at which webhook was last updated.
created_atdatetime
Time at which webhook was created.
event_typeslist of enums
Event types for which to send events.
pod_idslist of strings
Pods for which to send events. Maximum 10 per webhook.
inbox_idslist of strings
Inboxes for which to send events. Maximum 10 per webhook.
client_idstring
Client ID of webhook.

Errors

400
Validation Error
404
Not Found Error