sendmock webhook endpoint create
Add an endpoint; its signing secret is generated.
sendmock webhook endpoint create [flags]
| Flag | Type | Description |
|---|---|---|
| --name <name>required | string | A name for the endpoint, shown in lists and deliveries.Example: Orders app |
| --url <url>required | string | Where deliveries are sent; can use templates.Example: http://localhost:3000/webhooks/sendmock |
| --method <method>required | string | The HTTP method of each delivery.One of: GET, POST, PUT, PATCH, DELETEExample: POST |
| --headers <headers>required | object (JSON) | Extra headers layered on top of the template's. |
| --extra-fields <extra-fields>required | object (JSON) | Extra body fields layered on top of the template's. |
| --template-id <template-id>required | string | The payload template, e.g. native (Standard Webhooks JSON) or slack.incoming_webhook.Example: native |
| --template-mode <template-mode>required | string | linked follows template updates, detached keeps its own copy.One of: linked, detachedExample: linked |
| --timeout-ms <timeout-ms>required | number | How long to wait for your app's answer, in milliseconds.Example: 10000 |
| --retry-policy <retry-policy>required | RetryPolicy (JSON) | When and how often failed deliveries are retried. |
| --enabledrequired | boolean | Off endpoints receive no deliveries. --no-enabled sets it to false. |
| --query-params <query-params>required | NameValueTemplate[] (JSON) | Query parameters added to the URL.Example: [{"name":"X-Source","value":"sendmock-{{ event.type }}"}] |
| --body-mode <body-mode>required | 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>required | EndpointBodyField[] (JSON) | The rows of fields mode.Example: [{"name":"user.email","value_type":"text","value":"{{ data.to[0].address }}"}] |
| --fields-encoding <fields-encoding>required | 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>required | string | The content type of raw mode.Example: application/json |
| --raw-body <raw-body>required | string | The body template of raw mode.Example: {"text": "New email: {{ data.subject }}"} |
| --render-mode <render-mode>required | 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 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 strictOutput 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