{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aicdapi-com/json-schema/aicdapi-com-civic-health-schema.json",
  "title": "CivicHealth",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/aicdapi-com-openapi.json#/components/schemas/CivicHealth",
  "type": "object",
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "healthy",
        "degraded",
        "unavailable"
      ]
    },
    "checkedAt": {
      "type": "string",
      "format": "date-time",
      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
    },
    "sources": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "publicBodyId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "sourceSystem": {
            "type": "string",
            "enum": [
              "legistar",
              "civicplus_agenda_center",
              "civicweb",
              "civicclerk",
              "granicus",
              "municode",
              "onbase_agenda_online",
              "pdf_directory",
              "arcgis_feature_service",
              "docspublished",
              "novusagenda",
              "agendaquick"
            ]
          },
          "recordKind": {
            "type": "string",
            "enum": [
              "agenda",
              "record_stream"
            ]
          },
          "officialSourceUrl": {
            "type": "string",
            "minLength": 1
          },
          "pollIntervalMinutes": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "lastSuccessAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastErrorAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "errorCategory": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "timeout",
                  "dns",
                  "authorization",
                  "not_found",
                  "size_limit",
                  "invalid_document",
                  "upstream_failure"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "active": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "id",
          "publicBodyId",
          "sourceSystem",
          "recordKind",
          "officialSourceUrl",
          "pollIntervalMinutes",
          "lastSuccessAt",
          "lastErrorAt",
          "errorCategory",
          "active",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false
      }
    },
    "pipeline": {
      "type": "object",
      "properties": {
        "meetings": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "documents": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "agendaItems": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "topicMatches": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "civicEvents": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "documentDeadLetters": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "actionableDocumentDeadLetters": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "extractionDeadLetters": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "classificationDeadLetters": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "staleSources": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        }
      },
      "required": [
        "meetings",
        "documents",
        "agendaItems",
        "topicMatches",
        "civicEvents",
        "documentDeadLetters",
        "actionableDocumentDeadLetters",
        "extractionDeadLetters",
        "classificationDeadLetters",
        "staleSources"
      ],
      "additionalProperties": false
    }
  },
  "required": [
    "status",
    "checkedAt",
    "sources",
    "pipeline"
  ],
  "additionalProperties": false
}