{
  "openapi": "3.1.0",
  "info": {
    "title": "Today's Outage API",
    "version": "1.0.0",
    "description": "Live outages from official status pages and news. No authentication. Data refreshes about once a minute; please poll at most every 60 seconds. More than 20 requests per 10 seconds per IP get HTTP 429 for 10 seconds."
  },
  "servers": [{ "url": "https://todaysoutage.com" }],
  "paths": {
    "/api/status.json": {
      "get": {
        "operationId": "getStatus",
        "summary": "Full live snapshot: today's outage, ranked outages, open incidents, status board, headlines, last 7 days",
        "responses": {
          "200": {
            "description": "Snapshot",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "version": { "type": "string" },
                    "generated_at": { "type": "integer", "description": "epoch milliseconds" },
                    "day": { "type": "string", "description": "YYYY-MM-DD, US Eastern" },
                    "headline": { "oneOf": [{ "$ref": "#/components/schemas/Outage" }, { "type": "null" }] },
                    "outages": { "type": "array", "items": { "$ref": "#/components/schemas/Outage" } },
                    "ongoing": { "type": "array", "items": { "$ref": "#/components/schemas/Incident" } },
                    "services": { "type": "array", "items": { "$ref": "#/components/schemas/Service" } },
                    "wire": { "type": "array", "items": { "$ref": "#/components/schemas/Headline" } },
                    "days_since_major": { "type": ["integer", "null"] },
                    "major_this_week": { "type": "integer" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/today.md": {
      "get": {
        "operationId": "getTodayMarkdown",
        "summary": "Today's outages as Markdown (for LLMs)",
        "responses": { "200": { "description": "Markdown", "content": { "text/markdown": { "schema": { "type": "string" } } } } }
      }
    },
    "/feed.xml": {
      "get": {
        "operationId": "getFeed",
        "summary": "RSS feed of today's outages and recent daily top outages",
        "responses": { "200": { "description": "RSS 2.0", "content": { "application/rss+xml": { "schema": { "type": "string" } } } } }
      }
    }
  },
  "components": {
    "schemas": {
      "Outage": {
        "type": "object",
        "properties": {
          "key": { "type": "string" },
          "name": { "type": "string" },
          "category": { "type": "string" },
          "what": { "type": "string" },
          "status": { "type": "string", "enum": ["ongoing", "resolved", "unclear"] },
          "score": { "type": "number" },
          "severity": { "type": "integer", "minimum": 1, "maximum": 5 },
          "started_at": { "type": ["integer", "null"] },
          "resolved_at": { "type": ["integer", "null"] },
          "url": { "type": ["string", "null"] },
          "reports": { "type": "integer" },
          "joke": { "type": ["string", "null"], "description": "Unhinged-mode one-liner, stable for the day; null where jokes are off-limits (emergencies, health)" }
        }
      },
      "Incident": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "provider": { "type": "string" },
          "category": { "type": "string" },
          "title": { "type": "string" },
          "status": { "type": "string", "enum": ["ongoing", "resolved"] },
          "impact": { "type": "string", "enum": ["critical", "major", "minor", "none"] },
          "url": { "type": ["string", "null"] },
          "started_at": { "type": "integer" },
          "resolved_at": { "type": ["integer", "null"] }
        }
      },
      "Service": {
        "type": "object",
        "properties": {
          "key": { "type": "string" },
          "name": { "type": "string" },
          "status": { "type": "string", "enum": ["up", "degraded", "down", "unknown"] },
          "checked_at": { "type": ["integer", "null"], "description": "Last successful poll of the official status page (epoch ms); null if it never answered." },
          "fresh": { "type": "boolean", "description": "False when the last poll failed or is overdue: status is then a stale reading, or unknown." },
          "url": { "type": "string" },
          "incidents": { "type": "integer" }
        }
      },
      "Headline": {
        "type": "object",
        "properties": {
          "title": { "type": "string" },
          "publisher": { "type": ["string", "null"] },
          "url": { "type": "string" },
          "published_at": { "type": "integer" }
        }
      }
    }
  }
}
