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

API reference

Webhook endpoints

POST/api/v1/webhooks/endpoints

Add an endpoint; its signing secret is generated.

CLI
sendmock webhook endpoint create
MCP tool
sendmock_webhook_endpoint_create
In the app
Webhooks > Endpoints > Add endpoint

Request body (application/json)

WebhookEndpointInput : Body of POST and PATCH /api/v1/webhooks/endpoints.

FieldTypeDescription
namestring
A name for the endpoint, shown in lists and deliveries.Example: Orders app
urlstring
Where deliveries are sent; can use templates.Example: http://localhost:3000/webhooks/sendmock
methodHttpMethod
The HTTP method of each delivery.One of: GET, POST, PUT, PATCH, DELETEExample: POST
headersobject
Extra headers layered on top of the template's.
extra_fieldsobject
Extra body fields layered on top of the template's.
template_idstring
The payload template, e.g. native (Standard Webhooks JSON) or slack.incoming_webhook.Example: native
template_modeTemplateMode
linked follows template updates, detached keeps its own copy.One of: linked, detachedExample: linked
timeout_msnumber
How long to wait for your app's answer, in milliseconds.Example: 10000
retry_policyRetryPolicy
When and how often failed deliveries are retried.
is_enabledboolean
Off endpoints receive no deliveries.Example: true
query_paramsNameValueTemplate[]
Query parameters added to the URL.
body_modeEndpointBodyMode
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_fieldsEndpointBodyField[]
The rows of fields mode.
fields_encoding"json" | "form" | "multipart"
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_typestring
The content type of raw mode.Example: application/json
raw_bodystring
The body template of raw mode.Example: {"text": "New email: {{ data.subject }}"}
render_modeRenderMode
strict stops a delivery on an undefined variable, lenient renders it empty with a warning.One of: strict, lenientExample: strict

Answer

201 WebhookEndpoint

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

Try it in Demo mode

PATCH/api/v1/webhooks/endpoints/{endpointId}

Change an endpoint; send only the changed keys.

CLI
sendmock webhook endpoint update <endpointId>
MCP tool
sendmock_webhook_endpoint_update
In the app
Webhooks > Endpoints > endpoint > Save changes, enabled switch

Request body (application/json)

WebhookEndpointInputPatch

FieldTypeDescription
name?string
A name for the endpoint, shown in lists and deliveries.Example: Orders app
url?string
Where deliveries are sent; can use templates.Example: http://localhost:3000/webhooks/sendmock
method?HttpMethod
The HTTP method of each delivery.One of: GET, POST, PUT, PATCH, DELETEExample: POST
headers?object
Extra headers layered on top of the template's.
extra_fields?object
Extra body fields layered on top of the template's.
template_id?string
The payload template, e.g. native (Standard Webhooks JSON) or slack.incoming_webhook.Example: native
template_mode?TemplateMode
linked follows template updates, detached keeps its own copy.One of: linked, detachedExample: linked
timeout_ms?number
How long to wait for your app's answer, in milliseconds.Example: 10000
retry_policy?RetryPolicy
When and how often failed deliveries are retried.
is_enabled?boolean
Off endpoints receive no deliveries.Example: true
query_params?NameValueTemplate[]
Query parameters added to the URL.
body_mode?EndpointBodyMode
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?EndpointBodyField[]
The rows of fields mode.
fields_encoding?"json" | "form" | "multipart"
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?string
The content type of raw mode.Example: application/json
raw_body?string
The body template of raw mode.Example: {"text": "New email: {{ data.subject }}"}
render_mode?RenderMode
strict stops a delivery on an undefined variable, lenient renders it empty with a warning.One of: strict, lenientExample: strict

Answer

200 WebhookEndpoint

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

Try it in Demo mode

POST/api/v1/webhooks/endpoints/preview

Render an unsaved endpoint's request against a message.

CLI
sendmock webhook render --endpoint-id <endpointId>
MCP tool
sendmock_webhook_render
In the app
Webhooks > Endpoints > endpoint > Request preview; Send to webhook > Preview

Request body (application/json)

EndpointPreviewRequest : Body of POST /api/v1/webhooks/endpoints/preview.

FieldTypeDescription
endpoint?WebhookEndpointInput
The endpoint settings to render, saved or not; left out, the saved endpoint endpoint_id names is rendered as stored.
endpoint_id?Ulid
A saved endpoint's own variables are used too; alone, its stored settings are rendered.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
email_id?Ulid
Render against this email; without an email, SMS or request ID the sample event is used.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
sms_id?Ulid
Render against this SMS.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
http_request_id?Ulid
Render against this captured HTTP request.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
variables?object
Send-time values by variable name (no vars.); they win for this render.

Answer

200 EndpointPreviewResult

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

Try it in Demo mode

GET/api/v1/webhooks/endpoints/{endpointId}/secret

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

CLI
sendmock webhook endpoint secret <endpointId> --reveal
MCP tool
None: Agents may set secrets but never read them back; the CLI and UI reveal them after a confirmation.
In the app
Webhooks > Endpoints > endpoint > Security > Reveal

Answer

200 RevealedEndpointSecret

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

Try it in Demo mode

POST/api/v1/webhooks/endpoints/{endpointId}/rotate-secret

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

CLI
sendmock webhook endpoint rotate-secret <endpointId>
MCP tool
sendmock_webhook_endpoint_rotate_secret
In the app
Webhooks > Endpoints > endpoint > Security > Rotate secret

Request body (application/json)

RotateSecretRequest : Body of POST /api/v1/webhooks/endpoints/{endpointId}/rotate-secret.

FieldTypeDescription
overlap_hoursnumber
How many hours the old secret keeps signing next to the new one (default 24).Example: 24

Answer

200 WebhookEndpoint

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

Try it in Demo mode

POST/api/v1/webhooks/endpoints/{endpointId}/save-as-template

Save the endpoint's request as a custom template.

CLI
sendmock webhook endpoint save-as-template <endpointId>
MCP tool
sendmock_webhook_endpoint_save_as_template
In the app
Webhooks > Endpoints > endpoint > Request > Save as template

Request body (application/json)

SaveAsTemplateRequest : Body of POST /api/v1/webhooks/saved/{savedId}/template.

FieldTypeDescription
namestring
The name of the new custom template.Example: Order webhook

Answer

201 WebhookTemplateSummary

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

Try it in Demo mode

POST/api/v1/webhooks/endpoints/{endpointId}/send

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

CLI
sendmock webhook send --endpoint <endpointId>
MCP tool
sendmock_webhook_send
In the app
Mail, SMS, HTTP > Send to webhook; Webhooks > Composer > Send

Request body (application/json)

ManualSendRequest : Body of POST /api/v1/webhooks/endpoints/{endpointId}/send; neither id means the sample.

FieldTypeDescription
email_id?Ulid
Send this email as the event.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
sms_id?Ulid
Send this SMS as the event.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
http_request_id?Ulid
A captured HTTP request, sent as an http.captured event.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
template_id?string
A template used for this send instead of the endpoint's request.Example: slack.incoming_webhook
request?WebhookEndpointInput
A hand-written request replacing the endpoint's, from the composer.
variables?object
Send-time values by variable name (no vars.), for this send only.
body?string
An edited body, sent as written.Example: {"text": "hello"}

Answer

201 WebhookDelivery

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

Try it in Demo mode