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

MCP reference

Webhook rules tools

sendmock_webhook_rule_create

Add a rule.

Toolset webhooks.

    InputTypeDescription
    namerequiredstring
    A name for the rule, shown in the list.Example: Bounces to Slack
    endpoint_idrequiredstring
    The endpoint each matching event is delivered to.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
    eventsrequiredstring[]
    The event types the rule listens to.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.bounced","email.complained"]
    filterobject
    Which messages match, combining conditions with all, any and not; null matches every event.
    is_enabledrequiredboolean
    Off rules are kept but skipped.Example: true

    Example call

    {
      "name": "sendmock_webhook_rule_create",
      "arguments": {
        "name": "Bounces to Slack",
        "endpoint_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D",
        "events": [
          "email.bounced",
          "email.complained"
        ],
        "is_enabled": true
      }
    }

    Result: WebhookRule

    API
    POST/api/v1/webhooks/rules
    CLI
    sendmock webhook rule create
    In the app
    Webhooks > Rules > Add rule

    sendmock_webhook_rule_delete

    Delete a rule.

    Toolset webhooks.

    • Destructive
    • Idempotent
    InputTypeDescription
    rule_idrequiredstring
    The rule's ID, from the list of rules of the same kind.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

    Example call

    {
      "name": "sendmock_webhook_rule_delete",
      "arguments": {
        "rule_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D"
      }
    }

    Result: nothing

    API
    DELETE/api/v1/webhooks/rules/{ruleId}
    CLI
    sendmock webhook rule delete <ruleId>
    In the app
    Webhooks > Rules > Delete

    sendmock_webhook_rule_get

    One webhook rule with its filter.

    Toolset webhooks.

    • Read only
    InputTypeDescription
    rule_idrequiredstring
    The rule's ID, from the list of rules of the same kind.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D

    Example call

    {
      "name": "sendmock_webhook_rule_get",
      "arguments": {
        "rule_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D"
      }
    }

    Result: WebhookRule

    API
    GET/api/v1/webhooks/rules/{ruleId}
    CLI
    sendmock webhook rule show <ruleId>
    In the app
    Webhooks > Rules > Edit

    sendmock_webhook_rule_list

    Which events go to which endpoint, checked from top to bottom.

    Toolset webhooks.

    • Read only

    No inputs.

    Example call

    {
      "name": "sendmock_webhook_rule_list",
      "arguments": {}
    }

    Result: WebhookRule[]

    API
    GET/api/v1/webhooks/rules
    CLI
    sendmock webhook rule list
    In the app
    Webhooks > Rules

    sendmock_webhook_rule_match

    Which webhooks an event would trigger, before an action fires it.

    Toolset webhooks.

    • Read only
    InputTypeDescription
    event_typerequiredstring
    The event the action fires.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.bounced
    subject_idstring
    The email, SMS, payment or push notification the event is about; its stored fields are what the rule filters read.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
    dataobject
    Filter fields by name, for a message not stored yet or the values the event changes; they win over the stored message's.
    include_requestsboolean
    Also render the request each matching endpoint would send for the event, with secrets masked.Example: true
    webhook_endpoint_idsstring[]
    With include_requests, render these endpoints' requests too, as chosen for the action instead of the rules (IDs from GET /api/v1/webhooks/endpoints).Example: ["01JB7T9Q2RENDPOINT00000000"]

    Example call

    {
      "name": "sendmock_webhook_rule_match",
      "arguments": {
        "event_type": "email.bounced",
        "include_requests": true,
        "webhook_endpoint_ids": [
          "01JB7T9Q2RENDPOINT00000000"
        ]
      }
    }

    Result: WebhookRuleMatchResult

    API
    POST/api/v1/webhooks/rules/match
    CLI
    sendmock webhook rule match
    In the app
    Webhooks row and menu hints on every simulating action; Payload on each webhook

    sendmock_webhook_rule_move

    Move a rule up or down; answers the reordered list.

    Toolset webhooks.

      InputTypeDescription
      rule_idrequiredstring
      The rule's ID, from the list of rules of the same kind.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      directionrequiredstring
      up moves the rule one place earlier in the order, down one place later.One of: up, downExample: up

      Example call

      {
        "name": "sendmock_webhook_rule_move",
        "arguments": {
          "rule_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D",
          "direction": "up"
        }
      }

      Result: WebhookRule[]

      API
      POST/api/v1/webhooks/rules/{ruleId}/move
      CLI
      sendmock webhook rule move <ruleId>
      In the app
      Webhooks > Rules > Move up, Move down

      sendmock_webhook_rule_preview

      Which recent messages an unsaved rule would match.

      Toolset webhooks.

      • Read only
      InputTypeDescription
      eventsrequiredstring[]
      The event types to test, as in the rule.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"]
      filterobject
      The filter to test against recent messages; null matches all.

      Example call

      {
        "name": "sendmock_webhook_rule_preview",
        "arguments": {
          "events": [
            "email.received"
          ]
        }
      }

      Result: RulePreviewResult

      API
      POST/api/v1/webhooks/rules/preview
      CLI
      sendmock webhook rule preview
      In the app
      Webhooks > Rules > rule sheet > Preview

      sendmock_webhook_rule_update

      Change a rule; send only the changed keys.

      Toolset webhooks.

      • Idempotent
      InputTypeDescription
      rule_idrequiredstring
      The rule's ID, from the list of rules of the same kind.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      namestring
      A name for the rule, shown in the list.Example: Bounces to Slack
      endpoint_idstring
      The endpoint each matching event is delivered to.Example: 01JB7T9Q2R5W8X3Y6Z1A4B7C9D
      eventsstring[]
      The event types the rule listens to.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.bounced","email.complained"]
      filterobject
      Which messages match, combining conditions with all, any and not; null matches every event.
      is_enabledboolean
      Off rules are kept but skipped.Example: true

      Example call

      {
        "name": "sendmock_webhook_rule_update",
        "arguments": {
          "rule_id": "01JB7T9Q2R5W8X3Y6Z1A4B7C9D",
          "name": "Bounces to Slack",
          "events": [
            "email.bounced",
            "email.complained"
          ]
        }
      }

      Result: WebhookRule

      API
      PATCH/api/v1/webhooks/rules/{ruleId}
      CLI
      sendmock webhook rule update <ruleId>
      In the app
      Webhooks > Rules > rule > Save changes, enabled switch