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

MCP reference

Webhook templates tools

sendmock_webhook_template_clone

Copy a template into a new custom one.

Toolset templates.

    InputTypeDescription
    template_idrequiredstring
    The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook
    namerequiredstring
    The name of the copy.Example: Slack alerts (team)

    Example call

    {
      "name": "sendmock_webhook_template_clone",
      "arguments": {
        "template_id": "slack.incoming_webhook",
        "name": "Slack alerts (team)"
      }
    }

    Result: WebhookTemplateSummary

    API
    POST/api/v1/webhooks/templates/{templateId}/clone
    CLI
    sendmock webhook template clone <templateId>
    In the app
    Webhooks > Templates > template > Clone

    sendmock_webhook_template_create

    Add a custom template, starting as native JSON.

    Toolset templates.

      InputTypeDescription
      namerequiredstring
      The name of the new blank custom template.Example: Order webhook

      Example call

      {
        "name": "sendmock_webhook_template_create",
        "arguments": {
          "name": "Order webhook"
        }
      }

      Result: WebhookTemplateSummary

      API
      POST/api/v1/webhooks/templates
      CLI
      sendmock webhook template create
      In the app
      Webhooks > Templates > New template

      sendmock_webhook_template_delete

      Delete a custom template; 409 while endpoints use it.

      Toolset templates.

      • Destructive
      • Idempotent
      InputTypeDescription
      template_idrequiredstring
      The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook
      endpointsstring
      detach: endpoints that use it keep their own copy of it instead of failing.Example: detach

      Example call

      {
        "name": "sendmock_webhook_template_delete",
        "arguments": {
          "template_id": "slack.incoming_webhook",
          "endpoints": "detach"
        }
      }

      Result: nothing

      API
      DELETE/api/v1/webhooks/templates/{templateId}
      CLI
      sendmock webhook template delete <templateId>
      In the app
      Webhooks > Templates > template > Delete

      sendmock_webhook_template_export

      The template as TOML (variable names, never values).

      Toolset templates.

      • Read only
      InputTypeDescription
      template_idrequiredstring
      The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook

      Example call

      {
        "name": "sendmock_webhook_template_export",
        "arguments": {
          "template_id": "slack.incoming_webhook"
        }
      }

      Result: file (application/toml)

      API
      GET/api/v1/webhooks/templates/{templateId}/export
      CLI
      sendmock webhook template export <templateId>
      In the app
      Webhooks > Templates > template > Export

      sendmock_webhook_template_get

      One template with its method, headers and body template.

      Toolset templates.

      • Read only
      InputTypeDescription
      template_idrequiredstring
      The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook

      Example call

      {
        "name": "sendmock_webhook_template_get",
        "arguments": {
          "template_id": "slack.incoming_webhook"
        }
      }

      Result: WebhookTemplateDetail

      API
      GET/api/v1/webhooks/templates/{templateId}
      CLI
      sendmock webhook template show <templateId>
      In the app
      Webhooks > Templates > open a template

      sendmock_webhook_template_import

      Import a template file; 409 when the id is taken.

      Toolset templates.

        InputTypeDescription
        file_textrequiredstring
        The template file's text, TOML or JSON as exported.Example: id = "custom.order_webhook" name = "Order webhook"
        on_conflictstring
        What to do when the id is taken; left out, the API answers 409.One of: replace, copyExample: copy

        Example call

        {
          "name": "sendmock_webhook_template_import",
          "arguments": {
            "file_text": "id = \"custom.order_webhook\"\nname = \"Order webhook\"",
            "on_conflict": "copy"
          }
        }

        Result: WebhookTemplateSummary

        API
        POST/api/v1/webhooks/templates/import
        CLI
        sendmock webhook template import <file>
        In the app
        Webhooks > Templates > Import a template

        sendmock_webhook_template_list

        Built-in and custom payload templates.

        Toolset webhooks.

        • Read only

        No inputs.

        Example call

        {
          "name": "sendmock_webhook_template_list",
          "arguments": {}
        }

        Result: WebhookTemplateSummary[]

        API
        GET/api/v1/webhooks/templates
        CLI
        sendmock webhook template list
        In the app
        Webhooks > Templates

        sendmock_webhook_template_reference

        Every value a template can read for the chosen events.

        Toolset templates.

        • Read only
        InputTypeDescription
        eventsstring
        Comma-separated event types.Example: email.received,sms.received

        Example call

        {
          "name": "sendmock_webhook_template_reference",
          "arguments": {
            "events": "email.received,sms.received"
          }
        }

        Result: TemplateReference

        API
        GET/api/v1/webhooks/template-reference
        CLI
        sendmock webhook template reference
        In the app
        Webhooks > Templates > template editor > reference panel

        sendmock_webhook_template_render

        Render against an email, an SMS or the sample, optionally a draft.

        Toolset templates.

        • Read only
        InputTypeDescription
        template_idrequiredstring
        The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook
        email_idstring
        Render against this email; with no IDs the sample event is used.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        sms_idstring
        Render against this SMS.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        http_request_idstring
        A captured HTTP request, as the data of an http.captured event.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        payment_idstring
        A payment, as the data of the event its latest state stands for.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        draftTemplateDraft
        Unsaved edits to preview instead of the stored template.

        Example call

        {
          "name": "sendmock_webhook_template_render",
          "arguments": {
            "template_id": "slack.incoming_webhook"
          }
        }

        Result: TemplateRenderResult

        API
        POST/api/v1/webhooks/templates/{templateId}/render
        CLI
        sendmock webhook template render <templateId>
        In the app
        Webhooks > Templates > template > Preview

        sendmock_webhook_template_reset

        Put an edited built-in template back as shipped.

        Toolset templates.

          InputTypeDescription
          template_idrequiredstring
          The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook

          Example call

          {
            "name": "sendmock_webhook_template_reset",
            "arguments": {
              "template_id": "slack.incoming_webhook"
            }
          }

          Result: WebhookTemplateDetail

          API
          POST/api/v1/webhooks/templates/{templateId}/reset
          CLI
          sendmock webhook template reset <templateId>
          In the app
          Webhooks > Templates > template > Reset to default

          sendmock_webhook_template_restore

          Restore a revision as a new save.

          Toolset templates.

            InputTypeDescription
            template_idrequiredstring
            The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook
            revisionrequiredinteger
            The template revision number, from its history.Example: 1

            Example call

            {
              "name": "sendmock_webhook_template_restore",
              "arguments": {
                "template_id": "slack.incoming_webhook",
                "revision": 1
              }
            }

            Result: WebhookTemplateDetail

            API
            POST/api/v1/webhooks/templates/{templateId}/revisions/{revision}/restore
            CLI
            sendmock webhook template restore <templateId> <revision>
            In the app
            Webhooks > Templates > template > History > Restore

            sendmock_webhook_template_revisions

            Saved revisions, newest first.

            Toolset templates.

            • Read only
            InputTypeDescription
            template_idrequiredstring
            The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook

            Example call

            {
              "name": "sendmock_webhook_template_revisions",
              "arguments": {
                "template_id": "slack.incoming_webhook"
              }
            }

            Result: TemplateRevision[]

            API
            GET/api/v1/webhooks/templates/{templateId}/revisions
            CLI
            sendmock webhook template history <templateId>
            In the app
            Webhooks > Templates > template > History

            sendmock_webhook_template_update

            Edit a template; each save keeps a revision, 422 when it does not render.

            Toolset templates.

            • Idempotent
            InputTypeDescription
            template_idrequiredstring
            The webhook template's ID, e.g. slack.incoming_webhook or custom.ops_alert.Example: slack.incoming_webhook
            namestring
            The template's name.Example: Order webhook
            descriptionstring
            What the template sends and where.Example: Posts each received email to the orders app.
            eventsstring[]
            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.prunedExample: ["email.received"]
            required_variablesstring[]
            Variables an endpoint must define to use it.Example: ["app_token"]
            methodrequiredstring
            The HTTP method.One of: GET, POST, PUT, PATCH, DELETEExample: POST
            content_typerequiredstring
            The body's content type.Example: application/json
            header_templatesrequiredobject
            Header name to a template, e.g. "X-Twilio-Signature": "{{ twilio_signature(...) }}".
            body_templaterequiredstring
            The body, a template over the event, its data and the variables.Example: {"subject": "{{ data.subject }}"}

            Example call

            {
              "name": "sendmock_webhook_template_update",
              "arguments": {
                "template_id": "slack.incoming_webhook",
                "method": "POST",
                "content_type": "application/json",
                "header_templates": {
                  "Authorization": "Bearer {{ vars.app_token }}"
                },
                "body_template": "{\"subject\": \"{{ data.subject }}\"}",
                "name": "Order webhook",
                "description": "Posts each received email to the orders app."
              }
            }

            Result: WebhookTemplateDetail

            API
            PATCH/api/v1/webhooks/templates/{templateId}
            CLI
            sendmock webhook template update <templateId>
            In the app
            Webhooks > Templates > template > Edit, Save template