{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/getuptimely-com/json-schema/getuptimely-com-incident-detail-schema.json",
  "title": "IncidentDetail",
  "description": "An incident with its monitors and recent state timeline.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/getuptimely-com-openapi.json#/components/schemas/IncidentDetail",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Stable opaque incident id."
    },
    "number": {
      "description": "Human-facing sequential incident number.",
      "type": [
        "number",
        "null"
      ]
    },
    "title": {
      "type": "string",
      "description": "Incident title."
    },
    "description": {
      "description": "Optional longer description.",
      "type": [
        "string",
        "null"
      ]
    },
    "state": {
      "$ref": "#/$defs/IncidentStateRef"
    },
    "severity": {
      "anyOf": [
        {
          "$ref": "#/$defs/SeverityRef"
        },
        {
          "type": "null"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "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))$",
      "format": "date-time",
      "description": "Declaration time, ISO-8601 UTC."
    },
    "updated_at": {
      "type": "string",
      "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))$",
      "format": "date-time",
      "description": "Last update time, ISO-8601 UTC."
    },
    "monitors": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "monitor_type": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "monitor_type"
        ],
        "additionalProperties": false
      },
      "description": "Monitors attached to this incident."
    },
    "state_timeline": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "state": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "color": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "name",
              "color"
            ],
            "additionalProperties": false
          },
          "created_at": {
            "type": "string",
            "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))$",
            "format": "date-time"
          }
        },
        "required": [
          "state",
          "created_at"
        ],
        "additionalProperties": false
      },
      "description": "The 20 newest state transitions, newest first."
    }
  },
  "required": [
    "id",
    "number",
    "title",
    "description",
    "state",
    "severity",
    "created_at",
    "updated_at",
    "monitors",
    "state_timeline"
  ],
  "additionalProperties": false,
  "$defs": {
    "IncidentStateRef": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Current lifecycle state name, e.g. \"Identified\"."
        },
        "color": {
          "description": "Display color of the state (hex), when configured.",
          "type": [
            "string",
            "null"
          ]
        },
        "is_resolved": {
          "type": "boolean",
          "description": "True when this state closes the incident."
        }
      },
      "required": [
        "name",
        "color",
        "is_resolved"
      ],
      "additionalProperties": false,
      "description": "An incident lifecycle state."
    },
    "SeverityRef": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Severity name, e.g. \"Minor\" or \"Major\"."
        },
        "color": {
          "description": "Display color of the severity (hex), when configured.",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "name",
        "color"
      ],
      "additionalProperties": false,
      "description": "A configured severity level."
    }
  }
}