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

CLI reference

Webhook templates commands

sendmock webhook template clone

Copy a template into a new custom one.

sendmock webhook template clone <templateId> [flags]
ArgumentTypeDescription
<templateId>requiredstring
The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook
FlagTypeDescription
--name <name>requiredstring
The name of the copy.Example: Slack alerts (team)

Example

sendmock webhook template clone slack.incoming_webhook --name 'Slack alerts (team)'

Output with --json: WebhookTemplateSummary. Exit codes: 0, 1, 2, 3.

API
POST/api/v1/webhooks/templates/{templateId}/clone
MCP tool
sendmock_webhook_template_clone
In the app
Webhooks > Templates > template > Clone

sendmock webhook template create

Add a custom template, starting as native JSON.

sendmock webhook template create [flags]
FlagTypeDescription
--name <name>requiredstring
The name of the new blank custom template.Example: Order webhook

Example

sendmock webhook template create --name 'Order webhook'

Output with --json: WebhookTemplateSummary. Exit codes: 0, 1, 2.

API
POST/api/v1/webhooks/templates
MCP tool
sendmock_webhook_template_create
In the app
Webhooks > Templates > New template

sendmock webhook template delete

Delete a custom template; 409 while endpoints use it.

sendmock webhook template delete <templateId> [flags]
ArgumentTypeDescription
<templateId>requiredstring
The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook
FlagTypeDescription
--endpoints <endpoints>string
detach: endpoints that use it keep their own copy of it instead of failing.Example: detach
--yesboolean
Confirms a destructive command; without it the command stops.

Example

sendmock webhook template delete slack.incoming_webhook --endpoints detach --yes

Output with --json: nothing. Exit codes: 0, 1, 2, 3.

API
DELETE/api/v1/webhooks/templates/{templateId}
MCP tool
sendmock_webhook_template_delete
In the app
Webhooks > Templates > template > Delete

sendmock webhook template export

The template as TOML (variable names, never values).

sendmock webhook template export <templateId>
ArgumentTypeDescription
<templateId>requiredstring
The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook

Example

sendmock webhook template export slack.incoming_webhook

Output with --json: file (application/toml). Exit codes: 0, 1, 2, 3.

API
GET/api/v1/webhooks/templates/{templateId}/export
MCP tool
sendmock_webhook_template_export
In the app
Webhooks > Templates > template > Export

sendmock webhook template history

Saved revisions, newest first.

sendmock webhook template history <templateId>
ArgumentTypeDescription
<templateId>requiredstring
The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook

Example

sendmock webhook template history slack.incoming_webhook

Output with --json: TemplateRevision[]. Exit codes: 0, 1, 2, 3.

API
GET/api/v1/webhooks/templates/{templateId}/revisions
MCP tool
sendmock_webhook_template_revisions
In the app
Webhooks > Templates > template > History

sendmock webhook template import

Import a template file; 409 when the id is taken.

sendmock webhook template import <file> [flags]
ArgumentTypeDescription
<file>requiredpath
A file whose text is sent as file_text: The template file's text, TOML or JSON as exported.Example: template.toml
FlagTypeDescription
--on-conflict <on-conflict>string
What to do when the id is taken; left out, the API answers 409.One of: replace, copyExample: copy

Example

sendmock webhook template import template.toml --on-conflict copy

Output with --json: WebhookTemplateSummary. Exit codes: 0, 1, 2.

API
POST/api/v1/webhooks/templates/import
MCP tool
sendmock_webhook_template_import
In the app
Webhooks > Templates > Import a template

sendmock webhook template reference

Every value a template can read for the chosen events.

sendmock webhook template reference [flags]
FlagTypeDescription
--events <events>string
Comma-separated event types.Example: email.received,sms.received

Example

sendmock webhook template reference --events email.received,sms.received

Output with --json: TemplateReference. Exit codes: 0, 1, 2.

API
GET/api/v1/webhooks/template-reference
MCP tool
sendmock_webhook_template_reference
In the app
Webhooks > Templates > template editor > reference panel

sendmock webhook template render

