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

CLI reference

Webhook endpoints commands

sendmock webhook endpoint create

Add an endpoint; its signing secret is generated.

sendmock webhook endpoint create [flags]
FlagTypeDescription
--name <name>requiredstring
A name for the endpoint, shown in lists and deliveries.Example: Orders app
--url <url>requiredstring
Where deliveries are sent; can use templates.Example: http://localhost:3000/webhooks/sendmock
--method <method>requiredstring
The HTTP method of each delivery.One of: GET, POST, PUT, PATCH, DELETEExample: POST
--headers <headers>requiredobject (JSON)
Extra headers layered on top of the template's.
--extra-fields <extra-fields>requiredobject (JSON)
Extra body fields layered on top of the template's.
--template-id <template-id>requiredstring
The payload template, e.g. native (Standard Webhooks JSON) or slack.incoming_webhook.Example: native
--template-mode <template-mode>requiredstring
linked follows template updates, detached keeps its own copy.One of: linked, detachedExample: linked
--timeout-ms <timeout-ms>requirednumber
How long to wait for your app's answer, in milliseconds.Example: 10000
--retry-policy <retry-policy>requiredRetryPolicy (JSON)
When and how often failed deliveries are retried.
--enabledrequiredboolean
Off endpoints receive no deliveries. --no-enabled sets it to false.
--query-params <query-params>requiredNameValueTemplate[] (JSON)
Query parameters added to the URL.Example: [{"name":"X-Source","value":"sendmock-{{ event.type }}"}]
--body-mode <body-mode>requiredstring
How the body is built: template (the payload template), fields (name and value rows), raw (one text template) or none.One of: template, fields, raw, noneExample: template
--body-fields <body-fields>requiredEndpointBodyField[] (JSON)
The rows of fields mode.Example: [{"name":"user.email","value_type":"text","value":"{{ data.to[0].address }}"}]
--fields-encoding <fields-encoding>requiredstring
How fields mode is sent: json, form (x-www-form-urlencoded) or multipart (multipart/form-data, where file fields are fetched from their URL when sent).One of: json, form, multipartExample: json
--raw-content-type <raw-content-type>requiredstring
The content type of raw mode.Example: application/json
--raw-body <raw-body>requiredstring
The body template of raw mode.Example: {"text": "New email: {{ data.subject }}"}
--render-mode <render-mode>requiredstring
strict stops a delivery on an undefined variable, lenient renders it empty with a warning.One of: strict, lenientExample: strict

Example

sendmock webhook endpoint create --name 'Orders app' --url http://localhost:3000/webhooks/sendmock --method POST --headers '{"Authorization":"Bearer {{ vars.app_token }}"}' --extra-fields '{"environment":"local"}' --template-id native --template-mode linked --timeout-ms 10000 --retry-policy '{"max_attempts":5,"backoff_seconds":[1,5,30,120,600],"retry_on_client_errors":false}' --enabled --query-params '[{"name":"X-Source","value":"sendmock-{{ event.type }}"}]' --body-mode template --body-fields '[{"name":"user.email","value_type":"text","value":"{{ data.to[0].address }}"}]' --fields-encoding json --raw-content-type application/json --raw-body '{"text": "New email: {{ data.subject }}"}' --render-mode strict

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

API
POST/api/v1/webhooks/endpoints
MCP tool
sendmock_webhook_endpoint_create
In the app
Webhooks > Endpoints > Add endpoint

sendmock webhook endpoint delete

Delete an endpoint and its rules.

sendmock webhook endpoint delete <endpointId> [flags]
ArgumentTypeDescription
<endpointId>requiredstring
The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
FlagTypeDescription
--yesboolean
Confirms a destructive command; without it the command stops.

Example

sendmock webhook endpoint delete 01JB7T9Q2R5W8X3Y6Z1A4B7C9D --yes

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

