GET/api/v1/webhooks/templates
Built-in and custom payload templates.
- CLI
sendmock webhook template list- MCP tool
sendmock_webhook_template_list- In the app
- Webhooks > Templates
Answer
200 WebhookTemplateSummary[]
/api/v1/webhooks/templatesBuilt-in and custom payload templates.
sendmock webhook template listsendmock_webhook_template_list200 WebhookTemplateSummary[]
/api/v1/webhooks/templatesAdd a custom template, starting as native JSON.
sendmock webhook template createsendmock_webhook_template_createTemplateCreateRequest : Body of POST /api/v1/webhooks/templates (a new blank custom template).
| Field | Type | Description |
|---|---|---|
| name | string | The name of the new blank custom template.Example: Order webhook |
201 WebhookTemplateSummary
Errors: 400, as { error: { code, message } }
/api/v1/webhooks/templates/{templateId}One template with its method, headers and body template.
sendmock webhook template show <templateId>sendmock_webhook_template_get200 WebhookTemplateDetail
Errors: 404, as { error: { code, message } }
/api/v1/webhooks/templates/{templateId}Edit a template; each save keeps a revision, 422 when it does not render.
sendmock webhook template update <templateId>sendmock_webhook_template_updateTemplateUpdate : Body of PATCH /api/v1/webhooks/templates/{templateId}; metadata is ignored for built-ins.
| Field | Type | Description |
|---|---|---|
| name? | string | The template's name.Example: Order webhook |
| description? | string | What the template sends and where.Example: Posts each received email to the orders app. |
| events? | AppEventType[] | 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.pruned |
| required_variables? | string[] | Variables an endpoint must define to use it. |
| method | HttpMethod | The HTTP method.One of: GET, POST, PUT, PATCH, DELETEExample: POST |
| content_type | string | The body's content type.Example: application/json |
| header_templates | object | Header name to a template, e.g. "X-Twilio-Signature": "{{ twilio_signature(...) }}". |
| body_template | string | The body, a template over the event, its data and the variables.Example: {"subject": "{{ data.subject }}"} |
200 WebhookTemplateDetail
Errors: 400, 404, 409, 422, as { error: { code, message } }
/api/v1/webhooks/templates/{templateId}Delete a custom template; 409 while endpoints use it.
sendmock webhook template delete <templateId>sendmock_webhook_template_delete204 No content
Errors: 404, 409, as { error: { code, message } }
/api/v1/webhooks/templates/importImport a template file; 409 when the id is taken.
sendmock webhook template import <file>sendmock_webhook_template_importTemplateImportRequest : Body of POST /api/v1/webhooks/templates/import.
| Field | Type | Description |
|---|---|---|
| file_text | string | The template file's text, TOML or JSON as exported.Example: id = "custom.order_webhook"
name = "Order webhook" |
| on_conflict? | "replace" | "copy" | What to do when the id is taken; left out, the API answers 409.One of: replace, copyExample: copy |
201 WebhookTemplateSummary
Errors: 409, 422, as { error: { code, message } }
/api/v1/webhooks/templates/{templateId}/exportThe template as TOML (variable names, never values).
sendmock webhook template export <templateId>sendmock_webhook_template_export200 string (application/toml)
Errors: 404, as { error: { code, message } }
/api/v1/webhooks/templates/{templateId}/revisionsSaved revisions, newest first.
sendmock webhook template history <templateId>sendmock_webhook_template_revisions200 TemplateRevision[]
Errors: 404, as { error: { code, message } }
/api/v1/webhooks/templates/{templateId}/revisions/{revision}/restoreRestore a revision as a new save.
sendmock webhook template restore <templateId> <revision>sendmock_webhook_template_restore200 WebhookTemplateDetail
Errors: 404, as { error: { code, message } }
/api/v1/webhooks/templates/{templateId}/renderRender against an email, an SMS or the sample, optionally a draft.
sendmock webhook template render <templateId>sendmock_webhook_template_renderTemplateRenderRequest : Body of POST /api/v1/webhooks/templates/{templateId}/render; empty for the sample.
| Field | Type | Description |
|---|---|---|
| email_id? | Ulid | Render against this email; with no IDs the sample event is used.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D |
| sms_id? | Ulid | Render against this SMS.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D |
| http_request_id? | Ulid | A captured HTTP request, as the data of an http.captured event.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D |
| payment_id? | Ulid | A payment, as the data of the event its latest state stands for.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D |
| draft? | TemplateDraft | Unsaved edits to preview instead of the stored template. |
200 TemplateRenderResult
Errors: 404, as { error: { code, message } }
/api/v1/webhooks/templates/{templateId}/resetPut an edited built-in template back as shipped.
sendmock webhook template reset <templateId>sendmock_webhook_template_reset200 WebhookTemplateDetail
Errors: 404, 409, as { error: { code, message } }
/api/v1/webhooks/templates/{templateId}/cloneCopy a template into a new custom one.
sendmock webhook template clone <templateId>sendmock_webhook_template_cloneTemplateCloneRequest : Body of POST /api/v1/webhooks/templates/{templateId}/clone.
| Field | Type | Description |
|---|---|---|
| name | string | The name of the copy.Example: Slack alerts (team) |
201 WebhookTemplateSummary
Errors: 400, 404, as { error: { code, message } }
/api/v1/webhooks/template-referenceEvery value a template can read for the chosen events.
sendmock webhook template referencesendmock_webhook_template_reference200 TemplateReference