Preview: SendMock has no stable release yet. These docs follow develop.

API reference

Webhook rules

POST/api/v1/webhooks/rules

Add a rule.

CLI
sendmock webhook rule create
MCP tool
sendmock_webhook_rule_create
In the app
Webhooks > Rules > Add rule

Request body (application/json)

WebhookRuleInput : Body of POST and PATCH /api/v1/webhooks/rules.

FieldTypeDescription
namestring
A name for the rule, shown in the list.Example: Bounces to Slack
endpoint_idUlid
The endpoint each matching event is delivered to.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
eventsAppEventType[]
The event types the rule listens to.One of: email.received, email.inbound, email.opened, email.clicked, email.delivered, email.deferred, email.bounced, email.complained, email.unsubscribed, email.released, email.deleted, sms.sent, sms.status, sms.opened, sms.inbound, sms.reply_webhook, verify.started, verify.checked, verify.expired, push.sent, push.failed, http.captured, payment.created, payment.authorized, payment.succeeded, payment.failed, payment.canceled, payment.refunded, payment.partially_refunded, payment.dispute_opened, payment.dispute_updated, payment.dispute_closed, checkout.completed, checkout.expired, subscription.created, subscription.renewed, subscription.payment_failed, subscription.canceled, webhook.delivered, webhook.failed, test.ping, traffic.pruned
filterRuleFilter | null
Which messages match, combining conditions with all, any and not; null matches every event.
is_enabledboolean
Off rules are kept but skipped.Example: true

Answer

201 WebhookRule

Errors: 400, as { error: { code, message } }

Try it in Demo mode

PATCH/api/v1/webhooks/rules/{ruleId}

Change a rule; send only the changed keys.

CLI
sendmock webhook rule update <ruleId>
MCP tool
sendmock_webhook_rule_update
In the app
Webhooks > Rules > rule > Save changes, enabled switch

Request body (application/json)

WebhookRuleInputPatch

FieldTypeDescription
name?string
A name for the rule, shown in the list.Example: Bounces to Slack
endpoint_id?Ulid
The endpoint each matching event is delivered to.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
events?AppEventType[]
The event types the rule listens to.One of: email.received, email.inbound, email.opened, email.clicked, email.delivered, email.deferred, email.bounced, email.complained, email.unsubscribed, email.released, email.deleted, sms.sent, sms.status, sms.opened, sms.inbound, sms.reply_webhook, verify.started, verify.checked, verify.expired, push.sent, push.failed, http.captured, payment.created, payment.authorized, payment.succeeded, payment.failed, payment.canceled, payment.refunded, payment.partially_refunded, payment.dispute_opened, payment.dispute_updated, payment.dispute_closed, checkout.completed, checkout.expired, subscription.created, subscription.renewed, subscription.payment_failed, subscription.canceled, webhook.delivered, webhook.failed, test.ping, traffic.pruned
filter?RuleFilter | null
Which messages match, combining conditions with all, any and not; null matches every event.
is_enabled?boolean
Off rules are kept but skipped.Example: true

Answer

200 WebhookRule

Errors: 400, 404, as { error: { code, message } }

Try it in Demo mode

POST/api/v1/webhooks/rules/{ruleId}/move

Move a rule up or down; answers the reordered list.

CLI
sendmock webhook rule move <ruleId>
MCP tool
sendmock_webhook_rule_move
In the app
Webhooks > Rules > Move up, Move down

Request body (application/json)

WebhookRuleMove : Body of POST /api/v1/webhooks/rules/{ruleId}/move.

FieldTypeDescription
direction"up" | "down"
up moves the rule one place earlier in the order, down one place later.One of: up, downExample: up

Answer

200 WebhookRule[]

Errors: 404, as { error: { code, message } }

Try it in Demo mode

POST/api/v1/webhooks/rules/preview

Which recent messages an unsaved rule would match.

CLI
sendmock webhook rule preview
MCP tool
sendmock_webhook_rule_preview
In the app
Webhooks > Rules > rule sheet > Preview

Request body (application/json)

RulePreviewRequest : Body of POST /api/v1/webhooks/rules/preview.

FieldTypeDescription
eventsAppEventType[]
The event types to test, as in the rule.One of: email.received, email.inbound, email.opened, email.clicked, email.delivered, email.deferred, email.bounced, email.complained, email.unsubscribed, email.released, email.deleted, sms.sent, sms.status, sms.opened, sms.inbound, sms.reply_webhook, verify.started, verify.checked, verify.expired, push.sent, push.failed, http.captured, payment.created, payment.authorized, payment.succeeded, payment.failed, payment.canceled, payment.refunded, payment.partially_refunded, payment.dispute_opened, payment.dispute_updated, payment.dispute_closed, checkout.completed, checkout.expired, subscription.created, subscription.renewed, subscription.payment_failed, subscription.canceled, webhook.delivered, webhook.failed, test.ping, traffic.pruned
filterRuleFilter | null
The filter to test against recent messages; null matches all.

Answer

200 RulePreviewResult

Try it in Demo mode

POST/api/v1/webhooks/rules/match

Which webhooks an event would trigger, before an action fires it.

CLI
sendmock webhook rule match
MCP tool
sendmock_webhook_rule_match
In the app
Webhooks row and menu hints on every simulating action; Payload on each webhook

Request body (application/json)

WebhookRuleMatchRequest : Body of POST /api/v1/webhooks/rules/match: the event an action is about to fire.

FieldTypeDescription
event_typeAppEventType
The event the action fires.One of: email.received, email.inbound, email.opened, email.clicked, email.delivered, email.deferred, email.bounced, email.complained, email.unsubscribed, email.released, email.deleted, sms.sent, sms.status, sms.opened, sms.inbound, sms.reply_webhook, verify.started, verify.checked, verify.expired, push.sent, push.failed, http.captured, payment.created, payment.authorized, payment.succeeded, payment.failed, payment.canceled, payment.refunded, payment.partially_refunded, payment.dispute_opened, payment.dispute_updated, payment.dispute_closed, checkout.completed, checkout.expired, subscription.created, subscription.renewed, subscription.payment_failed, subscription.canceled, webhook.delivered, webhook.failed, test.ping, traffic.prunedExample: email.bounced
subject_id?Ulid
The email, SMS, payment or push notification the event is about; its stored fields are what the rule filters read.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
data?object
Filter fields by name, for a message not stored yet or the values the event changes; they win over the stored message's.
include_requests?boolean
Also render the request each matching endpoint would send for the event, with secrets masked.Example: true
webhook_endpoint_ids?Ulid[]
With include_requests, render these endpoints' requests too, as chosen for the action instead of the rules (IDs from GET /api/v1/webhooks/endpoints).

Answer

200 WebhookRuleMatchResult

Try it in Demo mode