API
DELETE/api/v1/webhooks/endpoints/{endpointId}
MCP tool
sendmock_webhook_endpoint_delete
In the app
Webhooks > Endpoints > Delete

sendmock webhook endpoint rotate-secret

New signing secret; the old one keeps working for the overlap.

sendmock webhook endpoint rotate-secret <endpointId> [flags]
ArgumentTypeDescription
<endpointId>requiredstring
The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
FlagTypeDescription
--overlap-hours <overlap-hours>requirednumber
How many hours the old secret keeps signing next to the new one (default 24).Example: 24

Example

sendmock webhook endpoint rotate-secret 01JB7T9Q2R5W8X3Y6Z1A4B7C9D --overlap-hours 24

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

API
POST/api/v1/webhooks/endpoints/{endpointId}/rotate-secret
MCP tool
sendmock_webhook_endpoint_rotate_secret
In the app
Webhooks > Endpoints > endpoint > Security > Rotate secret

sendmock webhook endpoint save-as-template

Save the endpoint's request as a custom template.

sendmock webhook endpoint save-as-template <endpointId> [flags]
ArgumentTypeDescription
<endpointId>requiredstring
The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
FlagTypeDescription
--name <name>requiredstring
The name of the new custom template.Example: Order webhook

Example

sendmock webhook endpoint save-as-template 01JB7T9Q2R5W8X3Y6Z1A4B7C9D --name 'Order webhook'

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

API
POST/api/v1/webhooks/endpoints/{endpointId}/save-as-template
MCP tool
sendmock_webhook_endpoint_save_as_template
In the app
Webhooks > Endpoints > endpoint > Request > Save as template

sendmock webhook endpoint secret

Reveal the signing secret (asked for after a confirmation).

sendmock webhook endpoint secret <endpointId> --reveal
ArgumentTypeDescription
<endpointId>requiredstring
The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
FlagTypeDescription
--revealboolean
Prints the secret in plain text instead of masked.

Example

sendmock webhook endpoint secret 01JB7T9Q2R5W8X3Y6Z1A4B7C9D --reveal

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

API
GET/api/v1/webhooks/endpoints/{endpointId}/secret
In the app
Webhooks > Endpoints > endpoint > Security > Reveal

sendmock webhook endpoint show

One endpoint; its secret masked.

sendmock webhook endpoint show <endpointId>
ArgumentTypeDescription
<endpointId>requiredstring
The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

Example

sendmock webhook endpoint show 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

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

API
GET/api/v1/webhooks/endpoints/{endpointId}
MCP tool
sendmock_webhook_endpoint_get
In the app
Webhooks > Endpoints > Edit

sendmock webhook endpoint test

Send a test.ping delivery.

sendmock webhook endpoint test <endpointId>
ArgumentTypeDescription
<endpointId>requiredstring
The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

Example

sendmock webhook endpoint test 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

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

API
POST/api/v1/webhooks/endpoints/{endpointId}/test
MCP tool
sendmock_webhook_endpoint_test
In the app
Webhooks > Endpoints > Send test

sendmock webhook endpoint update

Change an endpoint; send only the changed keys.