Render against an email, an SMS or the sample, optionally a draft.

sendmock webhook template render <templateId> [flags]
ArgumentTypeDescription
<templateId>requiredstring
The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook
FlagTypeDescription
--email-id <email-id>string
Render against this email; with no IDs the sample event is used.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
--sms-id <sms-id>string
Render against this SMS.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
--http-request-id <http-request-id>string
A captured HTTP request, as the data of an http.captured event.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
--payment-id <payment-id>string
A payment, as the data of the event its latest state stands for.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
--draft <draft>TemplateDraft (JSON)
Unsaved edits to preview instead of the stored template.

Example

sendmock webhook template render slack.incoming_webhook

Output with --json: TemplateRenderResult. Exit codes: 0, 1, 2, 3.

API
POST/api/v1/webhooks/templates/{templateId}/render
MCP tool
sendmock_webhook_template_render
In the app
Webhooks > Templates > template > Preview

sendmock webhook template reset

Put an edited built-in template back as shipped.

sendmock webhook template reset <templateId>
ArgumentTypeDescription
<templateId>requiredstring
The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook

Example

sendmock webhook template reset slack.incoming_webhook

Output with --json: WebhookTemplateDetail. Exit codes: 0, 1, 2, 3.

API
POST/api/v1/webhooks/templates/{templateId}/reset
MCP tool
sendmock_webhook_template_reset
In the app
Webhooks > Templates > template > Reset to default

sendmock webhook template restore

Restore a revision as a new save.

sendmock webhook template restore <templateId> <revision>
ArgumentTypeDescription
<templateId>requiredstring
The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook
<revision>requiredinteger
The template revision number, from its history.Example: 1

Example

sendmock webhook template restore slack.incoming_webhook 1

Output with --json: WebhookTemplateDetail. Exit codes: 0, 1, 2, 3.

API
POST/api/v1/webhooks/templates/{templateId}/revisions/{revision}/restore
MCP tool
sendmock_webhook_template_restore
In the app
Webhooks > Templates > template > History > Restore

sendmock webhook template show

One template with its method, headers and body template.

sendmock webhook template show <templateId>
ArgumentTypeDescription
<templateId>requiredstring
The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook

Example

sendmock webhook template show slack.incoming_webhook

Output with --json: WebhookTemplateDetail. Exit codes: 0, 1, 2, 3.

API
GET/api/v1/webhooks/templates/{templateId}
MCP tool
sendmock_webhook_template_get
In the app
Webhooks > Templates > open a template

sendmock webhook template update

Edit a template; each save keeps a revision, 422 when it does not render.

sendmock webhook template update <templateId> [flags]
ArgumentTypeDescription
<templateId>requiredstring
The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook
FlagTypeDescription
--name <name>string
The template's name.Example: Order webhook
--description <description>string
What the template sends and where.Example: Posts each received email to the orders app.
--event <event>string[] (repeat for more)
The event types the template is made for.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.received"]
--required-variable <required-variable>string[] (repeat for more)
Variables an endpoint must define to use it.Example: ["app_token"]
--method <method>requiredstring
The HTTP method.One of: GET, POST, PUT, PATCH, DELETEExample: POST
--content-type <content-type>requiredstring
The body's content type.Example: application/json
--header-templates <header-templates>requiredobject (JSON)
Header name to a template, e.g. "X-Twilio-Signature": "{{ twilio_signature(...) }}".
--body-template <body-template>requiredstring
The body, a template over the event, its data and the variables.Example: {"subject": "{{ data.subject }}"}

Example

sendmock webhook template update slack.incoming_webhook --method POST --content-type application/json --header-templates '{"Authorization":"Bearer {{ vars.app_token }}"}' --body-template '{"subject": "{{ data.subject }}"}' --name 'Order webhook' --description 'Posts each received email to the orders app.'

Output with --json: WebhookTemplateDetail. Exit codes: 0, 1, 2, 3.

API
PATCH/api/v1/webhooks/templates/{templateId}
MCP tool
sendmock_webhook_template_update
In the app
Webhooks > Templates > template > Edit, Save template