webhooks

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-ids <inbox_id>
patch/v0/webhooks/{webhook_id}

Request

  • Base URL
    https://api.agentmail.to
  • URL
    https://api.agentmail.to/v0/webhooks/{webhook_id}
  • Auth
    HTTP bearer

Path parameters

webhook_idstring required

ID of webhook.

Request body

event_typesEventsEventType[]

Event types for which to send events.

enabledboolean

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.

add_inbox_idsstring[]

Inboxes for which to send events.

remove_inbox_idsstring[]

Inboxes for which to send events.

add_pod_idsstring[]

Pods for which to send events.

remove_pod_idsstring[]

Pods for which to send events.

Response

Response with status 200

webhook_idstring required

ID of webhook.

urlstring required

URL of webhook endpoint.

event_typesEventsEventType[]

Event types for which to send events.

pod_idsstring[]

Pods for which to send events.

inbox_idsstring[]

Inboxes for which to send events.

pod_idstring

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_idstring

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.

secretstring required

Secret for webhook signature verification.

enabledboolean required

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_atstring date-time required

Time at which webhook was last updated.

created_atstring date-time required

Time at which webhook was created.

client_idstring

Client ID of webhook.

Changes

    • breaking

      the request property became not nullable

    • breaking

      the request property became not nullable

    • warning

      removed from the request body allOf list

    • warning

      added the new calendar.event.created enum value to the / response property for the response status

    • warning

      added the new calendar.event.deleted enum value to the / response property for the response status

    • warning

      added the new calendar.event.ending enum value to the / response property for the response status

    • warning

      added the new calendar.event.responded enum value to the / response property for the response status

    • warning

      added the new calendar.event.starting enum value to the / response property for the response status

    • warning

      added the new calendar.event.updated enum value to the / response property for the response status

    • warning

      added the new message.opened enum value to the / response property for the response status

    • warning

      added the new message.security.completed enum value to the / response property for the response status

    • warning

      added the new message.security.override enum value to the / response property for the response status

    • warning

      added the new message.security.review enum value to the / response property for the response status

    • info

      the endpoint scheme security Bearer was added to the API

    • info

      the endpoint scheme security BearerAuth was removed from the API

    • info

      api tag webhooks added

    • info

      api tag Webhooks removed

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      request body became optional

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • breaking

      added to the request body allOf list

    • warning

      removed the request property

    • warning

      removed the request property

    • warning

      removed the request property

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status