{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dealboard/json-schema/dealboard-webhook-schema.json",
  "title": "Webhook",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dealboard-openapi.json#/components/schemas/Webhook",
  "type": "object",
  "required": [
    "id",
    "boardId",
    "label",
    "urlFingerprint",
    "provider",
    "events",
    "stageFilter",
    "active",
    "createdAt",
    "lastDeliveredAt",
    "lastError"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "boardId": {
      "type": "string",
      "format": "uuid"
    },
    "label": {
      "type": [
        "string",
        "null"
      ]
    },
    "urlFingerprint": {
      "type": "string",
      "description": "Last 4 characters of the URL. The URL itself is a secret and is never returned."
    },
    "provider": {
      "type": "string",
      "enum": [
        "slack",
        "teams",
        "discord",
        "generic"
      ]
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "deal.created",
          "deal.stage_changed",
          "deal.won",
          "deal.updated",
          "lead.created"
        ]
      }
    },
    "stageFilter": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Stage IDs (per-board) to filter `deal.stage_changed` events to. Empty = all stages."
    },
    "active": {
      "type": "boolean"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "lastDeliveredAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "lastError": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}