{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/propraven-com/json-schema/propraven-com-webhook-create-schema.json",
  "title": "WebhookCreate",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/propraven-com-webhooks-api-openapi.yml#/components/schemas/WebhookCreate",
  "type": "object",
  "required": [
    "url",
    "event_types",
    "filter_kind",
    "filter_value"
  ],
  "properties": {
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Customer endpoint. https:// only."
    },
    "event_types": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "parcel.sold",
          "parcel.permit_filed",
          "parcel.owner_changed"
        ]
      },
      "minItems": 1,
      "description": "Event types to subscribe to. All three event types are live: create accepts each of them and PropRaven emits each of them."
    },
    "filter_kind": {
      "type": "string",
      "enum": [
        "parcel_ids",
        "state_fips",
        "county_fips"
      ]
    },
    "filter_value": {
      "$ref": "#/$defs/WebhookFilter"
    },
    "description": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 200,
      "description": "Optional human-readable label for your dashboard."
    }
  },
  "$defs": {
    "WebhookFilter": {
      "oneOf": [
        {
          "type": "object",
          "required": [
            "parcel_ids"
          ],
          "properties": {
            "parcel_ids": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "minItems": 1,
              "maxItems": 1000,
              "description": "Parcels to subscribe to, 1–1000: canonical ids `state_fips:county_fips:parcel_id` (preferred; the `canonical_id` other endpoints return), legacy `SSCCC:parcel_id`, parcel UUIDs, or a bare parcel_id that names exactly ONE served parcel. parcel_id is county-scoped, so a bare id that names several parcels is refused with 422 `parcel_identity_unresolved` listing the candidate canonical ids. Stored and matched on the full identity; deliveries carry `canonical_id`."
            }
          }
        },
        {
          "type": "object",
          "required": [
            "state_fips"
          ],
          "properties": {
            "state_fips": {
              "type": "string",
              "pattern": "^[0-9]{2}$",
              "description": "2-digit state FIPS — subscribe to all parcels in this state."
            }
          }
        },
        {
          "type": "object",
          "required": [
            "state_fips",
            "county_fips"
          ],
          "properties": {
            "state_fips": {
              "type": "string",
              "pattern": "^[0-9]{2}$"
            },
            "county_fips": {
              "type": "string",
              "pattern": "^[0-9]{3}$",
              "description": "3-digit county FIPS (within the state) — subscribe to all parcels in this county."
            }
          }
        }
      ],
      "description": "Shape varies with filter_kind. parcel_ids: explicit list. state_fips: all parcels in a state. county_fips: all parcels in a county within a state."
    }
  }
}