Skip to navigation

Update Webhook

CLI:

agentmail inboxes webhooks update --inbox-id <inbox_id> --webhook-id <webhook_id> --event-types message.received

Authentication

AuthorizationBearer

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

Path parameters

inbox_idstringRequired
The ID of the inbox.
webhook_idstringRequired
ID of webhook.

Request

This endpoint expects an object.
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 to leave event types unchanged. An empty array is rejected with a 400: a webhook always has at least one event type. Subscribing to message.received.spam, message.received.blocked, or message.received.unauthenticated requires the matching label permission on the API key.

enabledbooleanOptional

Set to true to re-enable a webhook that was disabled after repeated failed deliveries, or false to disable it. AgentMail does not notify you when a webhook is disabled automatically; check this field when you get or list webhooks. Events that occurred while the webhook was disabled are not redelivered. Re-enabling requires the read permission for every restricted event type the webhook subscribes to: label_spam_read, label_blocked_read, or label_unauthenticated_read for the received variants, message_read for message.security.*, and calendar_event_read for calendar.event.*. A webhook with no event type filter is checked against all of them.

Response

This endpoint returns an object.
webhook_idstring
ID of webhook.
urlstring
URL of webhook endpoint.
secretstring
Secret for webhook signature verification.
enabledboolean

Whether the webhook is enabled. It becomes false when you disable it, and also when deliveries to the URL have failed for 5 days, in which case AgentMail sends no notification. Re-enable it with update and enabled set to true.

updated_atdatetime
Time at which webhook was last updated.
created_atdatetime
Time at which webhook was created.
event_typeslist of enumsOptional
Event types for which to send events.
pod_idslist of stringsOptional
Pods for which to send events.
inbox_idslist of stringsOptional
Inboxes for which to send events.
pod_idstringOptional

ID of the pod the webhook belongs to: the pod it was created in, or the pod of the inbox it belongs to. Absent for an organization webhook and on some inbox webhooks. This is not the list of pods it receives events for; see pod_ids.

inbox_idstringOptional

ID of the inbox the webhook belongs to, if it was created for an inbox. This is not the list of inboxes it receives events for; see inbox_ids.

client_idstringOptional
Client ID of webhook.

Errors

400
Validation Error
404
Not Found Error