{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bewary/json-schema/bewary-webhook-detail-schema.json",
  "title": "WebhookDetail",
  "x-generated": "2026-11-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bewary-openapi.json#/components/schemas/WebhookDetail",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id",
      "description": "whk_ + a ULID."
    },
    "url": {
      "type": "string",
      "title": "Url"
    },
    "event_types": {
      "items": {
        "type": "string",
        "enum": [
          "domain.ip_changed",
          "domain.ns_changed",
          "domain.down",
          "domain.up",
          "domain.parked",
          "domain.listed",
          "domain.delisted",
          "domain.reregistered",
          "domain.expiring",
          "domain.expired",
          "domain.held",
          "phone.listed",
          "phone.delisted",
          "wallet.listed",
          "wallet.delisted",
          "wallet.sanctioned",
          "brand.lookalike_registered",
          "brand.lookalike_cert",
          "brand.lookalike_live"
        ]
      },
      "type": "array",
      "title": "Event Types",
      "description": "Empty: every event."
    },
    "status": {
      "type": "string",
      "enum": [
        "enabled",
        "disabled"
      ],
      "title": "Status"
    },
    "disabled_reason": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "failing",
            "app_disconnected"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Disabled Reason",
      "description": "failing: every delivery failed for 5 days; app_disconnected: the app that made it over OAuth was disconnected (1.8.0). POST .../enable turns it back on."
    },
    "created_at": {
      "type": "string",
      "title": "Created At"
    },
    "last_success_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Success At"
    },
    "last_failure_at": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Failure At"
    },
    "failing_since": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Failing Since",
      "description": "The first failed attempt since the last success."
    },
    "deliveries": {
      "items": {
        "$ref": "#/$defs/Delivery"
      },
      "type": "array",
      "title": "Deliveries",
      "description": "The last 50, newest first."
    }
  },
  "type": "object",
  "required": [
    "id",
    "url",
    "event_types",
    "status",
    "created_at",
    "deliveries"
  ],
  "$defs": {
    "Delivery": {
      "properties": {
        "event_id": {
          "type": "string",
          "title": "Event Id"
        },
        "event_type": {
          "type": "string",
          "enum": [
            "domain.ip_changed",
            "domain.ns_changed",
            "domain.down",
            "domain.up",
            "domain.parked",
            "domain.listed",
            "domain.delisted",
            "domain.reregistered",
            "domain.expiring",
            "domain.expired",
            "domain.held",
            "phone.listed",
            "phone.delisted",
            "wallet.listed",
            "wallet.delisted",
            "wallet.sanctioned",
            "brand.lookalike_registered",
            "brand.lookalike_cert",
            "brand.lookalike_live"
          ],
          "title": "Event Type"
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "delivering",
            "succeeded",
            "dead",
            "cancelled"
          ],
          "title": "Status",
          "description": "pending: waiting for its next attempt; dead: every retry failed; cancelled: the endpoint was deleted or disabled first."
        },
        "attempts": {
          "type": "integer",
          "title": "Attempts"
        },
        "last_status": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Status",
          "description": "The HTTP status of the last attempt."
        },
        "error": {
          "anyOf": [
            {
              "type": "string",
              "enum": [
                "http_status",
                "timeout",
                "network",
                "blocked",
                "secret_unavailable",
                "endpoint_removed",
                "internal"
              ]
            },
            {
              "type": "null"
            }
          ],
          "title": "Error",
          "description": "Why the last attempt failed. blocked: the URL no longer resolves to public addresses only."
        },
        "next_attempt_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Next Attempt At"
        },
        "delivered_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Delivered At"
        },
        "created_at": {
          "type": "string",
          "title": "Created At"
        }
      },
      "type": "object",
      "required": [
        "event_id",
        "event_type",
        "status",
        "attempts",
        "created_at"
      ],
      "title": "Delivery"
    }
  }
}