Webhooks
Webhook endpoints, deliveries and replay.
| Method | Path | Summary |
|---|---|---|
GET | /v0/inboxes/{inbox_id}/webhooks | List Webhooks in Inbox |
POST | /v0/inboxes/{inbox_id}/webhooks | Create Webhook in Inbox |
GET | /v0/inboxes/{inbox_id}/webhooks/{webhook_id} | Get Webhook in Inbox |
PATCH | /v0/inboxes/{inbox_id}/webhooks/{webhook_id} | Update Webhook in Inbox |
DELETE | /v0/inboxes/{inbox_id}/webhooks/{webhook_id} | Delete Webhook in Inbox |
GET | /v0/inboxes/{inbox_id}/webhooks/{webhook_id}/deliveries | List Deliveries in Inbox |
POST | /v0/inboxes/{inbox_id}/webhooks/{webhook_id}/deliveries/{delivery_id}/replay | Replay Delivery in Inbox |
POST | /v0/inboxes/{inbox_id}/webhooks/{webhook_id}/test | Send Test Event in Inbox |
GET | /v0/pods/{pod_id}/webhooks | List Webhooks in Pod |
POST | /v0/pods/{pod_id}/webhooks | Create Webhook in Pod |
GET | /v0/pods/{pod_id}/webhooks/{webhook_id} | Get Webhook in Pod |
PATCH | /v0/pods/{pod_id}/webhooks/{webhook_id} | Update Webhook in Pod |
DELETE | /v0/pods/{pod_id}/webhooks/{webhook_id} | Delete Webhook in Pod |
GET | /v0/pods/{pod_id}/webhooks/{webhook_id}/deliveries | List Deliveries in Pod |
POST | /v0/pods/{pod_id}/webhooks/{webhook_id}/deliveries/{delivery_id}/replay | Replay Delivery in Pod |
POST | /v0/pods/{pod_id}/webhooks/{webhook_id}/test | Send Test Event in Pod |
GET | /v0/webhooks | List Webhooks |
POST | /v0/webhooks | Create Webhook |
GET | /v0/webhooks/{webhook_id} | Get Webhook |
PATCH | /v0/webhooks/{webhook_id} | Update Webhook |
DELETE | /v0/webhooks/{webhook_id} | Delete Webhook |
GET | /v0/webhooks/{webhook_id}/deliveries | List Deliveries |
POST | /v0/webhooks/{webhook_id}/deliveries/{delivery_id}/replay | Replay Delivery |
POST | /v0/webhooks/{webhook_id}/test | Send Test Event |
List Webhooks in Inbox
Same as List Webhooks (GET /v0/webhooks), limited to the inbox.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_read.
Path parameters
inbox_idstringRequiredQuery parameters
limitintegerpage_tokenstringascendingbooleanResponse
200 A page of webhooks (application/json)
countintegerRequiredlimitintegernext_page_tokenstringEach item of webhooks is a Webhook:
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Create Webhook in Inbox
Same as Create Webhook (POST /v0/webhooks), limited to the inbox.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_create.
Path parameters
inbox_idstringRequiredRequest body
Content type: application/json.
urlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]client_idstringinbox_idsstring[]pod_idsstring[]Response
200 A webhook with this client_id already exists; it is returned unchanged. (application/json)
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"Required201 Created (application/json)
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Get Webhook in Inbox
Same as Get Webhook (GET /v0/webhooks/{webhook_id}), limited to the inbox.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_read.
Path parameters
inbox_idstringRequiredwebhook_idstringRequiredResponse
200 The webhook (application/json)
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"RequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Update Webhook in Inbox
Same as Update Webhook (PATCH /v0/webhooks/{webhook_id}), limited to the inbox.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_update.
Path parameters
inbox_idstringRequiredwebhook_idstringRequiredRequest body
Content type: application/json.
event_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]enabledbooleanadd_inbox_idsstring[]remove_inbox_idsstring[]add_pod_idsstring[]remove_pod_idsstring[]urlstringResponse
200 The updated webhook (application/json)
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Delete Webhook in Inbox
Same as Delete Webhook (DELETE /v0/webhooks/{webhook_id}), limited to the inbox.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_delete.
Path parameters
inbox_idstringRequiredwebhook_idstringRequiredResponse
200 Deleted (application/json)
oktrueRequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
List Deliveries in Inbox
Same as List Deliveries (GET /v0/webhooks/{webhook_id}/deliveries), limited to the inbox.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_read.
Path parameters
inbox_idstringRequiredwebhook_idstringRequiredQuery parameters
limitintegerpage_tokenstringascendingbooleanstatus"pending" | "delivered" | "failed"Response
200 A page of deliveries (application/json)
countintegerRequiredlimitintegernext_page_tokenstringEach item of deliveries is a WebhookDelivery:
delivery_idstringRequiredwebhook_idstringRequiredevent_idstringRequiredevent_type"message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test"RequiredattemptintegerRequiredstatus"pending" | "delivered" | "failed"Requiredresponse_statusintegerresponse_bodystringnext_attempt_atstring (date-time)last_errorstringdelivered_atstring (date-time)created_atstring (date-time)Requiredupdated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Replay Delivery in Inbox
Same as Replay Delivery (POST /v0/webhooks/{webhook_id}/deliveries/{delivery_id}/replay), limited to the inbox.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_update.
Path parameters
inbox_idstringRequiredwebhook_idstringRequireddelivery_idstringRequiredResponse
200 The new delivery (application/json)
delivery_idstringRequiredwebhook_idstringRequiredevent_idstringRequiredevent_type"message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test"RequiredattemptintegerRequiredstatus"pending" | "delivered" | "failed"Requiredresponse_statusintegerresponse_bodystringnext_attempt_atstring (date-time)last_errorstringdelivered_atstring (date-time)created_atstring (date-time)Requiredupdated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Send Test Event in Inbox
Same as Send Test Event (POST /v0/webhooks/{webhook_id}/test), limited to the inbox.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_update.
Path parameters
inbox_idstringRequiredwebhook_idstringRequiredResponse
200 The test delivery (application/json)
delivery_idstringRequiredwebhook_idstringRequiredevent_idstringRequiredevent_type"message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test"RequiredattemptintegerRequiredstatus"pending" | "delivered" | "failed"Requiredresponse_statusintegerresponse_bodystringnext_attempt_atstring (date-time)last_errorstringdelivered_atstring (date-time)created_atstring (date-time)Requiredupdated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
List Webhooks in Pod
Same as List Webhooks (GET /v0/webhooks), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_read.
Path parameters
pod_idstringRequiredQuery parameters
limitintegerpage_tokenstringascendingbooleanResponse
200 A page of webhooks (application/json)
countintegerRequiredlimitintegernext_page_tokenstringEach item of webhooks is a Webhook:
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Create Webhook in Pod
Same as Create Webhook (POST /v0/webhooks), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_create.
Path parameters
pod_idstringRequiredRequest body
Content type: application/json.
urlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]client_idstringinbox_idsstring[]pod_idsstring[]Response
200 A webhook with this client_id already exists; it is returned unchanged. (application/json)
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"Required201 Created (application/json)
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Get Webhook in Pod
Same as Get Webhook (GET /v0/webhooks/{webhook_id}), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_read.
Path parameters
pod_idstringRequiredwebhook_idstringRequiredResponse
200 The webhook (application/json)
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"RequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Update Webhook in Pod
Same as Update Webhook (PATCH /v0/webhooks/{webhook_id}), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_update.
Path parameters
pod_idstringRequiredwebhook_idstringRequiredRequest body
Content type: application/json.
event_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]enabledbooleanadd_inbox_idsstring[]remove_inbox_idsstring[]add_pod_idsstring[]remove_pod_idsstring[]urlstringResponse
200 The updated webhook (application/json)
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Delete Webhook in Pod
Same as Delete Webhook (DELETE /v0/webhooks/{webhook_id}), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_delete.
Path parameters
pod_idstringRequiredwebhook_idstringRequiredResponse
200 Deleted (application/json)
oktrueRequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
List Deliveries in Pod
Same as List Deliveries (GET /v0/webhooks/{webhook_id}/deliveries), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_read.
Path parameters
pod_idstringRequiredwebhook_idstringRequiredQuery parameters
limitintegerpage_tokenstringascendingbooleanstatus"pending" | "delivered" | "failed"Response
200 A page of deliveries (application/json)
countintegerRequiredlimitintegernext_page_tokenstringEach item of deliveries is a WebhookDelivery:
delivery_idstringRequiredwebhook_idstringRequiredevent_idstringRequiredevent_type"message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test"RequiredattemptintegerRequiredstatus"pending" | "delivered" | "failed"Requiredresponse_statusintegerresponse_bodystringnext_attempt_atstring (date-time)last_errorstringdelivered_atstring (date-time)created_atstring (date-time)Requiredupdated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Replay Delivery in Pod
Same as Replay Delivery (POST /v0/webhooks/{webhook_id}/deliveries/{delivery_id}/replay), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_update.
Path parameters
pod_idstringRequiredwebhook_idstringRequireddelivery_idstringRequiredResponse
200 The new delivery (application/json)
delivery_idstringRequiredwebhook_idstringRequiredevent_idstringRequiredevent_type"message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test"RequiredattemptintegerRequiredstatus"pending" | "delivered" | "failed"Requiredresponse_statusintegerresponse_bodystringnext_attempt_atstring (date-time)last_errorstringdelivered_atstring (date-time)created_atstring (date-time)Requiredupdated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Send Test Event in Pod
Same as Send Test Event (POST /v0/webhooks/{webhook_id}/test), limited to the pod.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_update.
Path parameters
pod_idstringRequiredwebhook_idstringRequiredResponse
200 The test delivery (application/json)
delivery_idstringRequiredwebhook_idstringRequiredevent_idstringRequiredevent_type"message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test"RequiredattemptintegerRequiredstatus"pending" | "delivered" | "failed"Requiredresponse_statusintegerresponse_bodystringnext_attempt_atstring (date-time)last_errorstringdelivered_atstring (date-time)created_atstring (date-time)Requiredupdated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
List Webhooks
With an organization credential, every webhook of the organization, paginated. With a pod or inbox credential (or under a scoped path), the webhooks in that scope from the newest 500, in one page without next_page_token.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_read.
Query parameters
limitintegerpage_tokenstringascendingbooleanResponse
200 A page of webhooks (application/json)
countintegerRequiredlimitintegernext_page_tokenstringEach item of webhooks is a Webhook:
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Create Webhook
The response includes secret (whsec_...), the key of the X-MachineMail-Signature HMAC. See the webhooks section of this document for the request MachineMail sends for each event type.
Under /v0/pods/{pod_id} or /v0/inboxes/{inbox_id}, or with a pod- or inbox-scoped credential, the webhook belongs to that pod or inbox (pod_id, inbox_id) and never receives events outside it.
A webhook delivers no event its creator could not read: each listed event type needs its read permission (message.* needs message_read, inbox.* inbox_read, domain.* domain_read, draft.* draft_read, webhook.test webhook_read), else 403. An empty event_types from a credential without all of them is stored as the types it may read (403 when there are none).
Custom delivery headers are not supported.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_create.
Request body
Content type: application/json.
urlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]client_idstringinbox_idsstring[]pod_idsstring[]Response
200 A webhook with this client_id already exists; it is returned unchanged. (application/json)
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"Required201 Created (application/json)
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Get Webhook
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_read.
Path parameters
webhook_idstringRequiredResponse
200 The webhook (application/json)
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"RequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Update Webhook
Fields you omit are unchanged. Webhooks are never disabled automatically after failed deliveries; enabled: false is the only way to disable one. New event_types follow the same permission rule as POST /v0/webhooks, and changing url needs the read permission of every event type the webhook delivers (403 otherwise).
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_update.
Path parameters
webhook_idstringRequiredRequest body
Content type: application/json.
event_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]enabledbooleanadd_inbox_idsstring[]remove_inbox_idsstring[]add_pod_idsstring[]remove_pod_idsstring[]urlstringResponse
200 The updated webhook (application/json)
webhook_idstringRequiredurlstringRequiredevent_types("message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test")[]Requiredpod_idsstring[]inbox_idsstring[]pod_idstringinbox_idstringsecretstringRequiredenabledbooleanRequiredupdated_atstring (date-time)Requiredcreated_atstring (date-time)Requiredclient_idstringstatus"active" | "disabled"RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Delete Webhook
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_delete.
Path parameters
webhook_idstringRequiredResponse
200 Deleted (application/json)
oktrueRequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
List Deliveries
Delivery attempts of the webhook, one per event (a replay is a new delivery).
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_read.
Path parameters
webhook_idstringRequiredQuery parameters
limitintegerpage_tokenstringascendingbooleanstatus"pending" | "delivered" | "failed"Response
200 A page of deliveries (application/json)
countintegerRequiredlimitintegernext_page_tokenstringEach item of deliveries is a WebhookDelivery:
delivery_idstringRequiredwebhook_idstringRequiredevent_idstringRequiredevent_type"message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test"RequiredattemptintegerRequiredstatus"pending" | "delivered" | "failed"Requiredresponse_statusintegerresponse_bodystringnext_attempt_atstring (date-time)last_errorstringdelivered_atstring (date-time)created_atstring (date-time)Requiredupdated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
400 | Invalid request: error.type is validation and error.param names the field. |
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Replay Delivery
Queues a new delivery of the same event to the webhook and attempts it right away, even when the webhook is disabled. Returns the new delivery after that attempt.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_update.
Path parameters
webhook_idstringRequireddelivery_idstringRequiredResponse
200 The new delivery (application/json)
delivery_idstringRequiredwebhook_idstringRequiredevent_idstringRequiredevent_type"message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test"RequiredattemptintegerRequiredstatus"pending" | "delivered" | "failed"Requiredresponse_statusintegerresponse_bodystringnext_attempt_atstring (date-time)last_errorstringdelivered_atstring (date-time)created_atstring (date-time)Requiredupdated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.
Example
Send Test Event
Records a webhook.test event and delivers it to this webhook only (whatever its event_types, even when disabled), then returns the delivery after the first attempt.
Authentication: Authorization: Bearer <api key> or the dashboard mm_session cookie. Permission: webhook_update.
Path parameters
webhook_idstringRequiredResponse
200 The test delivery (application/json)
delivery_idstringRequiredwebhook_idstringRequiredevent_idstringRequiredevent_type"message.received" | "message.received.spam" | "message.received.quarantined" | "message.received.unauthenticated" | "message.received.blocked" | "message.sent" | "message.delivered" | "message.bounced" | "message.complained" | "message.rejected" | "domain.verified" | "domain.updated" | "inbox.created" | "inbox.expired" | "draft.sent" | "webhook.test"RequiredattemptintegerRequiredstatus"pending" | "delivered" | "failed"Requiredresponse_statusintegerresponse_bodystringnext_attempt_atstring (date-time)last_errorstringdelivered_atstring (date-time)created_atstring (date-time)Requiredupdated_atstring (date-time)RequiredErrors
| Status | Meaning |
|---|---|
401 | Missing, invalid, expired or revoked credential. |
403 | The credential lacks the permission or scope for this request (error.type forbidden), or MachineMail suspended the organization or its sending (account_suspended: error.message says what still works; do not retry or re-register). |
404 | Not found. Also returned for resources outside the credential scope. |
500 | Unexpected server error. |
Error bodies use the error envelope.