{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getvigilia-com/json-schema/getvigilia-com-app-health-schema.json",
  "title": "AppHealth",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getvigilia-com-openapi.json#/components/schemas/AppHealth",
  "allOf": [
    {
      "$ref": "#/$defs/App"
    },
    {
      "type": "object",
      "properties": {
        "uptime": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string"
            },
            "lastCheckedAt": {
              "type": [
                "integer",
                "null"
              ]
            },
            "lastDownAt": {
              "type": [
                "integer",
                "null"
              ]
            },
            "uptimePercentLastHour": {
              "type": [
                "number",
                "null"
              ]
            }
          }
        },
        "openIncidents": {
          "type": "object",
          "properties": {
            "total": {
              "type": "integer"
            },
            "critical": {
              "type": "integer"
            },
            "high": {
              "type": "integer"
            },
            "medium": {
              "type": "integer"
            },
            "low": {
              "type": "integer"
            }
          }
        },
        "events": {
          "type": "object",
          "properties": {
            "today": {
              "type": "integer"
            },
            "total": {
              "type": "integer"
            },
            "lastEventAt": {
              "type": [
                "integer",
                "null"
              ]
            }
          }
        },
        "aiDiagnoses": {
          "type": "object",
          "description": "This month's budget of AI diagnoses for the app. On Free it's the allowance; on paid plans, a fair-use ceiling.",
          "properties": {
            "used": {
              "type": "integer"
            },
            "limit": {
              "type": "integer"
            },
            "remaining": {
              "type": "integer"
            },
            "resetsAt": {
              "type": "integer"
            },
            "kind": {
              "type": "string",
              "enum": [
                "allowance",
                "fair-use"
              ]
            }
          }
        }
      }
    }
  ],
  "$defs": {
    "App": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "builder": {
          "type": "string",
          "enum": [
            "lovable",
            "bolt",
            "v0",
            "cursor",
            "claude-code",
            "replit",
            "other"
          ]
        },
        "createdAt": {
          "type": "integer"
        },
        "installed": {
          "type": "boolean",
          "description": "Vigilia has received at least one event."
        },
        "withinPlan": {
          "type": "boolean",
          "description": "False for an app beyond the plan's app limit: it records, but isn't diagnosed."
        },
        "uptime": {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "enum": [
                "up",
                "down",
                "unknown"
              ]
            },
            "lastCheckedAt": {
              "type": [
                "integer",
                "null"
              ]
            }
          }
        },
        "dashboardUrl": {
          "type": "string"
        }
      }
    }
  }
}