Create Webhook

**CLI:** ```bash agentmail webhooks create --url https://example.com/webhook --event-type message.received ```

Authentication

AuthorizationBearer

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

Request

This endpoint expects an object.
urlstringRequired
URL of webhook endpoint.
event_typeslist of enumsRequired

Full list of event types this webhook should receive. At least one type is required. Send every type you want in this array (not incremental). See Webhooks overview for spam, blocked, and unauthenticated events and required permissions.

pod_idslist of stringsOptional
Pods for which to send events. Maximum 10 per webhook.
inbox_idslist of stringsOptional
Inboxes for which to send events. Maximum 10 per webhook.
client_idstringOptional
Client ID of webhook.

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