{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/uptimemonitoring-com/json-schema/uptimemonitoring-com-incident-schema.json",
  "title": "Incident",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/uptimemonitoring-com-incidents-api-openapi.yml#/components/schemas/Incident",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "format": "int64"
    },
    "number": {
      "type": "integer",
      "format": "int64",
      "description": "This incident's per-account sequence number (issue #412), assigned once at creation and never reused."
    },
    "ref": {
      "type": "string",
      "description": "Stable \"<account handle>-<number>\" reference, e.g. \"k7q2mx-3\" — accepted anywhere `{incidentID}` appears in a path."
    },
    "monitor_ref": {
      "type": "string",
      "description": "The owning monitor's own ref (issue"
    },
    "monitor_id": {
      "type": "integer",
      "format": "int64"
    },
    "account_id": {
      "type": "integer",
      "format": "int64"
    },
    "type": {
      "type": "string",
      "enum": [
        "down",
        "flapping"
      ]
    },
    "started_at": {
      "type": "string",
      "format": "date-time"
    },
    "resolved_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Null if the incident is still ongoing."
    },
    "evidence": {
      "type": "array",
      "description": "Snapshot of the evidence ring buffer at the time of the state transition.",
      "items": {
        "$ref": "#/$defs/CheckResult"
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "maintenance": {
      "type": "boolean",
      "description": "True when this incident opened while the monitor's maintenance\nwindow was active (issue #361) — or, for a down-to-flapping or\nflapping-to-down handoff, inherited from the incident it\nreplaced. A monitor-wide down/flapping alert is suppressed for\nevery recipient while this is true, and the recovery (\"up\")\nalert is suppressed too once every incident the recovery\nresolved carries this flag.\n"
    }
  },
  "$defs": {
    "CheckResult": {
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "string",
          "format": "date-time"
        },
        "region": {
          "type": "string"
        },
        "status_code": {
          "type": "integer"
        },
        "error_class": {
          "type": "string"
        },
        "dns_ms": {
          "type": "number"
        },
        "tls_ms": {
          "type": "number"
        },
        "connect_ms": {
          "type": "number"
        },
        "ttfb_ms": {
          "type": "number"
        },
        "download_ms": {
          "type": "number"
        },
        "content_length": {
          "type": "integer",
          "format": "int64"
        },
        "response_hash": {
          "type": "string"
        },
        "packet_loss_pct": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "description": "Ping-only packet loss percentage (0-100). Omitted (not present\nin the object) when not measured — every non-ping check result,\nand a ping probe-side failure that never reached the target. A\nmeasured 0% loss is present with value 0, distinct from omitted.\n"
        }
      }
    }
  }
}