sendmock webhook endpoint update <endpointId> [flags]
ArgumentTypeDescription
<endpointId>requiredstring
The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
FlagTypeDescription
--name <name>string
A name for the endpoint, shown in lists and deliveries.Example: Orders app
--url <url>string
Where deliveries are sent; can use templates.Example: http://localhost:3000/webhooks/sendmock
--method <method>string
The HTTP method of each delivery.One of: GET, POST, PUT, PATCH, DELETEExample: POST
--headers <headers>object (JSON)
Extra headers layered on top of the template's.
--extra-fields <extra-fields>object (JSON)
Extra body fields layered on top of the template's.
--template-id <template-id>string
The payload template, e.g. native (Standard Webhooks JSON) or slack.incoming_webhook.Example: native
--template-mode <template-mode>string
linked follows template updates, detached keeps its own copy.One of: linked, detachedExample: linked
--timeout-ms <timeout-ms>number
How long to wait for your app's answer, in milliseconds.Example: 10000
--retry-policy <retry-policy>RetryPolicy (JSON)
When and how often failed deliveries are retried.
--enabledboolean
Off endpoints receive no deliveries. --no-enabled sets it to false.
--query-params <query-params>NameValueTemplate[] (JSON)
Query parameters added to the URL.Example: [{"name":"X-Source","value":"sendmock-{{ event.type }}"}]
--body-mode <body-mode>string
How the body is built: template (the payload template), fields (name and value rows), raw (one text template) or none.One of: template, fields, raw, noneExample: template
--body-fields <body-fields>EndpointBodyField[] (JSON)
The rows of fields mode.Example: [{"name":"user.email","value_type":"text","value":"{{ data.to[0].address }}"}]
--fields-encoding <fields-encoding>string
How fields mode is sent: json, form (x-www-form-urlencoded) or multipart (multipart/form-data, where file fields are fetched from their URL when sent).One of: json, form, multipartExample: json
--raw-content-type <raw-content-type>string
The content type of raw mode.Example: application/json
--raw-body <raw-body>string
The body template of raw mode.Example: {"text": "New email: {{ data.subject }}"}
--render-mode <render-mode>string
strict stops a delivery on an undefined variable, lenient renders it empty with a warning.One of: strict, lenientExample: strict

Example

sendmock webhook endpoint update 01JB7T9Q2R5W8X3Y6Z1A4B7C9D --name 'Orders app' --url http://localhost:3000/webhooks/sendmock

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

API
PATCH/api/v1/webhooks/endpoints/{endpointId}
MCP tool
sendmock_webhook_endpoint_update
In the app
Webhooks > Endpoints > endpoint > Save changes, enabled switch

sendmock webhook render

Render an unsaved endpoint's request against a message.

sendmock webhook render --endpoint-id <endpointId> [flags]
FlagTypeDescription
--endpoint-id <endpointId>string
A saved endpoint's own variables are used too; alone, its stored settings are rendered.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
--endpoint <endpoint>WebhookEndpointInput (JSON)
The endpoint settings to render, saved or not; left out, the saved endpoint endpoint_id names is rendered as stored.
--email-id <email-id>string
Render against this email; without an email, SMS or request ID 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
Render against this captured HTTP request.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
--variables <variables>object (JSON)
Send-time values by variable name (no vars.); they win for this render.

Example

sendmock webhook render --endpoint-id 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

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

API
POST/api/v1/webhooks/endpoints/preview
MCP tool
sendmock_webhook_render
In the app
Webhooks > Endpoints > endpoint > Request preview; Send to webhook > Preview

sendmock webhook send

Send a webhook for a chosen message or the sample, by hand.

sendmock webhook send --endpoint <endpointId> [flags]
FlagTypeDescription
--endpoint <endpointId>requiredstring
The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
--email-id <email-id>string
Send this email as the event.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
--sms-id <sms-id>string
Send this SMS as the event.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
--http-request-id <http-request-id>string
A captured HTTP request, sent as an http.captured event.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
--template-id <template-id>string
A template used for this send instead of the endpoint's request.Example: slack.incoming_webhook
--request <request>WebhookEndpointInput (JSON)
A hand-written request replacing the endpoint's, from the composer.
--variables <variables>object (JSON)
Send-time values by variable name (no vars.), for this send only.
--body <body>string
An edited body, sent as written.Example: {"text": "hello"}

Example

sendmock webhook send --endpoint 01JB7T9Q2R5W8X3Y6Z1A4B7C9D --body '{"text": "hello"}'

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

API
POST/api/v1/webhooks/endpoints/{endpointId}/send
MCP tool
sendmock_webhook_send
In the app
Mail, SMS, HTTP > Send to webhook; Webhooks > Composer > Send