{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bangermail-com/json-schema/bangermail-com-create-product-webhook-request-schema.json",
  "title": "CreateProductWebhookRequest",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bangermail-com-openapi.json#/components/schemas/CreateProductWebhookRequest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "kind",
    "name"
  ],
  "properties": {
    "kind": {
      "type": "string",
      "enum": [
        "outbound",
        "inbound"
      ]
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "source_key": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9_-]{0,62}$",
      "default": "custom",
      "description": "banger_api is reserved for the webhook POST /events creates."
    },
    "source_config": {
      "type": "object",
      "additionalProperties": false,
      "description": "Source-specific deterministic event evaluation and delivery mapping. Supported for Zendesk and Supabase Auth.",
      "properties": {
        "vip_tags": {
          "type": "array",
          "minItems": 1,
          "maxItems": 20,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
          }
        },
        "sla_warning_minutes": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10080
        },
        "project_url": {
          "type": "string",
          "format": "uri",
          "description": "Supabase project URL."
        },
        "mailbox_id": {
          "type": "string",
          "format": "uuid",
          "description": "Active Banger sending address used for Supabase Auth email."
        },
        "template_ids": {
          "type": "object",
          "additionalProperties": false,
          "description": "Banger template selected for each Supabase Auth email action.",
          "required": [
            "signup",
            "invite",
            "magiclink",
            "recovery",
            "email_change",
            "reauthentication",
            "password_changed_notification",
            "email_changed_notification",
            "phone_changed_notification",
            "identity_linked_notification",
            "identity_unlinked_notification",
            "mfa_factor_enrolled_notification",
            "mfa_factor_unenrolled_notification"
          ],
          "properties": {
            "signup": {
              "type": "string",
              "format": "uuid"
            },
            "invite": {
              "type": "string",
              "format": "uuid"
            },
            "magiclink": {
              "type": "string",
              "format": "uuid"
            },
            "recovery": {
              "type": "string",
              "format": "uuid"
            },
            "email_change": {
              "type": "string",
              "format": "uuid"
            },
            "reauthentication": {
              "type": "string",
              "format": "uuid"
            },
            "password_changed_notification": {
              "type": "string",
              "format": "uuid"
            },
            "email_changed_notification": {
              "type": "string",
              "format": "uuid"
            },
            "phone_changed_notification": {
              "type": "string",
              "format": "uuid"
            },
            "identity_linked_notification": {
              "type": "string",
              "format": "uuid"
            },
            "identity_unlinked_notification": {
              "type": "string",
              "format": "uuid"
            },
            "mfa_factor_enrolled_notification": {
              "type": "string",
              "format": "uuid"
            },
            "mfa_factor_unenrolled_notification": {
              "type": "string",
              "format": "uuid"
            }
          }
        }
      }
    },
    "signing_secret": {
      "type": "string",
      "minLength": 20,
      "maxLength": 500,
      "description": "Supabase Send Email Hook secret. Accepted only for an inbound Supabase source and encrypted at rest."
    },
    "endpoint_url": {
      "type": "string",
      "format": "uri",
      "description": "Required for outbound destinations only."
    },
    "event_types": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "uniqueItems": true,
      "description": "Events to send. Omitted, an outbound endpoint gets the default activity events; the specific events (mail.received, mail.sent, send.*, journey.*) are sent only when listed. * sends everything, including the high-volume send.delivered.",
      "items": {
        "type": "string",
        "enum": [
          "*",
          "mail.changed",
          "send.changed",
          "campaign.changed",
          "audience.changed",
          "approval.changed",
          "automation.changed",
          "domain.changed",
          "sending.warning",
          "sending.lane_paused",
          "sending.domain_paused",
          "sending.mailbox_paused",
          "sending.workspace_frozen",
          "sending.resumed",
          "mail.received",
          "mail.sent",
          "send.delivered",
          "send.bounced",
          "send.complained",
          "journey.enrolled",
          "journey.completed",
          "journey.exited",
          "custom"
        ]
      }
    }
  }
}