{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/propraven-com/json-schema/propraven-com-webhook-delivery-schema.json",
  "title": "WebhookDelivery",
  "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/WebhookDelivery",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Delivery id; sent as the `X-PropRaven-Delivery-Id` header on every attempt."
    },
    "event_id": {
      "type": "string",
      "description": "Deterministic event identifier — sha256(source || pk || event_type). Idempotent re-deliveries share this."
    },
    "event_type": {
      "type": "string",
      "enum": [
        "parcel.sold",
        "parcel.permit_filed",
        "parcel.owner_changed"
      ]
    },
    "event_occurred_at": {
      "type": "string",
      "format": "date-time"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "in_flight",
        "delivered",
        "dead_lettered",
        "failed"
      ],
      "description": "`pending` = queued or waiting for its next retry (`next_attempt_at`); `in_flight` = being sent, or the outcome of a send is unknown (network error or timeout) and it is held for reconciliation, not retried automatically; `delivered` = your endpoint answered 2xx; `dead_lettered` = all 8 attempts got non-2xx, or the send was refused before dispatch (re-queue with the retry route); `failed` = legacy value the current dispatcher never sets (still accepted by the retry route)."
    },
    "attempts": {
      "type": "integer",
      "description": "Attempts made so far (at most 8)."
    },
    "last_attempt_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "next_attempt_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "last_response_status": {
      "type": [
        "integer",
        "null"
      ],
      "description": "HTTP status your endpoint returned on the last attempt; null when no status came back."
    },
    "last_response_body": {
      "type": [
        "string",
        "null"
      ],
      "description": "Never your endpoint's body: after any attempt that got an HTTP status back it is the fixed text `[redacted: response body not persisted]`; null before the first such attempt."
    },
    "last_error": {
      "type": [
        "string",
        "null"
      ],
      "description": "Why the last send did not complete (for example `Delivery outcome unknown; reconciliation required`); null otherwise."
    },
    "dead_lettered_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}