sendmock_webhook_endpoint_create
Add an endpoint; its signing secret is generated.
Toolset webhooks.
| Input | Type | Description |
|---|---|---|
| namerequired | string | A name for the endpoint, shown in lists and deliveries.Example: Orders app |
| urlrequired | string | Where deliveries are sent; can use templates.Example: http://localhost:3000/webhooks/sendmock |
| methodrequired | string | The HTTP method of each delivery.One of: GET, POST, PUT, PATCH, DELETEExample: POST |
| headersrequired | object | Extra headers layered on top of the template's. |
| extra_fieldsrequired | object | Extra body fields layered on top of the template's. |
| template_idrequired | string | The payload template, e.g. native (Standard Webhooks JSON) or slack.incoming_webhook.Example: native |
| template_moderequired | string | linked follows template updates, detached keeps its own copy.One of: linked, detachedExample: linked |
| timeout_msrequired | number | How long to wait for your app's answer, in milliseconds.Example: 10000 |
| retry_policyrequired | RetryPolicy | When and how often failed deliveries are retried. |
| is_enabledrequired | boolean | Off endpoints receive no deliveries.Example: true |
| query_paramsrequired | NameValueTemplate[] | Query parameters added to the URL.Example: [{"name":"X-Source","value":"sendmock-{{ event.type }}"}] |
| body_moderequired | 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_fieldsrequired | EndpointBodyField[] | The rows of fields mode.Example: [{"name":"user.email","value_type":"text","value":"{{ data.to[0].address }}"}] |
| fields_encodingrequired | 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_typerequired | string | The content type of raw mode.Example: application/json |
| raw_bodyrequired | string | The body template of raw mode.Example: {"text": "New email: {{ data.subject }}"} |
| render_moderequired | string | strict stops a delivery on an undefined variable, lenient renders it empty with a warning.One of: strict, lenientExample: strict |
Example call
{
"name": "sendmock_webhook_endpoint_create",
"arguments": {
"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
},
"is_enabled": true,
"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"
}
}Result: WebhookEndpoint
- API
- POST
/api/v1/webhooks/endpoints - CLI
sendmock webhook endpoint create- In the app
- Webhooks > Endpoints > Add endpoint