{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fettle-sh/json-schema/fettle-sh-status-page-public-read-schema.json",
  "title": "StatusPagePublicRead",
  "description": "The anonymous status-page payload.\n\n``history_days`` is the **effective** strip length after clamping by the\nplan's retention, so the frontend renders the axis it was actually served.\n``branding_removable`` is false on FREE, PLUS and PRO, where the mandatory\nfettle.sh backlink is rendered by the frontend. The core does not own the\nbacklink copy, so this description deliberately does not quote it.\n``updated_at`` is when this payload was assembled — data freshness, safe to\nrender as \"Last updated\" — not when the page was last edited.\n``active_incidents`` and ``past_incidents`` are the public incident\ntimelines: every open incident, and resolved incidents within a trailing\nwindow (see ``PAST_INCIDENTS_WINDOW_DAYS``/``PAST_INCIDENTS_LIMIT`` in the\nuse case). ``subscriptions_enabled`` mirrors the plan's status-page\nsubscriber cap, so the frontend can hide the subscribe form on a FREE org.",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/fettle-sh-api-openapi.json#/components/schemas/StatusPagePublicRead",
  "properties": {
    "slug": {
      "type": "string",
      "title": "Slug"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "description": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Description"
    },
    "status": {
      "$ref": "#/$defs/PageStatus"
    },
    "branding_removable": {
      "type": "boolean",
      "title": "Branding Removable"
    },
    "history_days": {
      "type": "integer",
      "title": "History Days"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "groups": {
      "items": {
        "$ref": "#/$defs/PublicGroupRead"
      },
      "type": "array",
      "title": "Groups"
    },
    "ungrouped_components": {
      "items": {
        "$ref": "#/$defs/PublicComponentRead"
      },
      "type": "array",
      "title": "Ungrouped Components"
    },
    "active_incidents": {
      "items": {
        "$ref": "#/$defs/PublicIncidentRead"
      },
      "type": "array",
      "title": "Active Incidents"
    },
    "past_incidents": {
      "items": {
        "$ref": "#/$defs/PublicIncidentRead"
      },
      "type": "array",
      "title": "Past Incidents"
    },
    "subscriptions_enabled": {
      "type": "boolean",
      "title": "Subscriptions Enabled"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "slug",
    "name",
    "description",
    "status",
    "branding_removable",
    "history_days",
    "updated_at",
    "groups",
    "ungrouped_components",
    "active_incidents",
    "past_incidents",
    "subscriptions_enabled"
  ],
  "$defs": {
    "ComponentStatus": {
      "type": "string",
      "enum": [
        "OPERATIONAL",
        "DEGRADED_PERFORMANCE",
        "MAJOR_OUTAGE",
        "MAINTENANCE",
        "UNKNOWN"
      ],
      "title": "ComponentStatus",
      "description": "Public status of a single component on a status page."
    },
    "PageStatus": {
      "type": "string",
      "enum": [
        "ALL_OPERATIONAL",
        "DEGRADED",
        "PARTIAL_OUTAGE",
        "MAJOR_OUTAGE",
        "MAINTENANCE",
        "UNKNOWN"
      ],
      "title": "PageStatus",
      "description": "Rollup status shown in the page banner."
    },
    "PublicComponentRead": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "name": {
          "type": "string",
          "title": "Name"
        },
        "status": {
          "$ref": "#/$defs/ComponentStatus"
        },
        "uptime_24h": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Uptime 24H"
        },
        "uptime_7d": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Uptime 7D"
        },
        "uptime_history": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Uptime History"
        },
        "monitoring_since": {
          "type": "string",
          "format": "date-time",
          "title": "Monitoring Since",
          "description": "When monitoring of this component started. Uptime windows that reach further back only count time from this moment."
        },
        "history": {
          "items": {
            "$ref": "#/$defs/UptimeDayPoint"
          },
          "type": "array",
          "title": "History"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "id",
        "name",
        "status",
        "uptime_24h",
        "uptime_7d",
        "uptime_history",
        "monitoring_since",
        "history"
      ],
      "title": "PublicComponentRead",
      "description": "Anonymous view of a component. Carries no monitor identifier."
    },
    "PublicGroupRead": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "position": {
          "type": "integer",
          "title": "Position"
        },
        "components": {
          "items": {
            "$ref": "#/$defs/PublicComponentRead"
          },
          "type": "array",
          "title": "Components"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "name",
        "position",
        "components"
      ],
      "title": "PublicGroupRead",
      "description": "Anonymous view of a section."
    },
    "PublicIncidentRead": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "title": "Id"
        },
        "title": {
          "type": "string",
          "title": "Title"
        },
        "status": {
          "$ref": "#/$defs/StatusPageIncidentStatus"
        },
        "started_at": {
          "type": "string",
          "format": "date-time",
          "title": "Started At"
        },
        "resolved_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Resolved At"
        },
        "component_ids": {
          "items": {
            "type": "string",
            "format": "uuid"
          },
          "type": "array",
          "title": "Component Ids"
        },
        "updates": {
          "items": {
            "$ref": "#/$defs/PublicIncidentUpdateRead"
          },
          "type": "array",
          "title": "Updates"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "id",
        "title",
        "status",
        "started_at",
        "resolved_at",
        "component_ids",
        "updates"
      ],
      "title": "PublicIncidentRead",
      "description": "Anonymous view of a public incident and its timeline.\n\nDeliberately excludes ``notified_at``, ``is_auto`` and any reference to\nthe internal incident that may have auto-created the row — the internal\n``Incident.cause``/``cause_detail`` must never reach this payload."
    },
    "PublicIncidentUpdateRead": {
      "properties": {
        "status": {
          "$ref": "#/$defs/StatusPageIncidentStatus"
        },
        "body": {
          "type": "string",
          "title": "Body"
        },
        "posted_at": {
          "type": "string",
          "format": "date-time",
          "title": "Posted At"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "status",
        "body",
        "posted_at"
      ],
      "title": "PublicIncidentUpdateRead",
      "description": "One timeline entry on a public incident, as served anonymously."
    },
    "StatusPageIncidentStatus": {
      "type": "string",
      "enum": [
        "INVESTIGATING",
        "IDENTIFIED",
        "MONITORING",
        "RESOLVED"
      ],
      "title": "StatusPageIncidentStatus",
      "description": "Lifecycle of a public incident on a status page. Persisted."
    },
    "UptimeDayPoint": {
      "properties": {
        "date": {
          "type": "string",
          "format": "date",
          "title": "Date"
        },
        "uptime_percentage": {
          "anyOf": [
            {
              "type": "number",
              "maximum": 100.0,
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Uptime Percentage"
        },
        "total_checks": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Total Checks"
        },
        "up_checks": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Up Checks"
        },
        "down_checks": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Down Checks"
        },
        "degraded_checks": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Degraded Checks",
          "default": 0
        },
        "maintenance_checks": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Maintenance Checks",
          "default": 0
        },
        "downtime_seconds": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Downtime Seconds",
          "description": "Seconds of confirmed downtime inside the day.",
          "default": 0
        },
        "observed_seconds": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Observed Seconds",
          "description": "Seconds of the day the monitor was observed; uptime is measured over this time. Never less than downtime_seconds; 0 means no data.",
          "default": 0
        },
        "degraded_seconds": {
          "type": "integer",
          "minimum": 0.0,
          "title": "Degraded Seconds",
          "description": "Seconds of this UTC day the monitor spent in confirmed DEGRADED status (from the monitor's status history; an ongoing degradation counts up to now). Maintenance is not subtracted. Zero for days before this monitor's status history began (when the status ledger shipped).",
          "default": 0
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "date",
        "uptime_percentage",
        "total_checks",
        "up_checks",
        "down_checks"
      ],
      "title": "UptimeDayPoint",
      "description": "Uptime for a single UTC calendar day in the daily strip.\n\n``uptime_percentage`` is ``1 - downtime_seconds / observed_seconds`` over\nthe day (today: up to now; the creation day: from the monitor's creation):\ndowntime comes from the downtime periods of confirmed incidents; observed\ntime is the hours the monitor was actually probed plus those confirmed\ndowntime periods. Unconfirmed DOWN checks and DEGRADED checks do not\nlower it.\n\n``uptime_percentage`` is ``None`` for a day with nothing observed (before\nthe monitor existed, or any gap) — the frontend renders those as \"no\ndata\" rather than full uptime. Hours probed only during maintenance are\nobserved and count as uptime: a maintenance-only day is ``100.0``.\n\n``degraded_seconds`` is the day's confirmed DEGRADED time from the\nmonitor's status history; the strip colours a day as degraded (amber)\nwhen it is above zero, while its uptime stays green. It does not lower\n``uptime_percentage``.\n\nThe check counters are informational, for the day's tooltip:\n``degraded_checks`` counts raw DEGRADED checks (confirmed or not), and\n``maintenance_checks`` counts checks stamped ``in_maintenance`` and\nexcluded from up/down/degraded."
    }
  }
}