{
  "openapi": "3.0.3",
  "info": {
    "title": "Hyperping API",
    "description": "Hyperping is an uptime monitoring platform and status page service. This API allows you to programmatically manage monitors, healthchecks, incidents, outages, maintenance windows, and access uptime reports.",
    "version": "1.0.0",
    "contact": {
      "name": "Hyperping Support",
      "email": "hello@hyperping.io",
      "url": "https://hyperping.com"
    },
    "x-logo": {
      "url": "https://hyperping.com/icons/icon-512x512.png"
    }
  },
  "servers": [
    {
      "url": "https://api.hyperping.io",
      "description": "Production API server"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    { "name": "Monitors", "description": "Uptime monitors for websites and APIs" },
    { "name": "Healthchecks", "description": "Cron job and scheduled task monitoring" },
    { "name": "Incidents", "description": "Status page incident management" },
    { "name": "Outages", "description": "Detected downtime events and manual incidents" },
    { "name": "Maintenance", "description": "Scheduled maintenance windows" },
    { "name": "Reports", "description": "Uptime and performance reports" }
  ],
  "paths": {
    "/v1/monitors": {
      "get": {
        "tags": ["Monitors"],
        "summary": "List all monitors",
        "description": "Returns a list of all monitors for a project.",
        "operationId": "listMonitors",
        "responses": {
          "200": {
            "description": "List of monitors",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/Monitor" }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" }
        }
      },
      "post": {
        "tags": ["Monitors"],
        "summary": "Create a monitor",
        "description": "Creates a new uptime monitor.",
        "operationId": "createMonitor",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/MonitorCreate" }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Monitor created",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Monitor" }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" }
        }
      }
    },
    "/v1/monitors/{uuid}": {
      "get": {
        "tags": ["Monitors"],
        "summary": "Get a monitor",
        "description": "Retrieve details of a specific monitor.",
        "operationId": "getMonitor",
        "parameters": [
          { "$ref": "#/components/parameters/MonitorUuid" }
        ],
        "responses": {
          "200": {
            "description": "Monitor details",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Monitor" }
              }
            }
          },
          "404": { "$ref": "#/components/responses/NotFound" }
        }
      },
      "put": {
        "tags": ["Monitors"],
        "summary": "Update a monitor",
        "description": "Update an existing monitor's configuration.",
        "operationId": "updateMonitor",
        "parameters": [
          { "$ref": "#/components/parameters/MonitorUuid" }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/MonitorCreate" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Monitor updated",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Monitor" }
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["Monitors"],
        "summary": "Delete a monitor",
        "description": "Permanently delete a monitor.",
        "operationId": "deleteMonitor",
        "parameters": [
          { "$ref": "#/components/parameters/MonitorUuid" }
        ],
        "responses": {
          "200": { "description": "Monitor deleted" }
        }
      }
    },
    "/v1/healthchecks": {
      "get": {
        "tags": ["Healthchecks"],
        "summary": "List all healthchecks",
        "description": "Returns all healthcheck monitors for cron job monitoring.",
        "operationId": "listHealthchecks",
        "responses": {
          "200": {
            "description": "List of healthchecks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/Healthcheck" }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Healthchecks"],
        "summary": "Create a healthcheck",
        "description": "Creates a new healthcheck. Supports simple (periodic interval) and cron (cron expression) modes.",
        "operationId": "createHealthcheck",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/HealthcheckCreate" }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Healthcheck created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": { "type": "string" },
                    "healthcheck": { "$ref": "#/components/schemas/Healthcheck" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/healthchecks/{uuid}": {
      "get": {
        "tags": ["Healthchecks"],
        "summary": "Get a healthcheck",
        "operationId": "getHealthcheck",
        "parameters": [
          { "$ref": "#/components/parameters/HealthcheckUuid" }
        ],
        "responses": {
          "200": {
            "description": "Healthcheck details",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Healthcheck" }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Healthchecks"],
        "summary": "Update a healthcheck",
        "operationId": "updateHealthcheck",
        "parameters": [
          { "$ref": "#/components/parameters/HealthcheckUuid" }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/HealthcheckCreate" }
            }
          }
        },
        "responses": {
          "200": { "description": "Healthcheck updated" }
        }
      },
      "delete": {
        "tags": ["Healthchecks"],
        "summary": "Delete a healthcheck",
        "operationId": "deleteHealthcheck",
        "parameters": [
          { "$ref": "#/components/parameters/HealthcheckUuid" }
        ],
        "responses": {
          "200": { "description": "Healthcheck deleted" }
        }
      }
    },
    "/v1/healthchecks/{uuid}/pause": {
      "post": {
        "tags": ["Healthchecks"],
        "summary": "Pause a healthcheck",
        "description": "Temporarily pause monitoring and alerting.",
        "operationId": "pauseHealthcheck",
        "parameters": [
          { "$ref": "#/components/parameters/HealthcheckUuid" }
        ],
        "responses": {
          "200": { "description": "Healthcheck paused" }
        }
      }
    },
    "/v1/healthchecks/{uuid}/resume": {
      "post": {
        "tags": ["Healthchecks"],
        "summary": "Resume a healthcheck",
        "description": "Resume a paused healthcheck.",
        "operationId": "resumeHealthcheck",
        "parameters": [
          { "$ref": "#/components/parameters/HealthcheckUuid" }
        ],
        "responses": {
          "200": { "description": "Healthcheck resumed" }
        }
      }
    },
    "/v3/incidents": {
      "get": {
        "tags": ["Incidents"],
        "summary": "List all incidents",
        "description": "Returns all status page incidents.",
        "operationId": "listIncidents",
        "responses": {
          "200": {
            "description": "List of incidents",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/Incident" }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Incidents"],
        "summary": "Create an incident",
        "description": "Creates a new status page incident.",
        "operationId": "createIncident",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/IncidentCreate" }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Incident created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": { "type": "string" },
                    "uuid": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v3/incidents/{uuid}": {
      "get": {
        "tags": ["Incidents"],
        "summary": "Get an incident",
        "operationId": "getIncident",
        "parameters": [
          { "$ref": "#/components/parameters/IncidentUuid" }
        ],
        "responses": {
          "200": {
            "description": "Incident details",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Incident" }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Incidents"],
        "summary": "Update an incident",
        "operationId": "updateIncident",
        "parameters": [
          { "$ref": "#/components/parameters/IncidentUuid" }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/IncidentCreate" }
            }
          }
        },
        "responses": {
          "200": { "description": "Incident updated" }
        }
      },
      "delete": {
        "tags": ["Incidents"],
        "summary": "Delete an incident",
        "operationId": "deleteIncident",
        "parameters": [
          { "$ref": "#/components/parameters/IncidentUuid" }
        ],
        "responses": {
          "200": { "description": "Incident deleted" }
        }
      }
    },
    "/v3/incidents/{uuid}/updates": {
      "post": {
        "tags": ["Incidents"],
        "summary": "Add incident update",
        "description": "Post a timeline update to an incident.",
        "operationId": "addIncidentUpdate",
        "parameters": [
          { "$ref": "#/components/parameters/IncidentUuid" }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/IncidentUpdate" }
            }
          }
        },
        "responses": {
          "200": { "description": "Update added" }
        }
      }
    },
    "/v2/outages": {
      "get": {
        "tags": ["Outages"],
        "summary": "List all outages",
        "description": "Returns a paginated list of detected outages.",
        "operationId": "listOutages",
        "parameters": [
          { "name": "page", "in": "query", "schema": { "type": "number", "default": 0 }, "description": "Page number (0-indexed)" },
          { "name": "status", "in": "query", "schema": { "type": "string", "enum": ["all", "ongoing", "resolved"], "default": "all" }, "description": "Filter by outage status" },
          { "name": "type", "in": "query", "schema": { "type": "string", "enum": ["all", "manual", "monitor"], "default": "all" }, "description": "Filter by outage type" },
          { "name": "search", "in": "query", "schema": { "type": "string" }, "description": "Search by description or incident number (e.g. INC-123)" }
        ],
        "responses": {
          "200": {
            "description": "List of outages",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "outages": { "type": "array", "items": { "$ref": "#/components/schemas/Outage" } },
                    "hasNextPage": { "type": "boolean" },
                    "total": { "type": "number" },
                    "ongoingCount": { "type": "number" },
                    "page": { "type": "number" },
                    "resultsPerPage": { "type": "number" }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Outages"],
        "summary": "Create a manual incident",
        "description": "Creates a manual incident that can trigger escalation policies.",
        "operationId": "createOutage",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/OutageCreate" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Incident created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": { "type": "string" },
                    "outage": { "$ref": "#/components/schemas/Outage" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v2/outages/{uuid}": {
      "get": {
        "tags": ["Outages"],
        "summary": "Get an outage",
        "operationId": "getOutage",
        "parameters": [
          { "$ref": "#/components/parameters/OutageUuid" }
        ],
        "responses": {
          "200": {
            "description": "Outage details",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Outage" }
              }
            }
          }
        }
      },
      "delete": {
        "tags": ["Outages"],
        "summary": "Delete an outage",
        "operationId": "deleteOutage",
        "parameters": [
          { "$ref": "#/components/parameters/OutageUuid" }
        ],
        "responses": {
          "200": { "description": "Outage deleted" }
        }
      }
    },
    "/v2/outages/{uuid}/acknowledge": {
      "post": {
        "tags": ["Outages"],
        "summary": "Acknowledge an outage",
        "description": "Acknowledge an outage to stop further escalation notifications.",
        "operationId": "acknowledgeOutage",
        "parameters": [
          { "$ref": "#/components/parameters/OutageUuid" }
        ],
        "responses": {
          "200": { "description": "Outage acknowledged" }
        }
      }
    },
    "/v2/outages/{uuid}/unacknowledge": {
      "post": {
        "tags": ["Outages"],
        "summary": "Unacknowledge an outage",
        "description": "Remove acknowledgment to resume escalation alerts.",
        "operationId": "unacknowledgeOutage",
        "parameters": [
          { "$ref": "#/components/parameters/OutageUuid" }
        ],
        "responses": {
          "200": { "description": "Acknowledgment removed" }
        }
      }
    },
    "/v2/outages/{uuid}/resolve": {
      "post": {
        "tags": ["Outages"],
        "summary": "Resolve an outage",
        "description": "Mark an outage as resolved.",
        "operationId": "resolveOutage",
        "parameters": [
          { "$ref": "#/components/parameters/OutageUuid" }
        ],
        "responses": {
          "200": { "description": "Outage resolved" }
        }
      }
    },
    "/v2/outages/{uuid}/escalate": {
      "post": {
        "tags": ["Outages"],
        "summary": "Escalate an outage",
        "description": "Manually escalate to the next level in your escalation policy.",
        "operationId": "escalateOutage",
        "parameters": [
          { "$ref": "#/components/parameters/OutageUuid" }
        ],
        "responses": {
          "200": { "description": "Outage escalated" }
        }
      }
    },
    "/v1/maintenance-windows": {
      "get": {
        "tags": ["Maintenance"],
        "summary": "List maintenance windows",
        "operationId": "listMaintenance",
        "responses": {
          "200": {
            "description": "List of maintenance windows",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/MaintenanceWindow" }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Maintenance"],
        "summary": "Create a maintenance window",
        "description": "Schedule a maintenance window to suppress alerts.",
        "operationId": "createMaintenance",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/MaintenanceCreate" }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Maintenance window created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "uuid": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/maintenance-windows/{uuid}": {
      "get": {
        "tags": ["Maintenance"],
        "summary": "Get a maintenance window",
        "operationId": "getMaintenance",
        "parameters": [
          { "$ref": "#/components/parameters/MaintenanceUuid" }
        ],
        "responses": {
          "200": {
            "description": "Maintenance window details",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/MaintenanceWindow" }
              }
            }
          }
        }
      },
      "put": {
        "tags": ["Maintenance"],
        "summary": "Update a maintenance window",
        "operationId": "updateMaintenance",
        "parameters": [
          { "$ref": "#/components/parameters/MaintenanceUuid" }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/MaintenanceCreate" }
            }
          }
        },
        "responses": {
          "200": { "description": "Maintenance window updated" }
        }
      },
      "delete": {
        "tags": ["Maintenance"],
        "summary": "Delete a maintenance window",
        "operationId": "deleteMaintenance",
        "parameters": [
          { "$ref": "#/components/parameters/MaintenanceUuid" }
        ],
        "responses": {
          "200": { "description": "Maintenance window deleted" }
        }
      }
    },
    "/v2/reporting/monitor-reports": {
      "get": {
        "tags": ["Reports"],
        "summary": "List all reports",
        "description": "Returns uptime reports for all monitors.",
        "operationId": "listReports",
        "responses": {
          "200": {
            "description": "List of reports",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/ReportSummary" }
                }
              }
            }
          }
        }
      }
    },
    "/v2/reporting/monitor-reports/{uuid}": {
      "get": {
        "tags": ["Reports"],
        "summary": "Get monitor report",
        "description": "Returns detailed SLA, MTTR, and outage data for a specific monitor.",
        "operationId": "getReport",
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "schema": { "type": "string" },
            "description": "Monitor UUID",
            "example": "mon_wq1sFyHbxC7YRC"
          },
          {
            "name": "from",
            "in": "query",
            "schema": { "type": "string", "format": "date-time" },
            "description": "Start date (ISO 8601). Defaults to 7 days ago."
          },
          {
            "name": "to",
            "in": "query",
            "schema": { "type": "string", "format": "date-time" },
            "description": "End date (ISO 8601). Defaults to now."
          }
        ],
        "responses": {
          "200": {
            "description": "Detailed report",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Report" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "API key from https://app.hyperping.io/project/developers"
      }
    },
    "parameters": {
      "MonitorUuid": {
        "name": "uuid",
        "in": "path",
        "required": true,
        "schema": { "type": "string" },
        "description": "Monitor UUID",
        "example": "mon_OYKr5fpSDHqbP2"
      },
      "HealthcheckUuid": {
        "name": "uuid",
        "in": "path",
        "required": true,
        "schema": { "type": "string" },
        "description": "Healthcheck UUID",
        "example": "tok_abc123def456"
      },
      "IncidentUuid": {
        "name": "uuid",
        "in": "path",
        "required": true,
        "schema": { "type": "string" },
        "description": "Incident UUID",
        "example": "inci_cDAqydvnNnyc8D"
      },
      "OutageUuid": {
        "name": "uuid",
        "in": "path",
        "required": true,
        "schema": { "type": "string" },
        "description": "Outage UUID",
        "example": "outage_abc123"
      },
      "MaintenanceUuid": {
        "name": "uuid",
        "in": "path",
        "required": true,
        "schema": { "type": "string" },
        "description": "Maintenance window UUID",
        "example": "mw_ot0dguXcrUnB2b"
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Invalid or missing API key",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": { "type": "string", "example": "Invalid or missing API key" }
              }
            }
          }
        }
      },
      "NotFound": {
        "description": "Resource not found",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": { "type": "string", "example": "Resource not found" }
              }
            }
          }
        }
      }
    },
    "schemas": {
      "Monitor": {
        "type": "object",
        "properties": {
          "uuid": { "type": "string", "example": "mon_OYKr5fpSDHqbP2" },
          "name": { "type": "string", "example": "API" },
          "url": { "type": "string", "example": "https://api.acme.com" },
          "protocol": { "type": "string", "enum": ["http", "port", "icmp"] },
          "http_method": { "type": "string", "enum": ["GET", "POST", "PUT", "HEAD", "DELETE", "PATCH", "OPTIONS"] },
          "check_frequency": { "type": "integer", "description": "Check interval in seconds", "example": 30 },
          "regions": {
            "type": "array",
            "items": { "type": "string" },
            "example": ["paris", "london", "frankfurt"]
          },
          "status": { "type": "string", "enum": ["up", "down"] },
          "paused": { "type": "boolean" },
          "expected_status_code": { "type": "string", "description": "Use \"2xx\" for 200-299, \"1xx-3xx\" for 100-399, or a specific code like \"200\"", "example": "2xx" },
          "required_keyword": { "type": "string" },
          "follow_redirects": { "type": "boolean" },
          "port": { "type": "integer", "nullable": true },
          "ssl_expiration": { "type": "integer", "description": "Days until SSL expiration" },
          "alerts_wait": { "type": "integer", "description": "Minutes before alerting (-1 to disable)" },
          "escalation_policy": {
            "type": "object",
            "nullable": true,
            "properties": {
              "uuid": { "type": "string" },
              "name": { "type": "string" }
            }
          }
        }
      },
      "MonitorCreate": {
        "type": "object",
        "required": ["name", "url"],
        "properties": {
          "name": { "type": "string", "example": "My Website" },
          "url": { "type": "string", "example": "https://acme.com" },
          "protocol": { "type": "string", "enum": ["http", "port", "icmp"], "default": "http" },
          "http_method": { "type": "string", "enum": ["GET", "POST", "PUT", "HEAD", "DELETE", "PATCH", "OPTIONS"], "default": "GET" },
          "check_frequency": { "type": "integer", "enum": [10, 20, 30, 60, 120, 180, 300, 600, 1800, 3600, 21600, 43200, 86400], "default": 30 },
          "regions": {
            "type": "array",
            "items": { "type": "string", "enum": ["sanfrancisco", "nyc", "london", "paris", "frankfurt", "seoul", "mumbai", "bangalore", "saopaulo", "california", "virginia", "sydney", "toronto", "amsterdam", "singapore", "tokyo", "bahrain", "capetown"] }
          },
          "expected_status_code": { "type": "string", "description": "Use \"2xx\" for 200-299, \"1xx-3xx\" for 100-399, or a specific code like \"200\"", "default": "2xx" },
          "required_keyword": { "type": "string" },
          "follow_redirects": { "type": "boolean", "default": true },
          "port": { "type": "integer" },
          "paused": { "type": "boolean", "default": false },
          "alerts_wait": { "type": "integer", "enum": [-1, 0, 1, 2, 3, 5, 10, 30, 60], "default": 0 },
          "request_body": { "type": "string" },
          "request_headers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": { "type": "string" },
                "value": { "type": "string" }
              }
            }
          },
          "escalation_policy": { "type": "string", "description": "Policy UUID or 'none' to unlink" }
        }
      },
      "Healthcheck": {
        "type": "object",
        "properties": {
          "uuid": { "type": "string", "example": "tok_abc123def456" },
          "name": { "type": "string", "example": "Daily Backup Job" },
          "pingUrl": { "type": "string", "example": "https://hc.hyperping.io/tok_abc123def456" },
          "period": { "type": "integer", "description": "Expected interval in seconds" },
          "periodValue": { "type": "integer", "nullable": true },
          "periodType": { "type": "string", "nullable": true, "enum": ["seconds", "minutes", "hours", "days"] },
          "gracePeriod": { "type": "integer", "description": "Grace period in seconds" },
          "gracePeriodValue": { "type": "integer" },
          "gracePeriodType": { "type": "string", "enum": ["seconds", "minutes", "hours", "days"] },
          "cron": { "type": "string", "nullable": true, "example": "0 2 * * *" },
          "timezone": { "type": "string", "example": "America/New_York" }
        }
      },
      "HealthcheckCreate": {
        "type": "object",
        "required": ["name", "grace_period_value", "grace_period_type"],
        "properties": {
          "name": { "type": "string", "example": "Daily Backup Job" },
          "period_value": { "type": "integer", "description": "Expected ping interval (simple mode)" },
          "period_type": { "type": "string", "enum": ["seconds", "minutes", "hours", "days"] },
          "grace_period_value": { "type": "integer", "example": 5 },
          "grace_period_type": { "type": "string", "enum": ["seconds", "minutes", "hours", "days"] },
          "cron": { "type": "string", "description": "Cron expression (cron mode)", "example": "0 2 * * *" },
          "timezone": { "type": "string", "default": "UTC" }
        }
      },
      "Incident": {
        "type": "object",
        "properties": {
          "uuid": { "type": "string" },
          "title": { "$ref": "#/components/schemas/LocalizedText" },
          "type": { "type": "string", "enum": ["outage", "incident"] },
          "affectedComponents": { "type": "array", "items": { "type": "string" } },
          "statuspages": { "type": "array", "items": { "type": "string" } },
          "updates": { "type": "array", "items": { "$ref": "#/components/schemas/IncidentUpdate" } }
        }
      },
      "IncidentCreate": {
        "type": "object",
        "required": ["title", "type"],
        "properties": {
          "title": { "$ref": "#/components/schemas/LocalizedText" },
          "type": { "type": "string", "enum": ["outage", "incident"] },
          "affectedComponents": { "type": "array", "items": { "type": "string" } },
          "statuspages": { "type": "array", "items": { "type": "string" } },
          "updates": { "type": "array", "items": { "$ref": "#/components/schemas/IncidentUpdate" } }
        }
      },
      "IncidentUpdate": {
        "type": "object",
        "properties": {
          "date": { "type": "string", "format": "date-time" },
          "text": { "$ref": "#/components/schemas/LocalizedText" },
          "type": { "type": "string", "enum": ["investigating", "identified", "update", "monitoring", "resolved"] }
        }
      },
      "LocalizedText": {
        "type": "object",
        "description": "Localized text object with language keys",
        "properties": {
          "en": { "type": "string" },
          "fr": { "type": "string" },
          "de": { "type": "string" },
          "ru": { "type": "string" },
          "nl": { "type": "string" },
          "pl": { "type": "string" },
          "se": { "type": "string" }
        },
        "example": { "en": "We are investigating the issue", "fr": "Nous enquêtons sur le problème" }
      },
      "Outage": {
        "type": "object",
        "properties": {
          "uuid": { "type": "string", "example": "outage_abc123" },
          "startDate": { "type": "string", "format": "date-time" },
          "endDate": { "type": "string", "format": "date-time", "nullable": true },
          "durationMs": { "type": "number", "description": "Duration in milliseconds" },
          "statusCode": { "type": "number", "example": 500 },
          "description": { "type": "string" },
          "isResolved": { "type": "boolean" },
          "detectedLocation": { "type": "string", "example": "paris" },
          "confirmedLocations": { "type": "string", "example": "paris,london,frankfurt" },
          "protocol": { "type": "string", "example": "http" },
          "severity": { "type": "string", "enum": ["critical", "major", "minor"], "default": "minor" },
          "incidentNumber": { "type": "number", "nullable": true, "description": "Auto-incrementing per-project incident number" },
          "acknowledgedAt": { "type": "string", "format": "date-time", "nullable": true },
          "acknowledgedBy": { "type": "object", "nullable": true, "properties": {
            "uuid": { "type": "string" },
            "email": { "type": "string" },
            "name": { "type": "string" }
          }},
          "reportedBy": { "type": "object", "nullable": true, "description": "User who reported the incident (manual incidents only)", "properties": {
            "uuid": { "type": "string" },
            "email": { "type": "string" },
            "name": { "type": "string" }
          }},
          "monitor": { "type": "object", "nullable": true, "properties": {
            "uuid": { "type": "string" },
            "name": { "type": "string" },
            "url": { "type": "string" },
            "protocol": { "type": "string" }
          }},
          "escalationPolicy": { "type": "object", "nullable": true, "properties": {
            "uuid": { "type": "string" },
            "name": { "type": "string" },
            "alertedSteps": { "type": "number" },
            "totalSteps": { "type": "number" }
          }},
          "summary": { "type": "string", "nullable": true, "description": "User-written summary (rich text)" },
          "aiSummary": { "type": "string", "nullable": true, "description": "AI-generated summary" },
          "postmortem": { "type": "string", "nullable": true, "description": "Post-mortem analysis (rich text)" },
          "escalationPolicyUuid": { "type": "string", "nullable": true }
        }
      },
      "OutageCreate": {
        "type": "object",
        "required": ["description"],
        "properties": {
          "description": { "type": "string", "example": "Database maintenance in progress" },
          "escalationPolicyUuid": { "type": "string", "description": "UUID of escalation policy to trigger" },
          "severity": { "type": "string", "enum": ["critical", "major", "minor"], "default": "minor", "description": "Severity level of the incident" },
          "summary": { "type": "string", "description": "Initial summary for the incident (rich text)" }
        }
      },
      "MaintenanceWindow": {
        "type": "object",
        "properties": {
          "uuid": { "type": "string" },
          "name": { "type": "string" },
          "start_date": { "type": "string", "format": "date-time" },
          "end_date": { "type": "string", "format": "date-time" },
          "monitors": { "type": "array", "items": { "type": "string" } },
          "statuspages": { "type": "array", "items": { "type": "string" } },
          "title": { "$ref": "#/components/schemas/LocalizedText" }
        }
      },
      "MaintenanceCreate": {
        "type": "object",
        "required": ["name", "start_date", "end_date", "monitors"],
        "properties": {
          "name": { "type": "string", "example": "Scheduled Database Maintenance" },
          "start_date": { "type": "string", "format": "date-time" },
          "end_date": { "type": "string", "format": "date-time" },
          "monitors": { "type": "array", "items": { "type": "string" } },
          "statuspages": { "type": "array", "items": { "type": "string" } },
          "title": { "$ref": "#/components/schemas/LocalizedText" },
          "updates": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "text": { "$ref": "#/components/schemas/LocalizedText" },
                "date": { "type": "string", "format": "date-time" }
              }
            }
          },
          "notificationOption": { "type": "string", "enum": ["none", "immediate", "scheduled"], "default": "none" },
          "notificationMinutes": { "type": "integer", "default": 60 }
        }
      },
      "ReportSummary": {
        "type": "object",
        "properties": {
          "uuid": { "type": "string" },
          "name": { "type": "string" },
          "sla": { "type": "number", "description": "Uptime percentage" }
        }
      },
      "Report": {
        "type": "object",
        "properties": {
          "uuid": { "type": "string" },
          "name": { "type": "string" },
          "protocol": { "type": "string" },
          "period": {
            "type": "object",
            "properties": {
              "from": { "type": "string", "format": "date-time" },
              "to": { "type": "string", "format": "date-time" }
            }
          },
          "sla": { "type": "number", "example": 99.184 },
          "outages": {
            "type": "object",
            "properties": {
              "count": { "type": "integer" },
              "totalDowntime": { "type": "integer", "description": "Seconds" },
              "totalDowntimeFormatted": { "type": "string" },
              "longestOutage": { "type": "integer" },
              "longestOutageFormatted": { "type": "string" },
              "details": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "startDate": { "type": "string", "format": "date-time" },
                    "endDate": { "type": "string", "format": "date-time" },
                    "duration": { "type": "integer" },
                    "durationFormatted": { "type": "string" }
                  }
                }
              }
            }
          },
          "mttr": { "type": "integer", "description": "Mean Time To Recovery in seconds" },
          "mttrFormatted": { "type": "string" }
        }
      }
    }
  },
  "externalDocs": {
    "description": "Hyperping API Documentation",
    "url": "https://hyperping.com/docs/api/overview"
  }
}
