{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/ai-law-tracker-com/json-schema/ai-law-tracker-com-webhook-schema.json",
  "title": "Webhook",
  "description": "A change-notification subscription.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/ai-law-tracker-com-webhooks-api-openapi.yml#/components/schemas/Webhook",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "target_url": {
      "type": "string",
      "description": "HTTPS endpoint that receives signed POSTs."
    },
    "events": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "law.created",
          "law.updated"
        ]
      }
    },
    "scope": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "state",
        "federal",
        "eu",
        "global"
      ],
      "description": "Optional filter — only changes in this scope."
    },
    "jurisdiction": {
      "type": [
        "string",
        "null"
      ],
      "description": "Optional filter — only changes for this jurisdiction slug."
    },
    "active": {
      "type": "boolean"
    },
    "failure_count": {
      "type": "integer",
      "description": "Consecutive failed deliveries; the webhook auto-disables at 10."
    },
    "disabled_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "disabled_reason": {
      "type": [
        "string",
        "null"
      ]
    },
    "last_delivery_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}