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

MCP reference

Webhook endpoints tools

sendmock_webhook_endpoint_create

Add an endpoint; its signing secret is generated.

Toolset webhooks.

    InputTypeDescription
    namerequiredstring
    A name for the endpoint, shown in lists and deliveries.Example: Orders app
    urlrequiredstring
    Where deliveries are sent; can use templates.Example: http://localhost:3000/webhooks/sendmock
    methodrequiredstring
    The HTTP method of each delivery.One of: GET, POST, PUT, PATCH, DELETEExample: POST
    headersrequiredobject
    Extra headers layered on top of the template's.
    extra_fieldsrequiredobject
    Extra body fields layered on top of the template's.
    template_idrequiredstring
    The payload template, e.g. native (Standard Webhooks JSON) or slack.incoming_webhook.Example: native
    template_moderequiredstring
    linked follows template updates, detached keeps its own copy.One of: linked, detachedExample: linked
    timeout_msrequirednumber
    How long to wait for your app's answer, in milliseconds.Example: 10000
    retry_policyrequiredRetryPolicy
    When and how often failed deliveries are retried.
    is_enabledrequiredboolean
    Off endpoints receive no deliveries.Example: true
    query_paramsrequiredNameValueTemplate[]
    Query parameters added to the URL.Example: [{"name":"X-Source","value":"sendmock-{{ event.type }}"}]
    body_moderequiredstring
    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_fieldsrequiredEndpointBodyField[]
    The rows of fields mode.Example: [{"name":"user.email","value_type":"text","value":"{{ data.to[0].address }}"}]
    fields_encodingrequiredstring
    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_typerequiredstring
    The content type of raw mode.Example: application/json
    raw_bodyrequiredstring
    The body template of raw mode.Example: {"text": "New email: {{ data.subject }}"}
    render_moderequiredstring
    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

    sendmock_webhook_endpoint_delete

    Delete an endpoint and its rules.

    Toolset webhooks.

    • Destructive
    • Idempotent
    InputTypeDescription
    endpoint_idrequiredstring
    The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

    Example call

    {
      "name": "sendmock_webhook_endpoint_delete",
      "arguments": {
        "endpoint_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D"
      }
    }

    Result: nothing

    API
    DELETE/api/v1/webhooks/endpoints/{endpointId}
    CLI
    sendmock webhook endpoint delete <endpointId>
    In the app
    Webhooks > Endpoints > Delete

    sendmock_webhook_endpoint_get

    One endpoint; its secret masked.

    Toolset webhooks.

    • Read only
    InputTypeDescription
    endpoint_idrequiredstring
    The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

    Example call

    {
      "name": "sendmock_webhook_endpoint_get",
      "arguments": {
        "endpoint_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D"
      }
    }

    Result: WebhookEndpoint

    API
    GET/api/v1/webhooks/endpoints/{endpointId}
    CLI
    sendmock webhook endpoint show <endpointId>
    In the app
    Webhooks > Endpoints > Edit

    sendmock_webhook_endpoint_list

    Where webhooks go: URL, template, secret and retry policy.

    Toolset webhooks.

    • Read only

    No inputs.

    Example call

    {
      "name": "sendmock_webhook_endpoint_list",
      "arguments": {}
    }

    Result: WebhookEndpoint[]

    API
    GET/api/v1/webhooks/endpoints
    CLI
    sendmock webhook endpoint list
    In the app
    Webhooks > Endpoints

    sendmock_webhook_endpoint_rotate_secret

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

    Toolset webhooks.

      InputTypeDescription
      endpoint_idrequiredstring
      The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      overlap_hoursrequirednumber
      How many hours the old secret keeps signing next to the new one (default 24).Example: 24

      Example call

      {
        "name": "sendmock_webhook_endpoint_rotate_secret",
        "arguments": {
          "endpoint_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D",
          "overlap_hours": 24
        }
      }

      Result: WebhookEndpoint

      API
      POST/api/v1/webhooks/endpoints/{endpointId}/rotate-secret
      CLI
      sendmock webhook endpoint rotate-secret <endpointId>
      In the app
      Webhooks > Endpoints > endpoint > Security > Rotate secret

      sendmock_webhook_endpoint_save_as_template

      Save the endpoint's request as a custom template.

      Toolset webhooks.

        InputTypeDescription
        endpoint_idrequiredstring
        The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
        namerequiredstring
        The name of the new custom template.Example: Order webhook

        Example call

        {
          "name": "sendmock_webhook_endpoint_save_as_template",
          "arguments": {
            "endpoint_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D",
            "name": "Order webhook"
          }
        }

        Result: WebhookTemplateSummary

        API
        POST/api/v1/webhooks/endpoints/{endpointId}/save-as-template
        CLI
        sendmock webhook endpoint save-as-template <endpointId>
        In the app
        Webhooks > Endpoints > endpoint > Request > Save as template

        sendmock_webhook_endpoint_test

        Send a test.ping delivery.

        Toolset webhooks.

          InputTypeDescription
          endpoint_idrequiredstring
          The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

          Example call

          {
            "name": "sendmock_webhook_endpoint_test",
            "arguments": {
              "endpoint_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D"
            }
          }

          Result: WebhookDelivery

          API
          POST/api/v1/webhooks/endpoints/{endpointId}/test
          CLI
          sendmock webhook endpoint test <endpointId>
          In the app
          Webhooks > Endpoints > Send test

          sendmock_webhook_endpoint_update

          Change an endpoint; send only the changed keys.

          Toolset webhooks.

          • Idempotent
          InputTypeDescription
          endpoint_idrequiredstring
          The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
          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
          methodstring
          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_modestring
          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.Example: [{"name":"X-Source","value":"sendmock-{{ event.type }}"}]
          body_modestring
          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.Example: [{"name":"user.email","value_type":"text","value":"{{ data.to[0].address }}"}]
          fields_encodingstring
          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_modestring
          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_update",
            "arguments": {
              "endpoint_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D",
              "name": "Orders app",
              "url": "http://localhost:3000/webhooks/sendmock"
            }
          }

          Result: WebhookEndpoint

          API
          PATCH/api/v1/webhooks/endpoints/{endpointId}
          CLI
          sendmock webhook endpoint update <endpointId>
          In the app
          Webhooks > Endpoints > endpoint > Save changes, enabled switch

          sendmock_webhook_render

          Render an unsaved endpoint's request against a message.

          Toolset webhooks.

          • Read only
          InputTypeDescription
          endpointWebhookEndpointInput
          The endpoint settings to render, saved or not; left out, the saved endpoint endpoint_id names is rendered as stored.
          endpoint_idstring
          A saved endpoint's own variables are used too; alone, its stored settings are rendered.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
          email_idstring
          Render against this email; without an email, SMS or request ID the sample event is used.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
          sms_idstring
          Render against this SMS.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
          http_request_idstring
          Render against this captured HTTP request.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
          variablesobject
          Send-time values by variable name (no vars.); they win for this render.

          Example call

          {
            "name": "sendmock_webhook_render",
            "arguments": {}
          }

          Result: EndpointPreviewResult

          API
          POST/api/v1/webhooks/endpoints/preview
          CLI
          sendmock webhook render --endpoint-id <endpointId>
          In the app
          Webhooks > Endpoints > endpoint > Request preview; Send to webhook > Preview

          sendmock_webhook_send

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

          Toolset webhooks.

            InputTypeDescription
            endpoint_idrequiredstring
            The webhook endpoint's ID, from GET /api/v1/webhooks/endpoints.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
            email_idstring
            Send this email as the event.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
            sms_idstring
            Send this SMS as the event.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
            http_request_idstring
            A captured HTTP request, sent as an http.captured event.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
            template_idstring
            A template used for this send instead of the endpoint's request.Example: slack.incoming_webhook
            requestWebhookEndpointInput
            A hand-written request replacing the endpoint's, from the composer.
            variablesobject
            Send-time values by variable name (no vars.), for this send only.
            bodystring
            An edited body, sent as written.Example: {"text": "hello"}

            Example call

            {
              "name": "sendmock_webhook_send",
              "arguments": {
                "endpoint_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D",
                "body": "{\"text\": \"hello\"}"
              }
            }

            Result: WebhookDelivery

            API
            POST/api/v1/webhooks/endpoints/{endpointId}/send
            CLI
            sendmock webhook send --endpoint <endpointId>
            In the app
            Mail, SMS, HTTP > Send to webhook; Webhooks > Composer > Send