{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sendmux-ai/json-schema/sendmux-ai-webhook-update-body-schema.json",
  "title": "WebhookUpdateBody",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sendmux-ai-webhooks-api-openapi.yml#/components/schemas/WebhookUpdateBody",
  "additionalProperties": false,
  "properties": {
    "enabled": {
      "description": "When toggled from false to true, also clears the `failing` flag — retry deliveries resume on the next matching event.",
      "type": "boolean"
    },
    "event_types": {
      "description": "Replaces the full event-type list. At least one must be provided.",
      "items": {
        "description": "Event types a webhook may subscribe to. `sendmux.test` is accepted so you can verify end-to-end delivery via POST /webhooks/{id}/test.",
        "enum": [
          "message.delivered",
          "message.bounced",
          "message.complained",
          "message.rejected",
          "message.delivery_delayed",
          "message.received",
          "message.received.spam",
          "calendar.changed",
          "sendmux.test"
        ],
        "type": "string"
      },
      "minItems": 1,
      "type": "array"
    },
    "filters": {
      "allOf": [
        {
          "$ref": "#/$defs/WebhookFilters"
        },
        {
          "description": "Replaces the full delivery scope. Omit to leave unchanged; pass an empty mailbox_ids array for all team mailboxes."
        }
      ]
    },
    "name": {
      "description": "Replace the human-friendly label. Send `null` to clear it; omit to leave unchanged.",
      "maxLength": 255,
      "type": [
        "string",
        "null"
      ]
    },
    "url": {
      "description": "New HTTPS endpoint. Must be https://.",
      "format": "uri",
      "type": "string"
    }
  },
  "type": "object",
  "$defs": {
    "WebhookFilters": {
      "additionalProperties": false,
      "description": "Optional delivery scope. Empty mailbox_ids means all team mailboxes.",
      "properties": {
        "mailbox_ids": {
          "description": "Mailbox public IDs to receive events for. Empty means all mailboxes in the team.",
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "required": [
        "mailbox_ids"
      ],
      "type": "object"
    }
  }
}