{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fillo-so/json-schema/fillo-so-delivery-health-schema.json",
  "title": "DeliveryHealth",
  "description": "Epoch-millisecond timestamps throughout, matching the dashboard's Activity data.",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fillo-so-openapi.json#/components/schemas/DeliveryHealth",
  "type": "object",
  "required": [
    "windowDays",
    "destinations",
    "deliveries",
    "hasMore"
  ],
  "properties": {
    "windowDays": {
      "type": "integer",
      "description": "The telemetry retention window the counts cover. They are not all-time totals."
    },
    "destinations": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "key",
          "kind",
          "label",
          "detail",
          "delivered",
          "pending",
          "failed",
          "nextRetryAt",
          "lastDeliveredAt",
          "failingSince",
          "lastError"
        ],
        "properties": {
          "key": {
            "type": "string",
            "description": "`webhook:<id>` or `integration:<id>` — the value the retry endpoint accepts as destinationKey."
          },
          "kind": {
            "type": "string",
            "enum": [
              "webhook",
              "integration"
            ]
          },
          "label": {
            "type": "string",
            "description": "How to name this destination: the provider for an integration, and for a webhook the connector that created it (“Zapier”, “n8n”) or its host plus a short fingerprint of the path. The full URL is never returned here."
          },
          "detail": {
            "type": [
              "string",
              "null"
            ]
          },
          "delivered": {
            "type": "integer"
          },
          "pending": {
            "type": "integer"
          },
          "failed": {
            "type": "integer"
          },
          "nextRetryAt": {
            "type": [
              "integer",
              "null"
            ]
          },
          "lastDeliveredAt": {
            "type": [
              "integer",
              "null"
            ]
          },
          "failingSince": {
            "type": [
              "integer",
              "null"
            ]
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "deliveries": {
      "type": "array",
      "description": "The bounded recent-delivery list, newest first — the same rows the form's Activity page shows.",
      "items": {
        "type": "object",
        "required": [
          "id",
          "destinationKey",
          "kind",
          "destinationLabel",
          "destinationDetail",
          "event",
          "state",
          "attempts",
          "httpStatus",
          "lastError",
          "responseId",
          "nextAttemptAt",
          "queuedAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "destinationKey": {
            "type": "string"
          },
          "kind": {
            "type": "string",
            "enum": [
              "webhook",
              "integration"
            ]
          },
          "destinationLabel": {
            "type": "string",
            "description": "The same name as the matching destination's label — never a full webhook URL."
          },
          "destinationDetail": {
            "type": [
              "string",
              "null"
            ]
          },
          "event": {
            "type": "string",
            "enum": [
              "response.created",
              "response.updated",
              "draft.abandoned"
            ]
          },
          "state": {
            "type": "string",
            "enum": [
              "pending",
              "delivered",
              "failed"
            ]
          },
          "attempts": {
            "type": "integer"
          },
          "httpStatus": {
            "type": [
              "integer",
              "null"
            ]
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          },
          "responseId": {
            "type": [
              "string",
              "null"
            ]
          },
          "nextAttemptAt": {
            "type": [
              "integer",
              "null"
            ]
          },
          "queuedAt": {
            "type": "integer"
          },
          "updatedAt": {
            "type": "integer"
          }
        }
      }
    },
    "hasMore": {
      "type": "boolean"
    }
  }
}