{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/arcnautical-com/json-schema/arcnautical-com-webhook-delivery-page-schema.json",
  "title": "WebhookDeliveryPage",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/arcnautical-com-webhooks-api-openapi.yml#/components/schemas/WebhookDeliveryPage",
  "type": "object",
  "required": [
    "deliveries",
    "has_more",
    "dead_count",
    "in_flight_count"
  ],
  "properties": {
    "deliveries": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WebhookDelivery"
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "has_more": {
      "type": "boolean"
    },
    "dead_count": {
      "type": "integer",
      "description": "Account-wide, not page-local: how many events gave up entirely."
    },
    "in_flight_count": {
      "type": "integer",
      "description": "Account-wide: how many are still queued or retrying."
    },
    "retry_schedule": {
      "type": "string"
    }
  },
  "$defs": {
    "WebhookDelivery": {
      "type": "object",
      "required": [
        "id",
        "event_id",
        "event_type",
        "status",
        "attempt",
        "created_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "event_id": {
          "type": "string",
          "description": "Stable across a replay, so both attempts correlate."
        },
        "event_type": {
          "type": "string"
        },
        "endpoint_id": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "Null if the endpoint has since been deleted."
        },
        "endpoint_url": {
          "type": [
            "string",
            "null"
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "pending",
            "retry",
            "sending",
            "delivered",
            "dead"
          ]
        },
        "status_code": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Last HTTP status your endpoint returned."
        },
        "error": {
          "type": [
            "string",
            "null"
          ]
        },
        "attempt": {
          "type": "integer"
        },
        "next_retry_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Null once terminal."
        },
        "delivered_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "replay_of": {
          "type": [
            "string",
            "null"
          ],
          "format": "uuid",
          "description": "The delivery this one was queued to replace."
        },
        "payload": {
          "type": "object",
          "additionalProperties": true,
          "description": "Present on the single-delivery read: the body exactly as signed and sent."
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    }
  }
}