{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/forge/json-schema/forge-headless-security-export-destination-health-schema.json",
  "title": "HeadlessSecurityExportDestinationHealth",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/forge-openapi.yaml#/components/schemas/HeadlessSecurityExportDestinationHealth",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "destinationId",
    "status",
    "lookbackDays",
    "lookbackCaughtUp",
    "cursors",
    "replayJobs",
    "recentBatchAttempts",
    "deadLetters",
    "deadLetterCount"
  ],
  "properties": {
    "destinationId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "paused",
        "unhealthy"
      ]
    },
    "lookbackDays": {
      "type": "integer"
    },
    "lookbackCaughtUp": {
      "type": "boolean"
    },
    "oldestUndeliveredAt": {
      "type": "string",
      "format": "date-time"
    },
    "cursors": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/HeadlessSecurityExportCursorHealth"
      }
    },
    "replayJobs": {
      "type": "array",
      "maxItems": 10,
      "items": {
        "$ref": "#/$defs/HeadlessSecurityExportHealthRecord"
      }
    },
    "recentBatchAttempts": {
      "type": "array",
      "maxItems": 25,
      "items": {
        "$ref": "#/$defs/HeadlessSecurityExportHealthRecord"
      }
    },
    "deadLetters": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "$ref": "#/$defs/HeadlessSecurityExportHealthRecord"
      }
    },
    "deadLetterCount": {
      "type": "integer"
    },
    "optimizationEstimate": {
      "$ref": "#/$defs/HeadlessSecurityExportHealthRecord"
    }
  },
  "$defs": {
    "HeadlessSecurityExportCursorHealth": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "category",
        "deliveredEvents",
        "deliveredBytes",
        "skippedEvents"
      ],
      "properties": {
        "category": {
          "type": "string"
        },
        "cursorOccurredAt": {
          "type": "string",
          "format": "date-time"
        },
        "cursorStableId": {
          "type": "string"
        },
        "lastDeliveredAt": {
          "type": "string",
          "format": "date-time"
        },
        "deliveredEvents": {
          "type": "integer",
          "format": "int64"
        },
        "deliveredBytes": {
          "type": "integer",
          "format": "int64"
        },
        "skippedEvents": {
          "type": "integer",
          "format": "int64"
        }
      }
    },
    "HeadlessSecurityExportHealthRecord": {
      "type": "object",
      "description": "Sanitized bounded delivery-health record. Provider errors are redacted and internal payload references are omitted by the server.",
      "additionalProperties": true
    }
  }
}