{
  "openapi": "3.1.0",
  "info": {
    "title": "Sentinel Threat Intelligence API",
    "version": "1.0.0",
    "summary": "Real-time SaaS threat intelligence, vendor risk scorecards, alerting rules, and threat-feed observability API.",
    "description": "Sentinel (Sec Sea) exposes read/write REST endpoints for real-time vendor security monitoring, CVE correlation, STIX 2.1/CSV/JSON exports, cookie-backed and shared watchlists, outbound alerting rules, and ingestion webhooks. Protected endpoints enforce fail-closed OpenID Connect (OIDC) authentication via session cookies or Bearer JWTs. Rate-limited routes emit standard X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and Retry-After response headers."
  },
  "servers": [
    {
      "url": "https://sec-sea.com",
      "description": "Active Sentinel instance"
    }
  ],
  "tags": [
    {
      "name": "Alerts",
      "description": "Real-time security alerts, CVE correlation, triage workflows, and analyst notes."
    },
    {
      "name": "Vendors",
      "description": "Monitored SaaS vendor risk scorecards, side-by-side comparison, and Markdown risk briefs."
    },
    {
      "name": "Exports",
      "description": "CSV, JSON, and STIX 2.1 threat intelligence and watchlist export bundles."
    },
    {
      "name": "Watchlist",
      "description": "Curated vendor starter packs, bulk watchlist updates, and shareable snapshot links."
    },
    {
      "name": "Alert Rules",
      "description": "Outbound webhook/Slack/Teams/Discord alerting rules, test-fire, and delivery logs."
    },
    {
      "name": "Ingestion & Webhooks",
      "description": "Authenticated alert ingestion webhooks and scheduled feed-pull triggers."
    },
    {
      "name": "Observability & Meta",
      "description": "Service health probes, per-feed sync telemetry, OIDC auth endpoints, OpenAPI schema, and API Explorer."
    }
  ],
  "paths": {
    "/api/v1/alerts": {
      "get": {
        "operationId": "listAlerts",
        "tags": [
          "Alerts"
        ],
        "summary": "List and filter threat alerts",
        "description": "Paginated alert feed supporting search, vendor/severity/category/source/triage/CVE/time-window filters, and optional embedded analyst notes.",
        "security": [],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "1-based page number.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Page size (clamped to 1..100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free-text search across alert summary, details, source_type, and vendor name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "alert_id",
            "in": "query",
            "required": false,
            "description": "Filter to a specific alert ID.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "tab",
            "in": "query",
            "required": false,
            "description": "Preset stream slice filter.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "security",
                "outages",
                "intel"
              ]
            }
          },
          {
            "name": "classification",
            "in": "query",
            "required": false,
            "description": "Filter by alert classification (e.g. 'Verified Incident', 'Service Outage', 'Analysis / Opinion').",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendor_id",
            "in": "query",
            "required": false,
            "description": "Filter by a single numeric vendor ID.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "vendor_ids",
            "in": "query",
            "required": false,
            "description": "Comma-separated list of numeric vendor IDs.",
            "schema": {
              "type": "string"
            },
            "example": "1,2,3"
          },
          {
            "name": "vendor_slug",
            "in": "query",
            "required": false,
            "description": "Comma-separated list of vendor slugs (case-insensitive).",
            "schema": {
              "type": "string"
            },
            "example": "okta,slack"
          },
          {
            "name": "impact",
            "in": "query",
            "required": false,
            "description": "Comma-separated severity filter (Critical, High, Medium, Low).",
            "schema": {
              "type": "string"
            },
            "example": "Critical,High"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Comma-separated category filter ('Security Issue', 'Operational Issue', 'Maintenance').",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Comma-separated source filter (status, cisa-kev, cve, osint, cisa-advisories, reddit, bleeping, krebs, sans, hackernews, schneier, osint-other).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "acknowledged",
            "in": "query",
            "required": false,
            "description": "Filter by acknowledgement flag ('true', '1', 'false', '0').",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "triage_status",
            "in": "query",
            "required": false,
            "description": "Filter by triage state ('open', 'investigating', 'mitigated', 'false_positive', 'untriaged', 'triaged', or comma-separated statuses).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "verified",
            "in": "query",
            "required": false,
            "description": "When true, restrict to Verified Incident and Service Outage alerts.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "tracked",
            "in": "query",
            "required": false,
            "description": "When true, restrict to vendors in the caller's tracked_vendors cookie.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "cve",
            "in": "query",
            "required": false,
            "description": "Filter alerts referencing a CVE identifier (exact token boundary match for full CVE-YYYY-NNNN+ IDs).",
            "schema": {
              "type": "string"
            },
            "example": "CVE-2026-1234"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Relative time-window preset ('all', '24h', '7d', '30d'). Overridden when explicit 'since' is provided.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "24h",
                "7d",
                "30d"
              ],
              "default": "all"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Lower timestamp bound (ISO-8601 date or datetime, UTC).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Upper timestamp bound (ISO-8601 date or datetime, UTC).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "share_id",
            "in": "query",
            "required": false,
            "description": "Scope alerts to vendors in a shared watchlist ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_muted",
            "in": "query",
            "required": false,
            "description": "When false, excludes alerts matching active mute/snooze rules (default true).",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "include_notes",
            "in": "query",
            "required": false,
            "description": "When true, include full analyst note objects in each alert item.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of matching alerts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query or pagination parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Referenced share_id watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/alerts/{alert_id}": {
      "get": {
        "operationId": "getAlert",
        "tags": [
          "Alerts"
        ],
        "summary": "Get alert details",
        "description": "Returns a single alert with vendor metadata, extracted CVE IDs, and analyst notes.",
        "security": [],
        "parameters": [
          {
            "name": "alert_id",
            "in": "path",
            "required": true,
            "description": "Numeric alert identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Alert detail object.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          },
          "404": {
            "description": "Alert not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/alerts/{alert_id}/correlated": {
      "get": {
        "operationId": "getCorrelatedAlerts",
        "tags": [
          "Alerts"
        ],
        "summary": "Get correlated alerts & CVE intelligence links",
        "description": "Finds related alerts sharing CVE identifiers or same-vendor temporal proximity within the requested correlation window, along with NVD/MITRE/CISA KEV/EPSS intel links.",
        "security": [],
        "parameters": [
          {
            "name": "alert_id",
            "in": "path",
            "required": true,
            "description": "Numeric alert identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "window_hours",
            "in": "query",
            "required": false,
            "description": "Correlation window in hours (1\u2013168).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 168,
              "default": 48
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of correlated alerts returned (1\u201350).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 12
            }
          },
          {
            "name": "share_id",
            "in": "query",
            "required": false,
            "description": "Optional shared watchlist scope.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Correlated alerts and CVE intel links.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CorrelatedAlertsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid window_hours or limit parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Alert or shared watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cves": {
      "get": {
        "operationId": "listCves",
        "tags": [
          "Alerts"
        ],
        "summary": "List aggregated CVE & CISA KEV campaigns",
        "description": "Aggregates all CVE-bearing alerts across the corpus (or scoped to tracked/shared watchlists) into per-CVE intelligence campaigns with CISA KEV status, blast-radius vendor rollups, remediation progress, linked Incident Cases, KPIs, multi-facet filtering, and pagination.",
        "security": [],
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Case-insensitive search across CVE ID, affected vendor name/slug, and alert summaries.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kev",
            "in": "query",
            "required": false,
            "description": "Filter by CISA KEV status ('true', '1', 'false', '0').",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "impact",
            "in": "query",
            "required": false,
            "description": "Comma-separated highest impact filter (Critical, High, Medium, Low).",
            "schema": {
              "type": "string"
            },
            "example": "Critical,High"
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Comma-separated remediation status ('unmitigated', 'investigating', 'mitigated', 'false_positive', 'active', or 'all').",
            "schema": {
              "type": "string"
            },
            "example": "active"
          },
          {
            "name": "tracked",
            "in": "query",
            "required": false,
            "description": "When true, restrict alert corpus to vendors in the caller's tracked_vendors cookie.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "share_id",
            "in": "query",
            "required": false,
            "description": "Scope alert corpus to vendors in a shared watchlist ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendor_slug",
            "in": "query",
            "required": false,
            "description": "Comma-separated vendor slug filter matching CVEs affecting any listed vendor.",
            "schema": {
              "type": "string"
            },
            "example": "okta,slack"
          },
          {
            "name": "has_case",
            "in": "query",
            "required": false,
            "description": "Filter by presence of linked Incident Cases ('true', '1', 'false', '0').",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Relative time-window preset ('all', '24h', '7d', '30d').",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "24h",
                "7d",
                "30d"
              ],
              "default": "all"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Sort order ('priority', 'recent', 'alerts', 'vendors', 'cve_id').",
            "schema": {
              "type": "string",
              "enum": [
                "priority",
                "recent",
                "alerts",
                "vendors",
                "cve_id"
              ],
              "default": "priority"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "1-based page index.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Items per page (1\u2013100, default 25).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated CVE campaign catalog and KPI rollup.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CveListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query, filter, sort, or pagination parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Referenced share_id watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cves/{cve_id}": {
      "get": {
        "operationId": "getCveDossier",
        "tags": [
          "Alerts"
        ],
        "summary": "Get single-CVE campaign dossier",
        "description": "Returns the complete threat intelligence dossier for an exact canonical CVE ID (CVE-YYYY-NNNN+), including blast-radius vendor breakdown, remediation progress, matching alerts (strict token-boundary filtered), linked Incident Cases, and escalation defaults.",
        "security": [],
        "parameters": [
          {
            "name": "cve_id",
            "in": "path",
            "required": true,
            "description": "Canonical CVE identifier (e.g. 'CVE-2026-1234').",
            "schema": {
              "type": "string",
              "pattern": "^CVE-\\d{4}-\\d{4,7}$"
            },
            "example": "CVE-2026-1234"
          },
          {
            "name": "tracked",
            "in": "query",
            "required": false,
            "description": "When true, restrict matching alerts to the caller's tracked_vendors cookie.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "share_id",
            "in": "query",
            "required": false,
            "description": "Scope matching alerts to vendors in a shared watchlist ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CVE campaign dossier with matching alerts and linked incident cases.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CveDetailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid CVE identifier or boolean query parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "CVE not found in current scope or shared watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/alerts/{alert_id}/triage": {
      "post": {
        "operationId": "triageAlert",
        "tags": [
          "Alerts"
        ],
        "summary": "Update triage status for a single alert",
        "description": "Transitions an alert between open, investigating, mitigated, and false_positive, recalculates the parent vendor's status light, and broadcasts an SSE triage_update event.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 60,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "alert_id",
            "in": "path",
            "required": true,
            "description": "Numeric alert identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertTriageRequest"
              },
              "example": {
                "triage_status": "investigating"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Alert triage status updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertTriageResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Invalid triage_status value.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Alert not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Rate limit exceeded. Please try again later."
              }
            }
          }
        }
      }
    },
    "/alerts/bulk-triage": {
      "post": {
        "operationId": "bulkTriageAlerts",
        "tags": [
          "Alerts"
        ],
        "summary": "Bulk-update triage status for up to 200 alerts",
        "description": "Atomically updates triage_status across up to 200 alert IDs, syncs affected vendor status lights, and emits a single SSE bulk_triage_update event.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BulkTriageRequest"
              },
              "example": {
                "alert_ids": [
                  1,
                  2,
                  3
                ],
                "triage_status": "mitigated"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bulk triage update summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BulkTriageResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Invalid payload, alert_ids, or triage_status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Rate limit exceeded. Please try again later."
              }
            }
          }
        }
      }
    },
    "/alerts/{alert_id}/notes": {
      "get": {
        "operationId": "listAlertNotes",
        "tags": [
          "Alerts"
        ],
        "summary": "List analyst notes for an alert",
        "description": "Returns all SOC analyst notes attached to the specified alert, newest first.",
        "security": [],
        "parameters": [
          {
            "name": "alert_id",
            "in": "path",
            "required": true,
            "description": "Numeric alert identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Alert notes list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertNotesListResponse"
                }
              }
            }
          },
          "404": {
            "description": "Alert not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createAlertNote",
        "tags": [
          "Alerts"
        ],
        "summary": "Attach an analyst note to an alert",
        "description": "Creates a new SOC analyst note (max 2,000 chars) and publishes an SSE note_update event.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "alert_id",
            "in": "path",
            "required": true,
            "description": "Numeric alert identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAlertNoteRequest"
              },
              "example": {
                "author": "SOC On-Call",
                "body": "Confirmed WAF rule deployed and vendor advisory verified."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Analyst note created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAlertNoteResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation error on author or body.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Alert not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Rate limit exceeded. Please try again later."
              }
            }
          }
        }
      }
    },
    "/alerts/{alert_id}/notes/{note_id}": {
      "delete": {
        "operationId": "deleteAlertNote",
        "tags": [
          "Alerts"
        ],
        "summary": "Delete an analyst note",
        "description": "Removes an analyst note from an alert and broadcasts the updated note count via SSE.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "alert_id",
            "in": "path",
            "required": true,
            "description": "Numeric alert identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "note_id",
            "in": "path",
            "required": true,
            "description": "Numeric note identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Note deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteAlertNoteResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Alert or note not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Rate limit exceeded. Please try again later."
              }
            }
          }
        }
      }
    },
    "/api/v1/incidents": {
      "get": {
        "operationId": "listIncidentCases",
        "tags": [
          "Alerts"
        ],
        "summary": "List incident cases with KPI rollup and playbook templates",
        "description": "Returns paginated incident response cases filterable by status ('active', 'all', or CSV), severity (CSV), search query, and linked alert_id, together with global KPI rollup metrics and built-in SOC response playbook templates.",
        "security": [],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by status: 'active' (open/investigating/contained), 'all', or comma-separated statuses.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "severity",
            "in": "query",
            "required": false,
            "description": "Filter by severity: 'all' or comma-separated P1..P4 values.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Search title, description, commander, summary notes, or INC-XXXX case code.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "alert_id",
            "in": "query",
            "required": false,
            "description": "Filter to incident cases linked to the specified alert ID.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of cases to return (1..200, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Pagination offset (>= 0, default 0).",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Incident case list, KPI summary, and playbooks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid filter or pagination parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createIncidentCase",
        "tags": [
          "Alerts"
        ],
        "summary": "Create a new incident response case",
        "description": "Opens a new trackable P1\u2013P4 incident case, optionally seeding response playbook tasks and linking one or more alerts, while recording initial audit timeline events.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 20,
          "period_seconds": 60
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncidentCreateRequest"
              },
              "example": {
                "title": "Okta SSO Auth Bypass Investigation",
                "severity": "P1",
                "commander": "SOC Lead",
                "playbook_key": "cve_zero_day",
                "alert_ids": [
                  1
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Incident case created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentCaseEnvelope"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation or max-cases limit error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "One or more referenced alert_ids were not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/incidents/{case_id}": {
      "get": {
        "operationId": "getIncidentCase",
        "tags": [
          "Alerts"
        ],
        "summary": "Get full incident case dossier",
        "description": "Returns the complete incident case dossier including case metadata, linked alerts, response playbook tasks, audit timeline events, impacted vendors, and impacted CVEs.",
        "security": [],
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "description": "Numeric incident case identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Full incident case dossier.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentDossierResponse"
                }
              }
            }
          },
          "404": {
            "description": "Incident case not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateIncidentCase",
        "tags": [
          "Alerts"
        ],
        "summary": "Update incident case metadata, status, severity, or summary notes",
        "description": "Updates incident fields, maintains resolved_at/closed_at lifecycle timestamps, and automatically logs status_change, severity_change, and owner_change audit events.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "description": "Numeric incident case identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncidentUpdateRequest"
              },
              "example": {
                "status": "contained",
                "severity": "P2"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Incident case updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentCaseEnvelope"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Incident case not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteIncidentCase",
        "tags": [
          "Alerts"
        ],
        "summary": "Delete an incident case",
        "description": "Permanently deletes an incident case and cascades deletion of its linked alert associations, playbook tasks, and timeline events.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 20,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "description": "Numeric incident case identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Incident case deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentDeleteResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Incident case not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/incidents/{case_id}/alerts": {
      "post": {
        "operationId": "linkIncidentAlerts",
        "tags": [
          "Alerts"
        ],
        "summary": "Idempotently link alerts to an incident case",
        "description": "Links one or more alerts to an incident case, skipping already-linked IDs and recording an alert_linked timeline event.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "description": "Numeric incident case identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncidentLinkAlertsRequest"
              },
              "example": {
                "alert_ids": [
                  1,
                  2
                ],
                "linked_by": "SOC Analyst"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Alerts linked to incident case.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentLinkAlertsResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation or max-alerts limit error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Incident case or referenced alert not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/incidents/{case_id}/alerts/{alert_id}": {
      "delete": {
        "operationId": "unlinkIncidentAlert",
        "tags": [
          "Alerts"
        ],
        "summary": "Unlink an alert from an incident case",
        "description": "Removes an alert association from an incident case and logs an alert_unlinked audit event.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "description": "Numeric incident case identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "alert_id",
            "in": "path",
            "required": true,
            "description": "Numeric alert identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Alert unlinked from case.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentUnlinkAlertResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Incident case or alert link not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/incidents/{case_id}/tasks": {
      "post": {
        "operationId": "createIncidentTask",
        "tags": [
          "Alerts"
        ],
        "summary": "Add a response playbook task to an incident case",
        "description": "Appends a structured checklist task (triage/containment/eradication/recovery/comms) to an incident case.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "description": "Numeric incident case identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncidentTaskCreateRequest"
              },
              "example": {
                "title": "Revoke compromised OAuth tokens",
                "phase": "containment"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Incident task created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentTaskEnvelope"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation or max-tasks limit error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Incident case not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/incidents/{case_id}/tasks/{task_id}": {
      "patch": {
        "operationId": "updateIncidentTask",
        "tags": [
          "Alerts"
        ],
        "summary": "Update or toggle completion of an incident task",
        "description": "Updates task title, phase, sort_order, or completion state and automatically logs task_completed/task_reopened audit events.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "description": "Numeric incident case identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "description": "Numeric task identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncidentTaskUpdateRequest"
              },
              "example": {
                "is_completed": true,
                "completed_by": "SOC Lead"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Incident task updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentTaskEnvelope"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Incident case or task not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteIncidentTask",
        "tags": [
          "Alerts"
        ],
        "summary": "Delete an incident response task",
        "description": "Removes a playbook task from an incident case.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "description": "Numeric incident case identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "task_id",
            "in": "path",
            "required": true,
            "description": "Numeric task identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Incident task deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentDeleteResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Incident case or task not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/incidents/{case_id}/events": {
      "post": {
        "operationId": "createIncidentEvent",
        "tags": [
          "Alerts"
        ],
        "summary": "Add a manual analyst note to an incident timeline",
        "description": "Appends a timestamped manual 'note' entry to the incident case audit timeline.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "description": "Numeric incident case identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncidentEventCreateRequest"
              },
              "example": {
                "author": "SOC On-Call",
                "body": "Confirmed WAF virtual patch active across all regions."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Timeline event created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentEventEnvelope"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation or max-events limit error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Incident case not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/incidents/{case_id}/ai-postmortem": {
      "post": {
        "operationId": "generateIncidentAiPostmortem",
        "tags": [
          "Alerts"
        ],
        "summary": "Generate or retrieve cached AI-synthesized incident postmortem",
        "description": "Synthesizes an executive, XSS- and Markdown-safe postmortem brief for an incident case using Gemini (with deterministic local fallback when Gemini is unavailable). Returns the cached postmortem with cached=true unless force=true is supplied; fresh or forced generations are persisted on the incident case and recorded in the SOC audit log.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 10,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "description": "Numeric incident case identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IncidentAiPostmortemRequest"
              },
              "example": {
                "force": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "AI-synthesized incident postmortem (cached or freshly generated).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentAiPostmortemResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Incident case not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/vendors": {
      "get": {
        "operationId": "listVendors",
        "tags": [
          "Vendors"
        ],
        "summary": "List monitored vendors & risk scorecards",
        "description": "Returns paginated vendors with live 365-day security grade, reliability percentage, MTTR, and incident counts.",
        "security": [],
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "1-based page number.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Page size (clamped to 1..100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Substring search against vendor name or slug.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Comma-separated status filter (green, yellow, red).",
            "schema": {
              "type": "string"
            },
            "example": "yellow,red"
          },
          {
            "name": "degraded",
            "in": "query",
            "required": false,
            "description": "When true, include only yellow/red vendors.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "tracked",
            "in": "query",
            "required": false,
            "description": "When true, include only tracked vendors.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "share_id",
            "in": "query",
            "required": false,
            "description": "Scope vendors to a shared watchlist ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tier",
            "in": "query",
            "required": false,
            "description": "Comma-separated TPRM criticality tier filter (tier_1, tier_2, tier_3).",
            "schema": {
              "type": "string"
            },
            "example": "tier_1"
          },
          {
            "name": "sla_status",
            "in": "query",
            "required": false,
            "description": "Comma-separated contractual SLA compliance status filter (compliant, at_risk, breached).",
            "schema": {
              "type": "string"
            },
            "example": "breached,at_risk"
          },
          {
            "name": "sla_breach",
            "in": "query",
            "required": false,
            "description": "Filter by SLA breach state ('true', '1', 'false', '0').",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "description": "Ordering key for vendor scorecards.",
            "schema": {
              "type": "string",
              "enum": [
                "score_asc",
                "score_desc",
                "reliability_asc",
                "incidents_desc",
                "mttr_desc",
                "name_asc",
                "tier_asc",
                "sla_breach_desc"
              ],
              "default": "score_asc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated vendor scorecards.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid status, sort, or pagination parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Referenced share_id watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/vendors/compare": {
      "get": {
        "operationId": "compareVendors",
        "tags": [
          "Vendors"
        ],
        "summary": "Compare 2 to 4 vendors side-by-side",
        "description": "Returns side-by-side security scorecards, reliability, MTTR, TPRM criticality & SLA status, severity/category breakdowns, and best/worst highlights for 2 to 4 vendor slugs or numeric IDs.",
        "security": [],
        "parameters": [
          {
            "name": "vendors",
            "in": "query",
            "required": true,
            "description": "Comma-separated list of 2 to 4 vendor slugs or numeric IDs.",
            "schema": {
              "type": "string"
            },
            "example": "okta,slack,github"
          }
        ],
        "responses": {
          "200": {
            "description": "Vendor comparison matrix.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorCompareResponse"
                }
              }
            }
          },
          "400": {
            "description": "Fewer than 2 or more than 4 distinct vendors requested.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "One or more vendor references could not be resolved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/vendors/sla-summary": {
      "get": {
        "operationId": "getVendorSlaSummary",
        "tags": [
          "Vendors"
        ],
        "summary": "Get ecosystem or scoped TPRM SLA compliance summary",
        "description": "Computes aggregate contractual SLA compliance counts, compliance rate %, tier-by-tier breakdowns, breached vendor list, tier defaults, and SLA presets.",
        "security": [],
        "parameters": [
          {
            "name": "tracked",
            "in": "query",
            "required": false,
            "description": "When true, scope summary to vendors in the caller's tracked_vendors cookie.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "share_id",
            "in": "query",
            "required": false,
            "description": "Scope summary to vendors in a shared watchlist ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tier",
            "in": "query",
            "required": false,
            "description": "Comma-separated TPRM criticality tier filter (tier_1, tier_2, tier_3).",
            "schema": {
              "type": "string"
            },
            "example": "tier_1"
          }
        ],
        "responses": {
          "200": {
            "description": "TPRM SLA compliance summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorSlaSummaryResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid tracked or tier parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Referenced share_id watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/vendors/governance/bulk": {
      "post": {
        "operationId": "bulkUpdateVendorGovernance",
        "tags": [
          "Vendors"
        ],
        "summary": "Bulk update TPRM criticality tier and SLA governance targets",
        "description": "Atomically updates criticality tier, contractual SLA overrides/presets, owner, or governance notes for up to 50 vendors. Recorded in the SOC audit log under resource_type='watchlist'.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 15,
          "period_seconds": 60
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VendorGovernanceBulkRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Bulk vendor governance update result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorGovernanceBulkResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Invalid vendor_refs or governance payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "One or more vendor references could not be resolved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/vendors/{vendor_ref}": {
      "get": {
        "operationId": "getVendor",
        "tags": [
          "Vendors"
        ],
        "summary": "Get vendor risk scorecard & recent alerts",
        "description": "Resolves a vendor by numeric ID or slug (case-insensitive) and returns scorecard metrics, TPRM SLA status, health history, category counts, and up to 20 recent alerts.",
        "security": [],
        "parameters": [
          {
            "name": "vendor_ref",
            "in": "path",
            "required": true,
            "description": "Vendor slug (e.g. 'okta') or numeric vendor ID.",
            "schema": {
              "type": "string"
            },
            "example": "okta"
          }
        ],
        "responses": {
          "200": {
            "description": "Vendor scorecard detail.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorDetail"
                }
              }
            }
          },
          "404": {
            "description": "Vendor not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/vendors/{vendor_ref}/governance": {
      "patch": {
        "operationId": "updateVendorGovernance",
        "tags": [
          "Vendors"
        ],
        "summary": "Update vendor TPRM criticality tier & contractual SLA targets",
        "description": "Updates criticality tier, custom uptime/MTTR SLA overrides (or applies a preset / resets to tier defaults), TPRM owner, and governance dossier notes for a single vendor resolved by slug or numeric ID. Recorded in the SOC audit log under resource_type='watchlist'.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "vendor_ref",
            "in": "path",
            "required": true,
            "description": "Vendor slug (e.g. 'okta') or numeric vendor ID.",
            "schema": {
              "type": "string"
            },
            "example": "okta"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VendorGovernancePatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated vendor TPRM governance profile and ecosystem SLA summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VendorGovernancePatchResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation error in governance payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Vendor not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/vendors/{vendor_ref}/brief.md": {
      "get": {
        "operationId": "getVendorRiskBrief",
        "tags": [
          "Vendors"
        ],
        "summary": "Generate Markdown vendor risk brief",
        "description": "Generates an executive Markdown risk brief for a vendor resolved by slug or numeric ID.",
        "security": [],
        "parameters": [
          {
            "name": "vendor_ref",
            "in": "path",
            "required": true,
            "description": "Vendor slug (e.g. 'okta') or numeric vendor ID.",
            "schema": {
              "type": "string"
            },
            "example": "okta"
          },
          {
            "name": "download",
            "in": "query",
            "required": false,
            "description": "When '1', 'true', or 'yes', sets Content-Disposition: attachment.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Markdown vendor risk brief.",
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Vendor not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/export": {
      "get": {
        "operationId": "exportThreatData",
        "tags": [
          "Exports"
        ],
        "summary": "Export filtered alerts or vendors (CSV, JSON, STIX 2.1)",
        "description": "Downloads filtered alerts or vendor scorecards as CSV, JSON bundle, or STIX 2.1 (alerts only). Includes X-Export-Count and X-Export-Truncated response headers.",
        "security": [],
        "parameters": [
          {
            "name": "resource",
            "in": "query",
            "required": false,
            "description": "Resource type to export.",
            "schema": {
              "type": "string",
              "enum": [
                "alerts",
                "vendors"
              ],
              "default": "alerts"
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Output serialization format ('stix' is valid only when resource='alerts').",
            "schema": {
              "type": "string",
              "enum": [
                "csv",
                "json",
                "stix"
              ],
              "default": "csv"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum records to export (1\u20131000; default 500 for alerts, 1000 for vendors).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            }
          },
          {
            "name": "include_notes",
            "in": "query",
            "required": false,
            "description": "When true (or format=stix), embed analyst notes in exported alerts.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free-text search across alert summary, details, source_type, and vendor name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "alert_id",
            "in": "query",
            "required": false,
            "description": "Filter to a specific alert ID.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "tab",
            "in": "query",
            "required": false,
            "description": "Preset stream slice filter.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "security",
                "outages",
                "intel"
              ]
            }
          },
          {
            "name": "classification",
            "in": "query",
            "required": false,
            "description": "Filter by alert classification (e.g. 'Verified Incident', 'Service Outage', 'Analysis / Opinion').",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendor_id",
            "in": "query",
            "required": false,
            "description": "Filter by a single numeric vendor ID.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "vendor_ids",
            "in": "query",
            "required": false,
            "description": "Comma-separated list of numeric vendor IDs.",
            "schema": {
              "type": "string"
            },
            "example": "1,2,3"
          },
          {
            "name": "vendor_slug",
            "in": "query",
            "required": false,
            "description": "Comma-separated list of vendor slugs (case-insensitive).",
            "schema": {
              "type": "string"
            },
            "example": "okta,slack"
          },
          {
            "name": "impact",
            "in": "query",
            "required": false,
            "description": "Comma-separated severity filter (Critical, High, Medium, Low).",
            "schema": {
              "type": "string"
            },
            "example": "Critical,High"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Comma-separated category filter ('Security Issue', 'Operational Issue', 'Maintenance').",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Comma-separated source filter (status, cisa-kev, cve, osint, cisa-advisories, reddit, bleeping, krebs, sans, hackernews, schneier, osint-other).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "acknowledged",
            "in": "query",
            "required": false,
            "description": "Filter by acknowledgement flag ('true', '1', 'false', '0').",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "triage_status",
            "in": "query",
            "required": false,
            "description": "Filter by triage state ('open', 'investigating', 'mitigated', 'false_positive', 'untriaged', 'triaged', or comma-separated statuses).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "verified",
            "in": "query",
            "required": false,
            "description": "When true, restrict to Verified Incident and Service Outage alerts.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "tracked",
            "in": "query",
            "required": false,
            "description": "When true, restrict to vendors in the caller's tracked_vendors cookie.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "cve",
            "in": "query",
            "required": false,
            "description": "Filter alerts referencing a CVE identifier (exact token boundary match for full CVE-YYYY-NNNN+ IDs).",
            "schema": {
              "type": "string"
            },
            "example": "CVE-2026-1234"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Relative time-window preset ('all', '24h', '7d', '30d'). Overridden when explicit 'since' is provided.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "24h",
                "7d",
                "30d"
              ],
              "default": "all"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Lower timestamp bound (ISO-8601 date or datetime, UTC).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Upper timestamp bound (ISO-8601 date or datetime, UTC).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "share_id",
            "in": "query",
            "required": false,
            "description": "Scope alerts to vendors in a shared watchlist ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_muted",
            "in": "query",
            "required": false,
            "description": "When false, excludes alerts matching active mute/snooze rules (default true).",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Exported CSV, JSON bundle, or STIX 2.1 document.",
            "headers": {
              "X-Export-Count": {
                "$ref": "#/components/headers/X-Export-Count"
              },
              "X-Export-Truncated": {
                "$ref": "#/components/headers/X-Export-Truncated"
              }
            },
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExportJsonBundle"
                }
              },
              "application/stix+json": {
                "schema": {
                  "$ref": "#/components/schemas/StixBundle"
                }
              }
            }
          },
          "400": {
            "description": "Invalid resource, format, limit, or filter parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Referenced share_id watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/cves/{cve_id}/export": {
      "get": {
        "operationId": "exportCveIntel",
        "tags": [
          "Exports"
        ],
        "summary": "Export single-CVE intelligence bundle (JSON, CSV, or STIX 2.1)",
        "description": "Exports all exact-matched alerts for a canonical CVE identifier as a self-contained JSON campaign bundle, OWASP formula-neutralized RFC-4180 CSV, or deterministic UUIDv5 STIX 2.1 bundle. Emits Content-Disposition attachment, Cache-Control: no-store, X-Export-Count, X-Export-Truncated, and standard X-RateLimit-* headers.",
        "security": [],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "cve_id",
            "in": "path",
            "required": true,
            "description": "Canonical CVE identifier (e.g. 'CVE-2026-1234').",
            "schema": {
              "type": "string",
              "pattern": "^CVE-\\d{4}-\\d{4,7}$"
            },
            "example": "CVE-2026-1234"
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Output serialization format ('json', 'csv', or 'stix').",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv",
                "stix"
              ],
              "default": "json"
            }
          },
          {
            "name": "tracked",
            "in": "query",
            "required": false,
            "description": "When true, restrict exported alerts to the caller's tracked_vendors cookie.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "share_id",
            "in": "query",
            "required": false,
            "description": "Scope exported alerts to vendors in a shared watchlist ID.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Per-CVE exported JSON bundle, CSV, or STIX 2.1 document.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "X-Export-Count": {
                "$ref": "#/components/headers/X-Export-Count"
              },
              "X-Export-Truncated": {
                "$ref": "#/components/headers/X-Export-Truncated"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CveExportJsonBundle"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/stix+json": {
                "schema": {
                  "$ref": "#/components/schemas/StixBundle"
                }
              }
            }
          },
          "400": {
            "description": "Invalid CVE identifier, format, or boolean parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "CVE not found in current scope or shared watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/watchlist/export": {
      "get": {
        "operationId": "exportWatchlist",
        "tags": [
          "Exports"
        ],
        "summary": "Export tracked or shared watchlist (JSON or CSV)",
        "description": "Exports the active cookie-backed watchlist (or a shared watchlist via share_id) with formula-injection-safe CSV or round-trip JSON.",
        "security": [],
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Export format ('json' or 'csv').",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ],
              "default": "json"
            }
          },
          {
            "name": "share_id",
            "in": "query",
            "required": false,
            "description": "Optional shared watchlist ID to export instead of the caller's cookie.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Watchlist export file attachment.",
            "headers": {
              "X-Export-Count": {
                "$ref": "#/components/headers/X-Export-Count"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid format parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Shared watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reports/executive": {
      "get": {
        "operationId": "getExecutivePostureReport",
        "tags": [
          "Exports"
        ],
        "summary": "Generate Executive SOC Posture Brief (JSON or Markdown)",
        "description": "Builds a leadership-ready Executive Security Posture Brief for a configurable 7\u201390 day window across the full ecosystem, the caller's tracked watchlist, or a shared watchlist. Combines vendor security grades, SLA/MTTR rollups, top at-risk vendors, CISA KEV and priority CVE tracking, triage velocity, activity pulse, and feed/alerting/mute governance readiness. Responses include Cache-Control: no-store and standard X-RateLimit-* headers.",
        "security": [],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Reporting window in UTC calendar days (7..90, default 30).",
            "schema": {
              "type": "integer",
              "minimum": 7,
              "maximum": 90,
              "default": 30
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Response format: 'json' (includes rendered GFM markdown) or 'markdown'.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "markdown"
              ],
              "default": "json"
            }
          },
          {
            "name": "tracked",
            "in": "query",
            "required": false,
            "description": "When true, restrict report to vendors in the caller's tracked_vendors cookie (overridden by share_id).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "share_id",
            "in": "query",
            "required": false,
            "description": "Optional shared watchlist ID to scope the report (takes precedence over tracked cookie).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_muted",
            "in": "query",
            "required": false,
            "description": "When false, excludes alerts matching active mute/snooze rules from rollups (default true).",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "download",
            "in": "query",
            "required": false,
            "description": "When true (1/true/yes), sets Content-Disposition: attachment with a sanitized brief filename.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Executive Security Posture Brief as JSON or GitHub-Flavored Markdown.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecutiveReportResponse"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid days, format, tracked, or include_muted parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Referenced share_id watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reports/executive/deliver": {
      "post": {
        "operationId": "deliverExecutivePostureReport",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Deliver Executive SOC Posture Brief to outbound channels",
        "description": "Computes a scoped Executive Security Posture Brief (7\u201390 days) and synchronously pushes channel-formatted digests to 1..10 enabled AlertRules (Slack Block Kit, Discord Embed, Microsoft Teams MessageCard, or HMAC-signed JSON Webhook) with pre-send SSRF/DNS protection and no-redirect enforcement. Records AlertDeliveryLog entries (event_type='report.executive') and a scrubbed AuditEvent (action='report.delivered', resource_type='system').",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 10,
          "period_seconds": 60
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportDeliveryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Outbound executive brief delivery summary and per-channel results.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportDeliveryResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Invalid payload, rule selection, disabled target rule, days window, or note.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Referenced alert rule or shared watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reports/shift-handoff": {
      "get": {
        "operationId": "getShiftHandoffReport",
        "tags": [
          "Exports"
        ],
        "summary": "Generate 8h/12h/24h SOC Shift-Handoff Brief (JSON or Markdown)",
        "description": "Builds an operational SOC Shift-Handoff Brief for an 8h, 12h, or 24h window across the full ecosystem, tracked watchlist, or a shared watchlist. Aggregates shift status, active incidents and incomplete tasks, prioritized untriaged queue (KEV -> Tier-1 -> severity), TPRM SLA breaches, auto-response execution activity, analyst audit highlights, and next-shift action items using bounded SQL queries (<= 14). Responses include Cache-Control: no-store and X-RateLimit-* headers.",
        "security": [],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "hours",
            "in": "query",
            "required": false,
            "description": "Shift handoff lookback window in hours (8, 12, or 24; default 8).",
            "schema": {
              "type": "integer",
              "enum": [
                8,
                12,
                24
              ],
              "default": 8
            }
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Response format: 'json' (includes rendered GFM markdown) or 'markdown'.",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "markdown"
              ],
              "default": "json"
            }
          },
          {
            "name": "tracked",
            "in": "query",
            "required": false,
            "description": "Strict boolean ('true'|'1'|'false'|'0'). Restrict brief to caller's tracked_vendors cookie (overridden by share_id).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          },
          {
            "name": "include_muted",
            "in": "query",
            "required": false,
            "description": "Strict boolean ('true'|'1'|'false'|'0'). When false, excludes alerts matching active mute rules (default true).",
            "schema": {
              "type": "boolean",
              "default": true
            }
          },
          {
            "name": "share_id",
            "in": "query",
            "required": false,
            "description": "Optional shared watchlist ID to scope the brief (takes precedence over tracked cookie).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "download",
            "in": "query",
            "required": false,
            "description": "Strict boolean ('true'|'1'|'false'|'0'). When true, sets Content-Disposition: attachment with a sanitized filename.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SOC Shift-Handoff Brief as JSON or GitHub-Flavored Markdown.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ShiftHandoffReport"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid hours, format, tracked, include_muted, or download parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Referenced share_id watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reports/shift-handoff/deliver": {
      "post": {
        "operationId": "deliverShiftHandoffReport",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Deliver 8h/12h/24h SOC Shift-Handoff Brief to outbound channels",
        "description": "Computes a scoped 8h/12h/24h SOC Shift-Handoff Brief and synchronously pushes channel-formatted digests to 1..10 enabled AlertRules (Slack Block Kit, Discord Embed, Microsoft Teams MessageCard, or HMAC-signed JSON Webhook) with pre-send SSRF/DNS protection and no-redirect enforcement. Records AlertDeliveryLog entries (event_type='report.shift_handoff') and a scrubbed AuditEvent (action='report.delivered', resource_type='system').",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 10,
          "period_seconds": 60
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReportDeliveryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Outbound shift-handoff brief delivery summary and per-channel results.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportDeliveryResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Invalid payload, rule selection, disabled target rule, hours window, or note.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Referenced alert rule or shared watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/incidents/{case_id}/postmortem.md": {
      "get": {
        "operationId": "exportIncidentPostmortemMarkdown",
        "tags": [
          "Exports"
        ],
        "summary": "Export Incident Postmortem Report (GitHub-Flavored Markdown)",
        "description": "Generates an XSS- and Markdown-safe GitHub-Flavored Markdown postmortem report for an incident case (mode=template, default) or serves the cached AI-synthesized postmortem (mode=ai; returns 404 if not yet generated). Pass ?download=1 for file attachment download.",
        "security": [],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "description": "Numeric incident case identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": false,
            "description": "Postmortem source mode: 'template' (default deterministic template) or 'ai' (cached AI-synthesized postmortem).",
            "schema": {
              "type": "string",
              "enum": [
                "template",
                "ai"
              ],
              "default": "template"
            }
          },
          {
            "name": "download",
            "in": "query",
            "required": false,
            "description": "When true (1/true/yes), sets Content-Disposition: attachment with sentinel-incident-INC-XXXX-postmortem.md (template) or sentinel-incident-INC-XXXX-ai-postmortem.md (ai).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Incident Postmortem GitHub-Flavored Markdown document.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid mode parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Incident case not found, or AI postmortem not yet generated when mode=ai.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/watchlist/packs": {
      "get": {
        "operationId": "listWatchlistPacks",
        "tags": [
          "Watchlist"
        ],
        "summary": "List curated vendor starter packs",
        "description": "Returns curated SaaS starter packs resolved against live catalog vendors alongside the caller's current tracked vendor IDs/slugs.",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Starter packs and active watchlist summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchlistPacksResponse"
                }
              }
            }
          }
        }
      }
    },
    "/watchlist/bulk": {
      "post": {
        "operationId": "bulkUpdateWatchlist",
        "tags": [
          "Watchlist"
        ],
        "summary": "Bulk add, replace, remove, or clear tracked vendors",
        "description": "Updates the caller's tracked_vendors cookie from a starter pack ID, vendor_ids, vendor_slugs, or multi-format import_text (JSON/CSV/plain text).",
        "security": [
          {
            "CsrfTokenHeader": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchlistBulkRequest"
              },
              "example": {
                "mode": "add",
                "vendor_slugs": [
                  "okta",
                  "slack"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Watchlist updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchlistBulkResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Invalid mode, payload, or zero matched vendors.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Unknown starter pack ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Rate limit exceeded. Please try again later."
              }
            }
          }
        }
      }
    },
    "/watchlist/share": {
      "post": {
        "operationId": "shareWatchlist",
        "tags": [
          "Watchlist"
        ],
        "summary": "Create a shareable watchlist snapshot link",
        "description": "Persists a read-only SharedWatchlist snapshot for the supplied vendor IDs (or tracked_vendors cookie) and returns its share URL.",
        "security": [
          {
            "CsrfTokenHeader": []
          }
        ],
        "x-rate-limit": {
          "limit": 5,
          "period_seconds": 60
        },
        "parameters": [],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WatchlistShareRequest"
              },
              "example": {
                "vendor_ids": [
                  1,
                  2
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Share link generated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WatchlistShareResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "No valid tracked vendors supplied to share.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Rate limit exceeded. Please try again later."
              }
            }
          },
          "500": {
            "description": "Internal error generating unique share ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/api/v1/alert-rules": {
      "get": {
        "operationId": "listAlertRules",
        "tags": [
          "Alert Rules"
        ],
        "summary": "List outbound alerting rules",
        "description": "Lists configured outbound webhook/Slack/Teams/Discord alerting rules with masked target URLs (raw secrets and target URLs are never exposed).",
        "security": [
          {
            "OidcSessionCookie": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Configured alert rules.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRuleListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createAlertRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Create an outbound alerting rule",
        "description": "Creates a new SSRF-validated outbound alerting rule (max 50 rules). Optional signing secret is write-only.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 20,
          "period_seconds": 60
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertRuleCreateRequest"
              },
              "example": {
                "name": "Critical SaaS Security Alerts",
                "channel_type": "webhook",
                "target_url": "https://hooks.example.com/sentinel/events",
                "enabled": true,
                "min_impact": "High",
                "vendor_slugs": [
                  "okta",
                  "slack"
                ],
                "categories": [
                  "Security Issue"
                ],
                "verified_only": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Alert rule created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRuleEnvelope"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation error, SSRF rejection, or rule limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/alert-rules/{rule_id}": {
      "get": {
        "operationId": "getAlertRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Get an outbound alerting rule",
        "description": "Returns a single outbound alerting rule with masked target URL.",
        "security": [
          {
            "OidcSessionCookie": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "description": "Numeric alert rule identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Alert rule details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRuleEnvelope"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Alert rule not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateAlertRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Partially update an outbound alerting rule",
        "description": "Updates rule filters, enabled state, target_url, or rotates/clears the write-only webhook secret.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 20,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "description": "Numeric alert rule identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AlertRuleUpdateRequest"
              },
              "example": {
                "enabled": false,
                "min_impact": "Critical"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Alert rule updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRuleEnvelope"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation or SSRF error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Alert rule not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteAlertRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Delete an outbound alerting rule",
        "description": "Deletes an outbound alerting rule and cascades deletion to its delivery logs.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 20,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "description": "Numeric alert rule identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Alert rule deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRuleDeleteResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Alert rule not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/alert-rules/{rule_id}/test": {
      "post": {
        "operationId": "testAlertRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Send a synthetic test notification for a rule",
        "description": "Dispatches a synthetic test event to the rule's target endpoint and records an AlertDeliveryLog row.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 10,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "description": "Numeric alert rule identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Test delivery result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertRuleTestResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Alert rule not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/alert-rules/{rule_id}/deliveries": {
      "get": {
        "operationId": "listAlertRuleDeliveries",
        "tags": [
          "Alert Rules"
        ],
        "summary": "List recent delivery logs for a specific rule",
        "description": "Returns recent outbound notification delivery attempts for the specified alert rule.",
        "security": [
          {
            "OidcSessionCookie": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "description": "Numeric alert rule identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum delivery logs returned (clamped to 1..100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rule delivery logs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertDeliveryListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid limit parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Alert rule not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/alert-deliveries": {
      "get": {
        "operationId": "listAllAlertDeliveries",
        "tags": [
          "Alert Rules"
        ],
        "summary": "List recent outbound alert deliveries across all rules",
        "description": "Returns recent outbound notification deliveries across all rules, optionally filtered by rule_id.",
        "security": [
          {
            "OidcSessionCookie": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "rule_id",
            "in": "query",
            "required": false,
            "description": "Optional rule ID filter.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum delivery logs returned (clamped to 1..100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Outbound alert delivery logs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AlertDeliveryListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid rule_id or limit parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mute-rules": {
      "get": {
        "operationId": "listMuteRules",
        "tags": [
          "Alert Rules"
        ],
        "summary": "List alert mute & snooze rules",
        "description": "Lists configured alert noise-suppression / snooze rules with live active/expired status and suppression telemetry. Read-safe and secret-free.",
        "security": [],
        "parameters": [
          {
            "name": "active_only",
            "in": "query",
            "required": false,
            "description": "When true, return only currently enabled, non-expired mute rules (default false).",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Configured mute rules.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MuteRuleListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid active_only parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createMuteRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Create an alert mute or snooze rule",
        "description": "Creates a scoped alert suppression rule (max 50 rules) with severity-ceiling protection (max_impact) and optional TTL expiration (duration_minutes or future ISO-8601 expires_at).",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 20,
          "period_seconds": 60
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MuteRuleCreateRequest"
              },
              "example": {
                "name": "Okta Planned Maintenance Window",
                "reason": "Scheduled quarterly IdP maintenance CHG-1042",
                "enabled": true,
                "max_impact": "High",
                "vendor_slugs": [
                  "okta"
                ],
                "categories": [
                  "Maintenance"
                ],
                "duration_minutes": 120
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Mute rule created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MuteRuleEnvelope"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation error, anti-wildcard rejection, invalid TTL, or rule limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/mute-rules/{rule_id}": {
      "get": {
        "operationId": "getMuteRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Get an alert mute/snooze rule",
        "description": "Returns a single alert mute/snooze rule with active/expired flags and suppression counts.",
        "security": [],
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "description": "Numeric mute rule identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mute rule details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MuteRuleEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Mute rule not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateMuteRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Partially update an alert mute/snooze rule",
        "description": "Updates mute rule criteria, severity ceiling, enabled state, or TTL expiration. Enforces anti-wildcard scoping on the post-merge state.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 20,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "description": "Numeric mute rule identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MuteRuleUpdateRequest"
              },
              "example": {
                "enabled": false,
                "duration_minutes": 240
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Mute rule updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MuteRuleEnvelope"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation, anti-wildcard, or TTL error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Mute rule not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteMuteRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Delete an alert mute/snooze rule",
        "description": "Permanently deletes an alert mute/snooze rule.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 20,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "description": "Numeric mute rule identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Mute rule deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MuteRuleDeleteResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Mute rule not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/automation-rules": {
      "get": {
        "operationId": "listAutomationRules",
        "tags": [
          "Alert Rules"
        ],
        "summary": "List SOC auto-response & escalation playbook rules",
        "description": "Lists configured SOC auto-response automation rules ordered by priority, along with built-in starter presets, incident playbook templates, and OIDC authentication state.",
        "security": [
          {
            "OidcSessionCookie": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 60,
          "period_seconds": 60
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Configured automation rules.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRuleListResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createAutomationRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Create a SOC auto-response automation rule",
        "description": "Creates a custom SOC auto-response rule or instantiates one from a starter preset_id (max 50 rules). Enforces anti-wildcard safety guards and records a governance audit event.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 20,
          "period_seconds": 60
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationRuleCreateRequest"
              },
              "example": {
                "preset_id": "tier1_kev_p1"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Automation rule created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRuleEnvelope"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation error, anti-wildcard rejection, or rule limit reached.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/automation-rules/{rule_id}": {
      "get": {
        "operationId": "getAutomationRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Get a single SOC auto-response automation rule",
        "description": "Returns full configuration and trigger telemetry for a single automation rule.",
        "security": [
          {
            "OidcSessionCookie": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 60,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "description": "Numeric automation rule identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Automation rule details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRuleEnvelope"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Automation rule not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateAutomationRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Partially update a SOC auto-response automation rule",
        "description": "Updates automation rule matchers, actions, priority, or enabled state. Validates anti-wildcard safety guards against the merged rule state and records an audit event.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "description": "Numeric automation rule identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationRuleUpdateRequest"
              },
              "example": {
                "enabled": false,
                "priority": 25
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Automation rule updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRuleEnvelope"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation or anti-wildcard safety error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Automation rule not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteAutomationRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Delete a SOC auto-response automation rule",
        "description": "Permanently deletes an automation rule and cascades its execution logs after recording a pre-delete audit snapshot.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 20,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "rule_id",
            "in": "path",
            "required": true,
            "description": "Numeric automation rule identifier.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Automation rule deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRuleDeleteResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Automation rule not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/automation-rules/dry-run": {
      "post": {
        "operationId": "dryRunAutomationRule",
        "tags": [
          "Alert Rules"
        ],
        "summary": "Simulate a draft or saved automation rule without DB writes",
        "description": "Evaluates a draft rule payload (or saved rule_id) against up to 200 recent alerts within the requested lookback window (1..90 days, default 30), honoring active mute rules and incident deduplication windows with strictly zero database writes.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 20,
          "period_seconds": 60
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AutomationRuleDryRunRequest"
              },
              "example": {
                "preset_id": "tier1_kev_p1",
                "days": 30
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Zero-write simulation summary and sample matches.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationRuleDryRunResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation or days/rule_id error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Referenced saved automation rule not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/automation-logs": {
      "get": {
        "operationId": "listAutomationLogs",
        "tags": [
          "Alert Rules"
        ],
        "summary": "List SOC automation execution logs and rollup summary",
        "description": "Returns recent SOC auto-response execution logs filterable by rule_id and status, accompanied by an aggregate summary rollup.",
        "security": [
          {
            "OidcSessionCookie": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 60,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "rule_id",
            "in": "query",
            "required": false,
            "description": "Filter execution logs to a specific automation rule ID.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter execution logs by outcome status.",
            "schema": {
              "type": "string",
              "enum": [
                "executed",
                "skipped_muted",
                "skipped_cap",
                "error"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum number of execution logs to return (1..100, default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Automation execution logs and summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationExecutionLogListResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Invalid query parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/webhook/ingest": {
      "post": {
        "operationId": "ingestWebhookAlert",
        "tags": [
          "Ingestion & Webhooks"
        ],
        "summary": "Ingest an alert via webhook or GCP Pub/Sub push",
        "description": "CSRF-exempt ingestion webhook authenticated via X-Webhook-Token. Accepts direct JSON alert payloads or base64-encoded GCP Pub/Sub push envelopes, deduplicates by external_id, broadcasts over SSE, and enqueues matching outbound alert rules.",
        "security": [
          {
            "WebhookTokenHeader": []
          }
        ],
        "x-rate-limit": {
          "limit": 10,
          "period_seconds": 60
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookIngestRequest"
              },
              "example": {
                "source_type": "CVE",
                "vendor_slug": "okta",
                "summary": "CVE-2026-4242: Critical Okta Auth Bypass",
                "details": "Upstream security advisory describing authentication bypass.",
                "impact_score": "Critical",
                "vendor_status": "red"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Duplicate alert ignored/merged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookIngestResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "201": {
            "description": "New alert persisted and published over SSE.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookIngestResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Missing body or mandatory alert fields.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Invalid or missing X-Webhook-Token.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Rate limit exceeded. Please try again later."
              }
            }
          }
        }
      }
    },
    "/webhook/trigger_ingest": {
      "post": {
        "operationId": "triggerLiveIngest",
        "tags": [
          "Ingestion & Webhooks"
        ],
        "summary": "Trigger scheduled live threat-feed ingestion",
        "description": "CSRF-exempt scheduler hook authenticated via GCP OIDC Bearer ID token (production) or local X-Webhook-Token (development). Runs live feed ingestion, publishes new alerts to SSE, and dispatches outbound alert rules.",
        "security": [
          {
            "OidcBearerAuth": []
          },
          {
            "WebhookTokenHeader": []
          }
        ],
        "x-rate-limit": {
          "limit": 10,
          "period_seconds": 60
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Live ingestion run summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TriggerIngestResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Invalid OIDC service-account token or webhook secret.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Rate limit exceeded. Please try again later."
              }
            }
          },
          "500": {
            "description": "Internal error during live ingestion.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/api/v1/custom-feeds": {
      "get": {
        "operationId": "listCustomFeeds",
        "tags": [
          "Ingestion & Webhooks"
        ],
        "summary": "List configured custom SaaS status and OSINT RSS/Atom feeds",
        "description": "Returns all onboarded custom statuspage and RSS/Atom OSINT feeds along with attached vendor metadata, live FeedSync telemetry health, and summary counts.",
        "security": [
          {
            "OidcSessionCookie": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 60,
          "period_seconds": 60
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Configured custom feeds and rollup summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFeedListResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createCustomFeed",
        "tags": [
          "Ingestion & Webhooks"
        ],
        "summary": "Onboard a custom RSS/Atom feed and optional new SaaS vendor",
        "description": "Creates a custom HTTPS status or OSINT RSS/Atom feed with strict SSRF validation, max-50 feed limit enforcement, duplicate URL protection, and optional atomic onboarding of a new custom SaaS vendor.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 20,
          "period_seconds": 60
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomFeedCreateRequest"
              },
              "example": {
                "name": "Acme Statuspage",
                "feed_type": "status",
                "feed_url": "https://status.acme.example/history.atom",
                "new_vendor": {
                  "name": "Acme Corp",
                  "slug": "acme-corp",
                  "criticality_tier": "tier_1"
                },
                "poll_interval_minutes": 15,
                "enabled": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Custom feed created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFeedCreateResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation, SSRF policy, or feed limit error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "409": {
            "description": "Duplicate custom feed URL or new vendor slug conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/custom-feeds/test": {
      "post": {
        "operationId": "testCustomFeed",
        "tags": [
          "Ingestion & Webhooks"
        ],
        "summary": "SSRF-safe live fetch and sample preview for a custom RSS/Atom feed",
        "description": "Performs a zero-database-write SSRF-hardened HTTPS fetch, detects RSS or Atom format, and returns parsed sample alerts with heuristic impact, category, and classification.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 15,
          "period_seconds": 60
        },
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomFeedTestRequest"
              },
              "example": {
                "feed_url": "https://status.acme.example/history.atom",
                "feed_type": "status",
                "vendor_name": "Acme Corp"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Live feed test result and sample alert preview.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFeedTestResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Invalid payload or SSRF-blocked feed URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Referenced saved custom feed not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/custom-feeds/{feed_id}": {
      "get": {
        "operationId": "getCustomFeed",
        "tags": [
          "Ingestion & Webhooks"
        ],
        "summary": "Get a single custom feed and its live FeedSync health",
        "description": "Returns details and FeedSync telemetry for a single onboarded custom feed.",
        "security": [
          {
            "OidcSessionCookie": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 60,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "feed_id",
            "in": "path",
            "required": true,
            "description": "Custom feed numeric ID.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom feed detail.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFeedDetailResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Custom feed not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateCustomFeed",
        "tags": [
          "Ingestion & Webhooks"
        ],
        "summary": "Partially update a custom RSS/Atom feed",
        "description": "Updates custom feed fields (name, SSRF-revalidated feed_url, feed_type, vendor link, enabled toggle, poll interval, or notes) and records a SOC audit event.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "feed_id",
            "in": "path",
            "required": true,
            "description": "Custom feed numeric ID.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomFeedUpdateRequest"
              },
              "example": {
                "enabled": false,
                "poll_interval_minutes": 30
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Custom feed updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFeedDetailResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Validation or SSRF policy error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Custom feed not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "409": {
            "description": "Duplicate custom feed URL conflict.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteCustomFeed",
        "tags": [
          "Ingestion & Webhooks"
        ],
        "summary": "Delete a custom RSS/Atom feed",
        "description": "Deletes a custom feed and its FeedSync telemetry row while preserving the linked Vendor record and historical Alert history.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "feed_id",
            "in": "path",
            "required": true,
            "description": "Custom feed numeric ID.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom feed deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFeedDeleteResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Custom feed not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/custom-feeds/{feed_id}/sync": {
      "post": {
        "operationId": "syncCustomFeedNow",
        "tags": [
          "Ingestion & Webhooks"
        ],
        "summary": "Immediately sync a single custom RSS/Atom feed on demand",
        "description": "Runs an immediate cooldown-bypassing fetch for a custom feed, inserts deduplicated alerts, updates FeedSync health and vendor status, runs SOC automation rules, broadcasts SSE cards, dispatches outbound alert notifications, and records a SOC audit event.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 10,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "feed_id",
            "in": "path",
            "required": true,
            "description": "Custom feed numeric ID.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Custom feed sync completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomFeedSyncResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "404": {
            "description": "Custom feed not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/healthz": {
      "get": {
        "operationId": "getHealthz",
        "tags": [
          "Observability & Meta"
        ],
        "summary": "Liveness & readiness health check",
        "description": "Verifies database connectivity, reports Redis Pub/Sub mode, and returns aggregate threat-feed health counts.",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Service healthy.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthzResponse"
                }
              }
            }
          },
          "503": {
            "description": "Database check degraded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthzResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/feed-health": {
      "get": {
        "operationId": "getFeedHealth",
        "tags": [
          "Observability & Meta"
        ],
        "summary": "Inspect per-feed ingestion health",
        "description": "Returns per-feed sync timestamps, latencies, failure counters, and sanitized error messages.",
        "security": [],
        "parameters": [
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Filter by feed type (e.g. 'all', 'status', 'cve', 'osint').",
            "schema": {
              "type": "string",
              "default": "all"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter by feed health status ('all', 'healthy', 'failing', 'never_synced').",
            "schema": {
              "type": "string",
              "default": "all"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Feed health snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FeedHealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/analytics/activity": {
      "get": {
        "operationId": "getAnalyticsActivity",
        "tags": [
          "Observability & Meta"
        ],
        "summary": "Get daily incident activity heatmap buckets",
        "description": "Aggregates alerts over the requested UTC day window (7\u201390 days, default 30) into daily severity/category heatmap buckets with quartile intensity scaling, summary telemetry, and dashboard drill-down URLs.",
        "security": [],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "required": false,
            "description": "Number of UTC calendar days to aggregate (7\u201390, default 30).",
            "schema": {
              "type": "integer",
              "minimum": 7,
              "maximum": 90,
              "default": 30
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free-text search across alert summary, details, source_type, and vendor name.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "alert_id",
            "in": "query",
            "required": false,
            "description": "Filter to a specific alert ID.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "tab",
            "in": "query",
            "required": false,
            "description": "Preset stream slice filter.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "security",
                "outages",
                "intel"
              ]
            }
          },
          {
            "name": "classification",
            "in": "query",
            "required": false,
            "description": "Filter by alert classification (e.g. 'Verified Incident', 'Service Outage', 'Analysis / Opinion').",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "vendor_id",
            "in": "query",
            "required": false,
            "description": "Filter by a single numeric vendor ID.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "vendor_ids",
            "in": "query",
            "required": false,
            "description": "Comma-separated list of numeric vendor IDs.",
            "schema": {
              "type": "string"
            },
            "example": "1,2,3"
          },
          {
            "name": "vendor_slug",
            "in": "query",
            "required": false,
            "description": "Comma-separated list of vendor slugs (case-insensitive).",
            "schema": {
              "type": "string"
            },
            "example": "okta,slack"
          },
          {
            "name": "impact",
            "in": "query",
            "required": false,
            "description": "Comma-separated severity filter (Critical, High, Medium, Low).",
            "schema": {
              "type": "string"
            },
            "example": "Critical,High"
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Comma-separated category filter ('Security Issue', 'Operational Issue', 'Maintenance').",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "description": "Comma-separated source filter (status, cisa-kev, cve, osint, cisa-advisories, reddit, bleeping, krebs, sans, hackernews, schneier, osint-other).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "acknowledged",
            "in": "query",
            "required": false,
            "description": "Filter by acknowledgement flag ('true', '1', 'false', '0').",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "triage_status",
            "in": "query",
            "required": false,
            "description": "Filter by triage state ('open', 'investigating', 'mitigated', 'false_positive', 'untriaged', 'triaged', or comma-separated statuses).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "verified",
            "in": "query",
            "required": false,
            "description": "When true, restrict to Verified Incident and Service Outage alerts.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "tracked",
            "in": "query",
            "required": false,
            "description": "When true, restrict to vendors in the caller's tracked_vendors cookie.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "cve",
            "in": "query",
            "required": false,
            "description": "Filter alerts referencing a CVE identifier (exact token boundary match for full CVE-YYYY-NNNN+ IDs).",
            "schema": {
              "type": "string"
            },
            "example": "CVE-2026-1234"
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Relative time-window preset ('all', '24h', '7d', '30d'). Overridden when explicit 'since' is provided.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "24h",
                "7d",
                "30d"
              ],
              "default": "all"
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Lower timestamp bound (ISO-8601 date or datetime, UTC).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Upper timestamp bound (ISO-8601 date or datetime, UTC).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "share_id",
            "in": "query",
            "required": false,
            "description": "Scope alerts to vendors in a shared watchlist ID.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "include_muted",
            "in": "query",
            "required": false,
            "description": "When false, excludes alerts matching active mute/snooze rules (default true).",
            "schema": {
              "type": "boolean",
              "default": true
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Daily incident activity heatmap buckets and summary telemetry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsActivityResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid days or alert filter parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Referenced share_id watchlist not found.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/audit-log": {
      "get": {
        "operationId": "listAuditLog",
        "tags": [
          "Observability & Meta"
        ],
        "summary": "Query global SOC audit log & shift-handoff trail",
        "description": "Returns paginated, secret-scrubbed SOC governance audit events across alerts, alert rules, mute rules, incident cases, watchlists, and manual ingestions, along with shift-handoff KPI summary.",
        "security": [
          {
            "OidcSessionCookie": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 60,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Relative shift-handoff time window ('all', '8h', '24h', '7d', '30d'). Overridden when explicit 'since' is supplied.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "8h",
                "24h",
                "7d",
                "30d"
              ],
              "default": "all"
            }
          },
          {
            "name": "resource_type",
            "in": "query",
            "required": false,
            "description": "Comma-separated SOC resource types (alert, alert_rule, mute_rule, incident, watchlist, system).",
            "schema": {
              "type": "string"
            },
            "example": "incident,alert_rule"
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "description": "Comma-separated canonical action verbs or prefixes (e.g. 'incident.deleted' or 'incident.').",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource_id",
            "in": "query",
            "required": false,
            "description": "Exact resource identifier filter (e.g. 'INC-0004' or '42').",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "actor",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring filter on SOC actor name.",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free-text substring search across summary, action, resource_id, and actor.",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Lower timestamp bound (ISO-8601 date or datetime, UTC).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Upper timestamp bound (ISO-8601 date or datetime, UTC).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "1-based page number.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 1
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Page size (clamped to 1..100).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated SOC audit log events and KPI summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Invalid filter or pagination parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/audit-log/export": {
      "get": {
        "operationId": "exportAuditLog",
        "tags": [
          "Observability & Meta"
        ],
        "summary": "Export filtered SOC audit log as CSV or JSON",
        "description": "Downloads up to 5,000 matching SOC audit events as OWASP formula-neutralized CSV or structured JSON for compliance archiving and shift handoffs.",
        "security": [
          {
            "OidcSessionCookie": []
          },
          {
            "OidcBearerAuth": []
          }
        ],
        "x-rate-limit": {
          "limit": 20,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Export serialization format ('csv' or 'json', default 'csv').",
            "schema": {
              "type": "string",
              "enum": [
                "csv",
                "json"
              ],
              "default": "csv"
            }
          },
          {
            "name": "window",
            "in": "query",
            "required": false,
            "description": "Relative shift-handoff time window ('all', '8h', '24h', '7d', '30d'). Overridden when explicit 'since' is supplied.",
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "8h",
                "24h",
                "7d",
                "30d"
              ],
              "default": "all"
            }
          },
          {
            "name": "resource_type",
            "in": "query",
            "required": false,
            "description": "Comma-separated SOC resource types (alert, alert_rule, mute_rule, incident, watchlist, system).",
            "schema": {
              "type": "string"
            },
            "example": "incident,alert_rule"
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "description": "Comma-separated canonical action verbs or prefixes (e.g. 'incident.deleted' or 'incident.').",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "resource_id",
            "in": "query",
            "required": false,
            "description": "Exact resource identifier filter (e.g. 'INC-0004' or '42').",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "actor",
            "in": "query",
            "required": false,
            "description": "Case-insensitive substring filter on SOC actor name.",
            "schema": {
              "type": "string",
              "maxLength": 64
            }
          },
          {
            "name": "q",
            "in": "query",
            "required": false,
            "description": "Free-text substring search across summary, action, resource_id, and actor.",
            "schema": {
              "type": "string",
              "maxLength": 120
            }
          },
          {
            "name": "since",
            "in": "query",
            "required": false,
            "description": "Lower timestamp bound (ISO-8601 date or datetime, UTC).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "until",
            "in": "query",
            "required": false,
            "description": "Upper timestamp bound (ISO-8601 date or datetime, UTC).",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Downloadable CSV or JSON audit trail export.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "X-Export-Count": {
                "$ref": "#/components/headers/X-Export-Count"
              },
              "X-Export-Truncated": {
                "$ref": "#/components/headers/X-Export-Truncated"
              }
            },
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditLogExportJsonResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid format or filter parameter.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Unauthorized: OIDC authentication required.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/auth/me": {
      "get": {
        "operationId": "getAuthMe",
        "tags": [
          "Observability & Meta"
        ],
        "summary": "Inspect active OIDC authentication status and user identity",
        "description": "Returns whether the current request is authenticated via OIDC session cookie or Bearer JWT, whether OIDC is configured on the server, login/logout URLs, and safe verified user claims.",
        "security": [],
        "x-rate-limit": {
          "limit": 120,
          "period_seconds": 60
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Current OIDC authentication status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthMeResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RateLimitErrorResponse"
                },
                "example": {
                  "error": "Rate limit exceeded. Please try again later.",
                  "retry_after": 42
                }
              }
            }
          }
        }
      }
    },
    "/auth/login": {
      "get": {
        "operationId": "oidcLogin",
        "tags": [
          "Observability & Meta"
        ],
        "summary": "Initiate OIDC Authorization Code + PKCE (S256) login",
        "description": "Validates optional relative next path, stores single-use PKCE state and nonce in the signed session cookie, and redirects the browser to the configured OIDC identity provider.",
        "security": [],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "next",
            "in": "query",
            "required": false,
            "description": "Optional single-leading-slash relative path to redirect to after login.",
            "schema": {
              "type": "string",
              "default": "/"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Redirect to OIDC identity provider authorization endpoint.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Rate limit exceeded. Please try again later."
              }
            }
          },
          "503": {
            "description": "OIDC authentication is not configured or identity provider is unreachable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/auth/callback": {
      "get": {
        "operationId": "oidcCallback",
        "tags": [
          "Observability & Meta"
        ],
        "summary": "Complete OIDC Authorization Code + PKCE callback",
        "description": "Atomically consumes stored OIDC flow state, verifies state and TTL, exchanges authorization code with PKCE verifier, verifies ID token signature, claims, nonce, and workspace allowlists, establishes a bounded HTTP-only session cookie, records an auth.login audit event, and redirects.",
        "security": [],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "description": "OIDC authorization code issued by the identity provider.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "required": false,
            "description": "Opaque anti-CSRF state value matching the session flow.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Authenticated; redirects to sanitized relative next path.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "400": {
            "description": "Missing OIDC authorization code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "description": "Invalid, replayed, or expired OIDC callback state or ID token.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "403": {
            "description": "Authenticated OIDC user is not authorized by workspace allowlists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Rate limit exceeded. Please try again later."
              }
            }
          },
          "503": {
            "description": "OIDC authentication is not configured.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          }
        }
      }
    },
    "/auth/logout": {
      "post": {
        "operationId": "oidcLogout",
        "tags": [
          "Observability & Meta"
        ],
        "summary": "Sign out of the active OIDC session",
        "description": "CSRF-protected logout endpoint that clears the OIDC session state, records an auth.logout audit event, and returns JSON or redirects to a sanitized relative path.",
        "security": [
          {
            "OidcSessionCookie": [],
            "CsrfTokenHeader": []
          }
        ],
        "x-rate-limit": {
          "limit": 30,
          "period_seconds": 60
        },
        "parameters": [],
        "responses": {
          "200": {
            "description": "Session cleared (JSON response when requested via JSON/XHR).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthLogoutResponse"
                }
              }
            },
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "302": {
            "description": "Session cleared; redirects browser to sanitized relative path.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded. Inspect Retry-After and X-RateLimit-Reset before retrying.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              },
              "Retry-After": {
                "$ref": "#/components/headers/Retry-After"
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                },
                "example": "Rate limit exceeded. Please try again later."
              }
            }
          }
        }
      }
    },
    "/api/v1/openapi.json": {
      "get": {
        "operationId": "getOpenApiSpec",
        "tags": [
          "Observability & Meta"
        ],
        "summary": "Download OpenAPI 3.1.0 specification",
        "description": "Returns Sentinel's machine-readable OpenAPI 3.1.0 JSON schema. Pass ?download=1 for a file attachment download.",
        "security": [],
        "parameters": [
          {
            "name": "download",
            "in": "query",
            "required": false,
            "description": "When '1', 'true', or 'yes', sets Content-Disposition: attachment.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OpenAPI 3.1.0 JSON specification document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/api/docs": {
      "get": {
        "operationId": "getApiDocsPage",
        "tags": [
          "Observability & Meta"
        ],
        "summary": "Self-hosted Interactive API Explorer UI",
        "description": "Serves the CSP-compliant interactive API documentation and Try-It-Out console powered by /api/v1/openapi.json.",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Interactive API Explorer HTML page.",
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "OidcBearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "description": "OIDC ID/access JWT verified against the configured issuer JWKS (or GCP Cloud Scheduler OIDC ID token on /webhook/trigger_ingest)."
      },
      "OidcSessionCookie": {
        "type": "apiKey",
        "in": "cookie",
        "name": "session",
        "description": "Signed HTTP-only OIDC session cookie established via GET /auth/login and GET /auth/callback."
      },
      "WebhookTokenHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Webhook-Token",
        "description": "Shared secret verified against PUBSUB_VERIFICATION_TOKEN using constant-time comparison."
      },
      "CsrfTokenHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-CSRFToken",
        "description": "Flask-WTF CSRF token rendered in <meta name='csrf-token'> for browser-originated mutations."
      }
    },
    "headers": {
      "X-RateLimit-Limit": {
        "description": "Maximum requests permitted within the current rate-limit window.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "X-RateLimit-Remaining": {
        "description": "Remaining requests available in the current rate-limit window.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "X-RateLimit-Reset": {
        "description": "Unix epoch timestamp (seconds) when the current rate-limit window resets.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "Retry-After": {
        "description": "Minimum number of seconds to wait before retrying after a 429 response.",
        "schema": {
          "type": "integer",
          "minimum": 1
        }
      },
      "X-Export-Count": {
        "description": "Total number of records included in the exported response body.",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "X-Export-Truncated": {
        "description": "Indicates whether matching results exceeded the requested export limit ('true' or 'false').",
        "schema": {
          "type": "string",
          "enum": [
            "true",
            "false"
          ]
        }
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "AuthUser": {
        "type": "object",
        "required": [
          "sub",
          "name",
          "groups",
          "issuer",
          "exp"
        ],
        "properties": {
          "sub": {
            "type": "string"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "format": "email"
          },
          "name": {
            "type": "string"
          },
          "groups": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "issuer": {
            "type": "string"
          },
          "exp": {
            "type": "integer"
          }
        }
      },
      "AuthMeResponse": {
        "type": "object",
        "required": [
          "authenticated",
          "oidc_configured",
          "auth_method",
          "login_url",
          "logout_url",
          "user"
        ],
        "properties": {
          "authenticated": {
            "type": "boolean"
          },
          "oidc_configured": {
            "type": "boolean"
          },
          "auth_method": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "session",
              "bearer",
              null
            ]
          },
          "login_url": {
            "type": "string"
          },
          "logout_url": {
            "type": "string"
          },
          "user": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AuthUser"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "AuthLogoutResponse": {
        "type": "object",
        "required": [
          "authenticated",
          "logged_out"
        ],
        "properties": {
          "authenticated": {
            "type": "boolean"
          },
          "logged_out": {
            "type": "boolean"
          }
        }
      },
      "RateLimitErrorResponse": {
        "type": "object",
        "required": [
          "error",
          "retry_after"
        ],
        "properties": {
          "error": {
            "type": "string"
          },
          "retry_after": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "Pagination": {
        "type": "object",
        "required": [
          "page",
          "per_page",
          "total",
          "total_pages",
          "has_next",
          "has_prev"
        ],
        "properties": {
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "per_page": {
            "type": "integer",
            "minimum": 1
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "total_pages": {
            "type": "integer",
            "minimum": 0
          },
          "has_next": {
            "type": "boolean"
          },
          "has_prev": {
            "type": "boolean"
          }
        }
      },
      "VendorSummary": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "status"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "green",
              "yellow",
              "red"
            ]
          }
        }
      },
      "VendorSlaEvaluation": {
        "type": "object",
        "required": [
          "status",
          "breached",
          "uptime_breached",
          "mttr_breached",
          "breaches",
          "breach_count",
          "breach_reasons",
          "criticality_tier",
          "criticality_label",
          "criticality_short",
          "effective_uptime_target",
          "effective_mttr_target_minutes",
          "effective_mttr_target_label",
          "has_custom_sla",
          "uptime_margin",
          "mttr_margin_minutes",
          "tier_min_score"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "compliant",
              "at_risk",
              "breached"
            ]
          },
          "breached": {
            "type": "boolean"
          },
          "uptime_breached": {
            "type": "boolean"
          },
          "mttr_breached": {
            "type": "boolean"
          },
          "breaches": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "uptime",
                "mttr"
              ]
            }
          },
          "breach_count": {
            "type": "integer",
            "minimum": 0
          },
          "breach_reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "criticality_tier": {
            "type": "string",
            "enum": [
              "tier_1",
              "tier_2",
              "tier_3"
            ]
          },
          "criticality_label": {
            "type": "string"
          },
          "criticality_short": {
            "type": "string",
            "enum": [
              "T1",
              "T2",
              "T3"
            ]
          },
          "effective_uptime_target": {
            "type": "number",
            "minimum": 50.0,
            "maximum": 99.99
          },
          "effective_mttr_target_minutes": {
            "type": "integer",
            "minimum": 15,
            "maximum": 43200
          },
          "effective_mttr_target_label": {
            "type": "string"
          },
          "has_custom_sla": {
            "type": "boolean"
          },
          "uptime_margin": {
            "type": "number"
          },
          "mttr_margin_minutes": {
            "type": [
              "number",
              "null"
            ]
          },
          "tier_min_score": {
            "type": "number"
          }
        }
      },
      "VendorSlaTierBreakdown": {
        "type": "object",
        "required": [
          "total",
          "compliant",
          "at_risk",
          "breached"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "compliant": {
            "type": "integer",
            "minimum": 0
          },
          "at_risk": {
            "type": "integer",
            "minimum": 0
          },
          "breached": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "VendorSlaBreachedItem": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "criticality_tier",
          "criticality_short",
          "status",
          "breaches",
          "breach_reasons",
          "effective_uptime_target",
          "effective_mttr_target_minutes",
          "effective_mttr_target_label",
          "tprm_owner"
        ],
        "properties": {
          "id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "criticality_tier": {
            "type": "string",
            "enum": [
              "tier_1",
              "tier_2",
              "tier_3"
            ]
          },
          "criticality_short": {
            "type": "string",
            "enum": [
              "T1",
              "T2",
              "T3"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "breached"
            ]
          },
          "breaches": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "uptime",
                "mttr"
              ]
            }
          },
          "breach_reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "effective_uptime_target": {
            "type": "number"
          },
          "effective_mttr_target_minutes": {
            "type": "integer"
          },
          "effective_mttr_target_label": {
            "type": "string"
          },
          "tprm_owner": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "VendorSlaComplianceSummary": {
        "type": "object",
        "required": [
          "total_vendors",
          "compliant_count",
          "at_risk_count",
          "breached_count",
          "compliance_rate_percent",
          "custom_sla_count",
          "by_tier",
          "breached_vendors"
        ],
        "properties": {
          "total_vendors": {
            "type": "integer",
            "minimum": 0
          },
          "compliant_count": {
            "type": "integer",
            "minimum": 0
          },
          "at_risk_count": {
            "type": "integer",
            "minimum": 0
          },
          "breached_count": {
            "type": "integer",
            "minimum": 0
          },
          "compliance_rate_percent": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "custom_sla_count": {
            "type": "integer",
            "minimum": 0
          },
          "by_tier": {
            "type": "object",
            "required": [
              "tier_1",
              "tier_2",
              "tier_3"
            ],
            "properties": {
              "tier_1": {
                "$ref": "#/components/schemas/VendorSlaTierBreakdown"
              },
              "tier_2": {
                "$ref": "#/components/schemas/VendorSlaTierBreakdown"
              },
              "tier_3": {
                "$ref": "#/components/schemas/VendorSlaTierBreakdown"
              }
            }
          },
          "breached_vendors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VendorSlaBreachedItem"
            }
          }
        }
      },
      "VendorSlaSummaryResponse": {
        "allOf": [
          {
            "$ref": "#/components/schemas/VendorSlaComplianceSummary"
          },
          {
            "type": "object",
            "required": [
              "filters",
              "tier_defaults",
              "sla_presets"
            ],
            "properties": {
              "filters": {
                "type": "object",
                "additionalProperties": true
              },
              "tier_defaults": {
                "type": "object",
                "additionalProperties": true
              },
              "sla_presets": {
                "type": "object",
                "additionalProperties": true
              }
            }
          }
        ]
      },
      "VendorGovernancePatchRequest": {
        "type": "object",
        "properties": {
          "criticality_tier": {
            "type": "string",
            "enum": [
              "tier_1",
              "tier_2",
              "tier_3"
            ]
          },
          "preset_id": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "tier_1_strict",
              "tier_1_standard",
              "tier_2_standard",
              "tier_3_baseline",
              null
            ]
          },
          "sla_uptime_target": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 50.0,
            "maximum": 99.99
          },
          "sla_mttr_target_minutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 15,
            "maximum": 43200
          },
          "sla_mttr_target_hours": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0.25,
            "maximum": 720.0
          },
          "tprm_owner": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 80
          },
          "tprm_notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "reset_sla": {
            "type": "boolean"
          }
        }
      },
      "VendorGovernancePatchResponse": {
        "type": "object",
        "required": [
          "vendor",
          "sla_summary",
          "updated_fields"
        ],
        "properties": {
          "vendor": {
            "$ref": "#/components/schemas/Vendor"
          },
          "sla_summary": {
            "$ref": "#/components/schemas/VendorSlaComplianceSummary"
          },
          "updated_fields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "VendorGovernanceBulkRequest": {
        "allOf": [
          {
            "$ref": "#/components/schemas/VendorGovernancePatchRequest"
          },
          {
            "type": "object",
            "required": [
              "vendor_refs"
            ],
            "properties": {
              "vendor_refs": {
                "type": "array",
                "minItems": 1,
                "maxItems": 50,
                "items": {
                  "oneOf": [
                    {
                      "type": "integer",
                      "minimum": 1
                    },
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 100
                    }
                  ]
                },
                "description": "Up to 50 vendor slugs or numeric IDs to update atomically."
              }
            }
          }
        ]
      },
      "VendorGovernanceBulkResponse": {
        "type": "object",
        "required": [
          "updated_count",
          "updated_fields",
          "vendors",
          "sla_summary"
        ],
        "properties": {
          "updated_count": {
            "type": "integer",
            "minimum": 0
          },
          "updated_fields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "vendors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Vendor"
            }
          },
          "sla_summary": {
            "$ref": "#/components/schemas/VendorSlaComplianceSummary"
          }
        }
      },
      "Vendor": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "status",
          "security_grade",
          "security_score",
          "reliability_percent",
          "numeric_reliability",
          "avg_mttr",
          "numeric_mttr",
          "incidents_count",
          "is_watched",
          "criticality_tier",
          "criticality_label",
          "criticality_short",
          "sla"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "green",
              "yellow",
              "red"
            ]
          },
          "security_grade": {
            "type": "string"
          },
          "security_score": {
            "type": "number"
          },
          "reliability_percent": {
            "type": "string"
          },
          "numeric_reliability": {
            "type": "number"
          },
          "avg_mttr": {
            "type": "string"
          },
          "numeric_mttr": {
            "type": "number"
          },
          "incidents_count": {
            "type": "integer",
            "minimum": 0
          },
          "is_watched": {
            "type": "boolean"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "criticality_tier": {
            "type": "string",
            "enum": [
              "tier_1",
              "tier_2",
              "tier_3"
            ]
          },
          "criticality_label": {
            "type": "string"
          },
          "criticality_short": {
            "type": "string",
            "enum": [
              "T1",
              "T2",
              "T3"
            ]
          },
          "sla_uptime_target": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 50.0,
            "maximum": 99.99
          },
          "sla_mttr_target_minutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 15,
            "maximum": 43200
          },
          "tprm_owner": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 80
          },
          "tprm_notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 2000
          },
          "tprm_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sla": {
            "$ref": "#/components/schemas/VendorSlaEvaluation"
          }
        }
      },
      "VendorDetail": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Vendor"
          },
          {
            "type": "object",
            "required": [
              "health_history",
              "category_counts",
              "total_alerts_count",
              "recent_alerts"
            ],
            "properties": {
              "health_history": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "category_counts": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer"
                }
              },
              "total_alerts_count": {
                "type": "integer",
                "minimum": 0
              },
              "recent_alerts": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Alert"
                }
              }
            }
          }
        ]
      },
      "VendorListResponse": {
        "type": "object",
        "required": [
          "items",
          "pagination",
          "filters"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Vendor"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          },
          "filters": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "VendorComparisonEntry": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "status",
          "security_score",
          "security_grade",
          "numeric_reliability",
          "incidents_count",
          "is_watched"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "green",
              "yellow",
              "red"
            ]
          },
          "security_score": {
            "type": "number"
          },
          "security_grade": {
            "type": "string"
          },
          "reliability_percent": {
            "type": "string"
          },
          "numeric_reliability": {
            "type": "number"
          },
          "avg_mttr": {
            "type": "string"
          },
          "numeric_mttr": {
            "type": "number"
          },
          "incidents_count": {
            "type": "integer"
          },
          "is_watched": {
            "type": "boolean"
          },
          "active_open_alerts": {
            "type": "integer"
          },
          "severity_counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "category_counts": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "health_history": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "recent_alerts": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "criticality_tier": {
            "type": "string",
            "enum": [
              "tier_1",
              "tier_2",
              "tier_3"
            ]
          },
          "criticality_label": {
            "type": "string"
          },
          "criticality_short": {
            "type": "string",
            "enum": [
              "T1",
              "T2",
              "T3"
            ]
          },
          "sla_uptime_target": {
            "type": [
              "number",
              "null"
            ]
          },
          "sla_mttr_target_minutes": {
            "type": [
              "integer",
              "null"
            ]
          },
          "tprm_owner": {
            "type": [
              "string",
              "null"
            ]
          },
          "tprm_notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "tprm_updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sla": {
            "$ref": "#/components/schemas/VendorSlaEvaluation"
          }
        }
      },
      "VendorCompareHighlights": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "highest_security_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "lowest_security_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "highest_reliability_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "most_incidents_slug": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "VendorCompareResponse": {
        "type": "object",
        "required": [
          "vendors",
          "count",
          "highlights",
          "generated_at"
        ],
        "properties": {
          "vendors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VendorComparisonEntry"
            }
          },
          "count": {
            "type": "integer",
            "minimum": 2,
            "maximum": 4
          },
          "highlights": {
            "$ref": "#/components/schemas/VendorCompareHighlights"
          },
          "generated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AlertNote": {
        "type": "object",
        "required": [
          "id",
          "alert_id",
          "author",
          "body",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "alert_id": {
            "type": "integer"
          },
          "author": {
            "type": "string",
            "maxLength": 64
          },
          "body": {
            "type": "string",
            "maxLength": 2000
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "Alert": {
        "type": "object",
        "required": [
          "id",
          "source_type",
          "source_key",
          "summary",
          "details",
          "impact_score",
          "category",
          "classification",
          "triage_status",
          "is_acknowledged",
          "cve_ids",
          "note_count"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "external_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_type": {
            "type": "string"
          },
          "source_key": {
            "type": "string"
          },
          "vendor": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/VendorSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "summary": {
            "type": "string"
          },
          "details": {
            "type": "string"
          },
          "impact_score": {
            "type": "string",
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical"
            ]
          },
          "category": {
            "type": "string",
            "enum": [
              "Security Issue",
              "Operational Issue",
              "Maintenance"
            ]
          },
          "classification": {
            "type": "string"
          },
          "triage_status": {
            "type": "string",
            "enum": [
              "open",
              "investigating",
              "mitigated",
              "false_positive"
            ]
          },
          "is_acknowledged": {
            "type": "boolean"
          },
          "acknowledged_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "ai_summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "cve_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "note_count": {
            "type": "integer",
            "minimum": 0
          },
          "timestamp": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertNote"
            }
          }
        }
      },
      "AlertListResponse": {
        "type": "object",
        "required": [
          "items",
          "pagination",
          "filters"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Alert"
            }
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          },
          "filters": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CveIntelLink": {
        "type": "object",
        "required": [
          "cve_id",
          "nvd_url",
          "mitre_url",
          "cisa_kev_url",
          "epss_url"
        ],
        "properties": {
          "cve_id": {
            "type": "string"
          },
          "nvd_url": {
            "type": "string",
            "format": "uri"
          },
          "mitre_url": {
            "type": "string",
            "format": "uri"
          },
          "cisa_kev_url": {
            "type": "string",
            "format": "uri"
          },
          "epss_url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "CorrelatedAlertMatch": {
        "type": "object",
        "required": [
          "match_type",
          "shared_cves",
          "cross_source",
          "time_delta_label",
          "alert"
        ],
        "properties": {
          "match_type": {
            "type": "string"
          },
          "shared_cves": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cross_source": {
            "type": "boolean"
          },
          "time_delta_label": {
            "type": "string"
          },
          "alert": {
            "$ref": "#/components/schemas/Alert"
          }
        }
      },
      "CorrelatedAlertsResponse": {
        "type": "object",
        "required": [
          "alert_id",
          "cve_ids",
          "cve_intel",
          "window_hours",
          "count",
          "correlated_alerts"
        ],
        "properties": {
          "alert_id": {
            "type": "integer"
          },
          "cve_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cve_intel": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CveIntelLink"
            }
          },
          "window_hours": {
            "type": "integer",
            "minimum": 1,
            "maximum": 168
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "correlated_alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CorrelatedAlertMatch"
            }
          }
        }
      },
      "AlertTriageRequest": {
        "type": "object",
        "required": [
          "triage_status"
        ],
        "properties": {
          "triage_status": {
            "type": "string",
            "enum": [
              "open",
              "investigating",
              "mitigated",
              "false_positive"
            ]
          }
        }
      },
      "AlertTriageResponse": {
        "type": "object",
        "required": [
          "id",
          "triage_status",
          "is_acknowledged",
          "acknowledged_at",
          "vendor_id",
          "vendor_status"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "triage_status": {
            "type": "string",
            "enum": [
              "open",
              "investigating",
              "mitigated",
              "false_positive"
            ]
          },
          "is_acknowledged": {
            "type": "boolean"
          },
          "acknowledged_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "vendor_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "vendor_status": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "BulkTriageRequest": {
        "type": "object",
        "required": [
          "alert_ids",
          "triage_status"
        ],
        "properties": {
          "alert_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 200,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "triage_status": {
            "type": "string",
            "enum": [
              "open",
              "investigating",
              "mitigated",
              "false_positive"
            ]
          }
        }
      },
      "BulkTriageResponse": {
        "type": "object",
        "required": [
          "updated_count",
          "alert_ids",
          "triage_status",
          "is_acknowledged",
          "vendor_statuses"
        ],
        "properties": {
          "updated_count": {
            "type": "integer",
            "minimum": 0
          },
          "alert_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "triage_status": {
            "type": "string",
            "enum": [
              "open",
              "investigating",
              "mitigated",
              "false_positive"
            ]
          },
          "is_acknowledged": {
            "type": "boolean"
          },
          "vendor_statuses": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "AlertNotesListResponse": {
        "type": "object",
        "required": [
          "alert_id",
          "notes",
          "count"
        ],
        "properties": {
          "alert_id": {
            "type": "integer"
          },
          "notes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertNote"
            }
          },
          "count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "CreateAlertNoteRequest": {
        "type": "object",
        "required": [
          "body"
        ],
        "properties": {
          "author": {
            "type": "string",
            "maxLength": 64,
            "default": "SOC Analyst"
          },
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          }
        }
      },
      "CreateAlertNoteResponse": {
        "type": "object",
        "required": [
          "note",
          "count"
        ],
        "properties": {
          "note": {
            "$ref": "#/components/schemas/AlertNote"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "DeleteAlertNoteResponse": {
        "type": "object",
        "required": [
          "deleted",
          "count"
        ],
        "properties": {
          "deleted": {
            "type": "integer"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ExportJsonBundle": {
        "type": "object",
        "required": [
          "exported_at",
          "resource",
          "count",
          "truncated",
          "filters",
          "items"
        ],
        "properties": {
          "exported_at": {
            "type": "string",
            "format": "date-time"
          },
          "resource": {
            "type": "string",
            "enum": [
              "alerts",
              "vendors"
            ]
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "truncated": {
            "type": "boolean"
          },
          "filters": {
            "type": "object",
            "additionalProperties": true
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "StixBundle": {
        "type": "object",
        "required": [
          "type",
          "id",
          "spec_version",
          "objects"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "bundle"
          },
          "id": {
            "type": "string"
          },
          "spec_version": {
            "type": "string",
            "const": "2.1"
          },
          "objects": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "StarterPack": {
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "vendor_slugs",
          "vendor_ids",
          "available_count",
          "tracked_count"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "icon": {
            "type": "string"
          },
          "vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "vendor_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "available_count": {
            "type": "integer",
            "minimum": 0
          },
          "tracked_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "WatchlistPacksResponse": {
        "type": "object",
        "required": [
          "packs",
          "tracked_vendor_ids",
          "tracked_vendor_slugs",
          "tracked_count",
          "total_vendors"
        ],
        "properties": {
          "packs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StarterPack"
            }
          },
          "tracked_vendor_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "tracked_vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tracked_count": {
            "type": "integer",
            "minimum": 0
          },
          "total_vendors": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "WatchlistBulkRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "add",
              "replace",
              "remove",
              "clear"
            ],
            "default": "add"
          },
          "pack_id": {
            "type": "string"
          },
          "vendor_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "import_text": {
            "type": "string"
          },
          "import_format": {
            "type": "string",
            "enum": [
              "auto",
              "json",
              "csv",
              "text"
            ],
            "default": "auto"
          }
        }
      },
      "WatchlistBulkResponse": {
        "type": "object",
        "required": [
          "status",
          "mode",
          "tracked_vendor_ids",
          "tracked_vendor_slugs",
          "tracked_count",
          "added_count",
          "removed_count",
          "matched_count",
          "unmatched"
        ],
        "properties": {
          "status": {
            "type": "string",
            "const": "success"
          },
          "mode": {
            "type": "string",
            "enum": [
              "add",
              "replace",
              "remove",
              "clear"
            ]
          },
          "tracked_vendor_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "tracked_vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tracked_count": {
            "type": "integer",
            "minimum": 0
          },
          "added_count": {
            "type": "integer",
            "minimum": 0
          },
          "removed_count": {
            "type": "integer",
            "minimum": 0
          },
          "matched_count": {
            "type": "integer",
            "minimum": 0
          },
          "unmatched": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "WatchlistShareRequest": {
        "type": "object",
        "properties": {
          "vendor_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            },
            "description": "Optional list of vendor IDs. Falls back to tracked_vendors cookie if omitted."
          }
        }
      },
      "WatchlistShareResponse": {
        "type": "object",
        "required": [
          "share_url",
          "vendors"
        ],
        "properties": {
          "share_url": {
            "type": "string",
            "format": "uri"
          },
          "vendors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "AlertRule": {
        "type": "object",
        "required": [
          "id",
          "name",
          "channel_type",
          "target_url_masked",
          "enabled",
          "min_impact",
          "vendor_slugs",
          "categories",
          "source_types",
          "verified_only",
          "notify_incidents",
          "has_secret"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "channel_type": {
            "type": "string",
            "enum": [
              "webhook",
              "slack",
              "teams",
              "discord"
            ]
          },
          "target_url_masked": {
            "type": "string"
          },
          "target_host": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "min_impact": {
            "type": "string",
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical"
            ]
          },
          "vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "verified_only": {
            "type": "boolean"
          },
          "notify_incidents": {
            "type": "boolean",
            "description": "When true, also dispatches outbound notifications for incident case lifecycle events."
          },
          "has_secret": {
            "type": "boolean"
          },
          "last_triggered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_status": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AlertRuleCreateRequest": {
        "type": "object",
        "required": [
          "name",
          "target_url"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "channel_type": {
            "type": "string",
            "enum": [
              "webhook",
              "slack",
              "teams",
              "discord"
            ],
            "default": "webhook"
          },
          "target_url": {
            "type": "string",
            "format": "uri"
          },
          "secret": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 256
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "min_impact": {
            "type": "string",
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical"
            ],
            "default": "High"
          },
          "vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "verified_only": {
            "type": "boolean",
            "default": false
          },
          "notify_incidents": {
            "type": "boolean",
            "default": false,
            "description": "When true, also dispatches outbound notifications for incident case lifecycle events."
          }
        }
      },
      "AlertRuleUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "channel_type": {
            "type": "string",
            "enum": [
              "webhook",
              "slack",
              "teams",
              "discord"
            ]
          },
          "target_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "secret": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 256
          },
          "clear_secret": {
            "type": "boolean"
          },
          "enabled": {
            "type": "boolean"
          },
          "min_impact": {
            "type": "string",
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical"
            ]
          },
          "vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "verified_only": {
            "type": "boolean"
          },
          "notify_incidents": {
            "type": "boolean",
            "description": "Toggle outbound notifications for incident case lifecycle events."
          }
        }
      },
      "AlertRuleListResponse": {
        "type": "object",
        "required": [
          "items",
          "total",
          "max_rules",
          "oidc_configured",
          "authenticated"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertRule"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "max_rules": {
            "type": "integer",
            "minimum": 1
          },
          "oidc_configured": {
            "type": "boolean"
          },
          "authenticated": {
            "type": "boolean"
          }
        }
      },
      "AlertRuleEnvelope": {
        "type": "object",
        "required": [
          "rule"
        ],
        "properties": {
          "rule": {
            "$ref": "#/components/schemas/AlertRule"
          }
        }
      },
      "AlertRuleDeleteResponse": {
        "type": "object",
        "required": [
          "status",
          "id"
        ],
        "properties": {
          "status": {
            "type": "string",
            "const": "deleted"
          },
          "id": {
            "type": "integer"
          }
        }
      },
      "AlertDeliveryLog": {
        "type": "object",
        "required": [
          "id",
          "rule_id",
          "is_test",
          "channel_type",
          "status",
          "attempts",
          "event_type"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "rule_id": {
            "type": "integer"
          },
          "rule_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "alert_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "alert_summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "incident_case_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Associated incident case ID when the delivery was triggered by an incident lifecycle event."
          },
          "event_type": {
            "type": "string",
            "description": "Dispatched event name (e.g. alert.created, alert.test, incident.created, incident.status_changed, incident.severity_changed, incident.resolved, report.shift_handoff, report.executive)."
          },
          "is_test": {
            "type": "boolean"
          },
          "channel_type": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "success",
              "failed",
              "blocked",
              "sent"
            ]
          },
          "http_status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 1
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AlertRuleTestResponse": {
        "type": "object",
        "required": [
          "delivery",
          "rule"
        ],
        "properties": {
          "delivery": {
            "$ref": "#/components/schemas/AlertDeliveryLog"
          },
          "rule": {
            "$ref": "#/components/schemas/AlertRule"
          }
        }
      },
      "AlertDeliveryListResponse": {
        "type": "object",
        "required": [
          "items",
          "total"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AlertDeliveryLog"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "MuteRule": {
        "type": "object",
        "required": [
          "id",
          "name",
          "reason",
          "enabled",
          "is_active",
          "is_expired",
          "max_impact",
          "vendor_slugs",
          "categories",
          "source_types",
          "keyword",
          "expires_at",
          "expires_in_seconds",
          "suppressed_count",
          "last_matched_at",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "enabled": {
            "type": "boolean"
          },
          "is_active": {
            "type": "boolean"
          },
          "is_expired": {
            "type": "boolean"
          },
          "max_impact": {
            "type": "string",
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical"
            ]
          },
          "vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expires_in_seconds": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "suppressed_count": {
            "type": "integer",
            "minimum": 0
          },
          "last_matched_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "MuteRuleCreateRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "description": "At least one scoping criterion (vendor_slugs, categories, source_types, or keyword) is required. Provide at most one of duration_minutes (1..43200) or expires_at.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "max_impact": {
            "type": "string",
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical"
            ],
            "default": "High"
          },
          "vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120
          },
          "duration_minutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 43200
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "MuteRuleUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "enabled": {
            "type": "boolean"
          },
          "max_impact": {
            "type": "string",
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical"
            ]
          },
          "vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "keyword": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120
          },
          "duration_minutes": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1,
            "maximum": 43200
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "MuteRuleListResponse": {
        "type": "object",
        "required": [
          "items",
          "total",
          "active_count",
          "max_rules",
          "oidc_configured",
          "authenticated"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MuteRule"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "active_count": {
            "type": "integer",
            "minimum": 0
          },
          "max_rules": {
            "type": "integer",
            "minimum": 1
          },
          "oidc_configured": {
            "type": "boolean"
          },
          "authenticated": {
            "type": "boolean"
          }
        }
      },
      "MuteRuleEnvelope": {
        "type": "object",
        "required": [
          "rule"
        ],
        "properties": {
          "rule": {
            "$ref": "#/components/schemas/MuteRule"
          }
        }
      },
      "MuteRuleDeleteResponse": {
        "type": "object",
        "required": [
          "status",
          "id"
        ],
        "properties": {
          "status": {
            "type": "string",
            "const": "deleted"
          },
          "id": {
            "type": "integer"
          }
        }
      },
      "AutomationRule": {
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "enabled",
          "priority",
          "min_impact",
          "vendor_tiers",
          "vendor_slugs",
          "categories",
          "source_types",
          "verified_only",
          "kev_only",
          "keyword",
          "respect_mute_rules",
          "action_triage_status",
          "action_add_note",
          "action_escalate_incident",
          "incident_severity",
          "incident_playbook_key",
          "incident_commander",
          "use_vendor_tprm_owner",
          "dedup_window_hours",
          "triggered_count",
          "last_triggered_at",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 280
          },
          "enabled": {
            "type": "boolean"
          },
          "priority": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          },
          "min_impact": {
            "type": "string",
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical"
            ]
          },
          "vendor_tiers": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "tier_1",
                "tier_2",
                "tier_3"
              ]
            }
          },
          "vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "verified_only": {
            "type": "boolean"
          },
          "kev_only": {
            "type": "boolean"
          },
          "keyword": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120
          },
          "respect_mute_rules": {
            "type": "boolean"
          },
          "action_triage_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "investigating",
              "mitigated",
              "false_positive",
              null
            ]
          },
          "action_add_note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "action_escalate_incident": {
            "type": "boolean"
          },
          "incident_severity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "P1",
              "P2",
              "P3",
              "P4",
              null
            ]
          },
          "incident_playbook_key": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40
          },
          "incident_commander": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64
          },
          "use_vendor_tprm_owner": {
            "type": "boolean"
          },
          "dedup_window_hours": {
            "type": "integer",
            "minimum": 0,
            "maximum": 168
          },
          "triggered_count": {
            "type": "integer",
            "minimum": 0
          },
          "last_triggered_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AutomationRulePreset": {
        "type": "object",
        "required": [
          "id",
          "label",
          "name",
          "description",
          "config"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "config": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "AutomationRuleCreateRequest": {
        "type": "object",
        "description": "Create a custom SOC auto-response rule or instantiate a built-in starter preset via preset_id (with optional field overrides). At least one action (action_triage_status, action_add_note, or action_escalate_incident) is required. Enforces anti-wildcard safety guards.",
        "properties": {
          "preset_id": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "tier1_kev_p1",
              "tier1_crit_cve_p1",
              "tier1_outage_p2",
              "tier3_maint_auto_mitigate",
              null
            ]
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 280
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "priority": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000,
            "default": 100
          },
          "min_impact": {
            "type": "string",
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical"
            ],
            "default": "High"
          },
          "vendor_tiers": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "tier_1",
                "tier_2",
                "tier_3"
              ]
            }
          },
          "vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "verified_only": {
            "type": "boolean",
            "default": false
          },
          "kev_only": {
            "type": "boolean",
            "default": false
          },
          "keyword": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120
          },
          "respect_mute_rules": {
            "type": "boolean",
            "default": true
          },
          "action_triage_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "investigating",
              "mitigated",
              "false_positive",
              null
            ]
          },
          "action_add_note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "action_escalate_incident": {
            "type": "boolean",
            "default": false
          },
          "incident_severity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "P1",
              "P2",
              "P3",
              "P4",
              null
            ]
          },
          "incident_playbook_key": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40
          },
          "incident_commander": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64
          },
          "use_vendor_tprm_owner": {
            "type": "boolean",
            "default": true
          },
          "dedup_window_hours": {
            "type": "integer",
            "minimum": 0,
            "maximum": 168,
            "default": 24
          }
        }
      },
      "AutomationRuleUpdateRequest": {
        "type": "object",
        "description": "Partial update for an existing AutomationRule. Merged state must retain at least one action and satisfy anti-wildcard safety guards.",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 280
          },
          "enabled": {
            "type": "boolean"
          },
          "priority": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          },
          "min_impact": {
            "type": "string",
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical"
            ]
          },
          "vendor_tiers": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "tier_1",
                "tier_2",
                "tier_3"
              ]
            }
          },
          "vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "verified_only": {
            "type": "boolean"
          },
          "kev_only": {
            "type": "boolean"
          },
          "keyword": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120
          },
          "respect_mute_rules": {
            "type": "boolean"
          },
          "action_triage_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "investigating",
              "mitigated",
              "false_positive",
              null
            ]
          },
          "action_add_note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "action_escalate_incident": {
            "type": "boolean"
          },
          "incident_severity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "P1",
              "P2",
              "P3",
              "P4",
              null
            ]
          },
          "incident_playbook_key": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40
          },
          "incident_commander": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64
          },
          "use_vendor_tprm_owner": {
            "type": "boolean"
          },
          "dedup_window_hours": {
            "type": "integer",
            "minimum": 0,
            "maximum": 168
          }
        }
      },
      "AutomationRuleListResponse": {
        "type": "object",
        "required": [
          "rules",
          "count",
          "enabled_count",
          "max_rules",
          "presets",
          "playbooks",
          "oidc_configured",
          "authenticated"
        ],
        "properties": {
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationRule"
            }
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "enabled_count": {
            "type": "integer",
            "minimum": 0
          },
          "max_rules": {
            "type": "integer",
            "minimum": 1
          },
          "presets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationRulePreset"
            }
          },
          "playbooks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncidentPlaybookTemplate"
            }
          },
          "oidc_configured": {
            "type": "boolean"
          },
          "authenticated": {
            "type": "boolean"
          }
        }
      },
      "AutomationRuleEnvelope": {
        "type": "object",
        "required": [
          "rule"
        ],
        "properties": {
          "rule": {
            "$ref": "#/components/schemas/AutomationRule"
          }
        }
      },
      "AutomationRuleDeleteResponse": {
        "type": "object",
        "required": [
          "deleted",
          "id"
        ],
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "integer"
          }
        }
      },
      "AutomationRuleDryRunRequest": {
        "type": "object",
        "description": "Zero-write simulation payload. Provide either an existing rule_id or a draft rule/preset configuration alongside an optional days lookback window (1..90, default 30).",
        "properties": {
          "rule_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 90,
            "default": 30
          },
          "preset_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "min_impact": {
            "type": "string",
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical"
            ]
          },
          "vendor_tiers": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "tier_1",
                "tier_2",
                "tier_3"
              ]
            }
          },
          "vendor_slugs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "source_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "verified_only": {
            "type": "boolean"
          },
          "kev_only": {
            "type": "boolean"
          },
          "keyword": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 120
          },
          "respect_mute_rules": {
            "type": "boolean"
          },
          "action_triage_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "investigating",
              "mitigated",
              "false_positive",
              null
            ]
          },
          "action_add_note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "action_escalate_incident": {
            "type": "boolean"
          },
          "incident_severity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "P1",
              "P2",
              "P3",
              "P4",
              null
            ]
          },
          "incident_playbook_key": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 40
          },
          "incident_commander": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64
          },
          "use_vendor_tprm_owner": {
            "type": "boolean"
          },
          "dedup_window_hours": {
            "type": "integer",
            "minimum": 0,
            "maximum": 168
          }
        }
      },
      "AutomationDryRunSampleMatch": {
        "type": "object",
        "required": [
          "alert_id",
          "summary",
          "impact_score",
          "category",
          "classification",
          "source_type",
          "source_key",
          "vendor_name",
          "vendor_slug",
          "vendor_tier",
          "triage_status",
          "timestamp",
          "muted",
          "status",
          "predicted_triage",
          "predicted_note",
          "predicted_incident_action",
          "predicted_severity"
        ],
        "properties": {
          "alert_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "impact_score": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": [
              "string",
              "null"
            ]
          },
          "classification": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_type": {
            "type": [
              "string",
              "null"
            ]
          },
          "source_key": {
            "type": "string"
          },
          "vendor_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "vendor_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "vendor_tier": {
            "type": [
              "string",
              "null"
            ]
          },
          "triage_status": {
            "type": "string"
          },
          "timestamp": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "muted": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "executed",
              "skipped_muted"
            ]
          },
          "predicted_triage": {
            "type": [
              "string",
              "null"
            ]
          },
          "predicted_note": {
            "type": "boolean"
          },
          "predicted_incident_action": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "created",
              "linked",
              null
            ]
          },
          "predicted_severity": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "P1",
              "P2",
              "P3",
              "P4",
              null
            ]
          }
        }
      },
      "AutomationRuleDryRunResponse": {
        "type": "object",
        "required": [
          "days",
          "scanned_alerts",
          "matched_count",
          "skipped_muted_count",
          "predicted_triage_count",
          "predicted_cases_created",
          "predicted_cases_linked",
          "sample_matches"
        ],
        "properties": {
          "days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 90
          },
          "scanned_alerts": {
            "type": "integer",
            "minimum": 0
          },
          "matched_count": {
            "type": "integer",
            "minimum": 0
          },
          "skipped_muted_count": {
            "type": "integer",
            "minimum": 0
          },
          "predicted_triage_count": {
            "type": "integer",
            "minimum": 0
          },
          "predicted_cases_created": {
            "type": "integer",
            "minimum": 0
          },
          "predicted_cases_linked": {
            "type": "integer",
            "minimum": 0
          },
          "sample_matches": {
            "type": "array",
            "maxItems": 25,
            "items": {
              "$ref": "#/components/schemas/AutomationDryRunSampleMatch"
            }
          }
        }
      },
      "AutomationExecutionLog": {
        "type": "object",
        "required": [
          "id",
          "rule_id",
          "rule_name_snapshot",
          "alert_id",
          "alert_summary_snapshot",
          "vendor_slug_snapshot",
          "incident_case_id",
          "incident_case_code",
          "incident_action",
          "triage_applied",
          "note_added",
          "status",
          "summary",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "rule_id": {
            "type": "integer"
          },
          "rule_name_snapshot": {
            "type": "string",
            "maxLength": 100
          },
          "alert_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "alert_summary_snapshot": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 255
          },
          "vendor_slug_snapshot": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          },
          "incident_case_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "incident_case_code": {
            "type": [
              "string",
              "null"
            ]
          },
          "incident_action": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "created",
              "linked",
              null
            ]
          },
          "triage_applied": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "investigating",
              "mitigated",
              "false_positive",
              null
            ]
          },
          "note_added": {
            "type": "boolean"
          },
          "status": {
            "type": "string",
            "enum": [
              "executed",
              "skipped_muted",
              "skipped_cap",
              "error"
            ]
          },
          "summary": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 280
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AutomationExecutionLogsSummary": {
        "type": "object",
        "required": [
          "total",
          "executed",
          "skipped_muted",
          "skipped_cap",
          "error",
          "cases_created",
          "cases_linked"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "executed": {
            "type": "integer",
            "minimum": 0
          },
          "skipped_muted": {
            "type": "integer",
            "minimum": 0
          },
          "skipped_cap": {
            "type": "integer",
            "minimum": 0
          },
          "error": {
            "type": "integer",
            "minimum": 0
          },
          "cases_created": {
            "type": "integer",
            "minimum": 0
          },
          "cases_linked": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "AutomationExecutionLogListResponse": {
        "type": "object",
        "required": [
          "logs",
          "count",
          "summary"
        ],
        "properties": {
          "logs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationExecutionLog"
            }
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "summary": {
            "$ref": "#/components/schemas/AutomationExecutionLogsSummary"
          }
        }
      },
      "WebhookIngestRequest": {
        "type": "object",
        "description": "Direct JSON alert payload or GCP Pub/Sub push envelope ({message: {data: base64}}).",
        "properties": {
          "source_type": {
            "type": "string",
            "enum": [
              "CVE",
              "Vendor Trust",
              "OSINT"
            ]
          },
          "vendor_slug": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "details": {
            "type": "string"
          },
          "impact_score": {
            "type": "string",
            "enum": [
              "Low",
              "Medium",
              "High",
              "Critical"
            ]
          },
          "vendor_status": {
            "type": "string",
            "enum": [
              "green",
              "yellow",
              "red"
            ]
          },
          "category": {
            "type": "string",
            "enum": [
              "Security Issue",
              "Operational Issue",
              "Maintenance"
            ]
          },
          "classification": {
            "type": "string"
          },
          "triage_status": {
            "type": "string",
            "enum": [
              "open",
              "investigating",
              "mitigated",
              "false_positive"
            ]
          },
          "source_url": {
            "type": "string",
            "format": "uri"
          },
          "external_id": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "message": {
            "type": "object",
            "description": "Optional GCP Pub/Sub push message wrapper.",
            "properties": {
              "data": {
                "type": "string",
                "format": "byte"
              }
            }
          }
        }
      },
      "WebhookIngestResponse": {
        "type": "object",
        "required": [
          "status",
          "alert_id",
          "vendor_id"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "alert_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "vendor_id": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "TriggerIngestResponse": {
        "type": "object",
        "required": [
          "status",
          "new_alerts_count",
          "alert_ids"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "new_alerts_count": {
            "type": "integer",
            "minimum": 0
          },
          "alert_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          }
        }
      },
      "FeedHealthSummary": {
        "type": "object",
        "required": [
          "total_configured",
          "healthy",
          "failing",
          "never_synced"
        ],
        "properties": {
          "total_configured": {
            "type": "integer",
            "minimum": 0
          },
          "healthy": {
            "type": "integer",
            "minimum": 0
          },
          "failing": {
            "type": "integer",
            "minimum": 0
          },
          "never_synced": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "FeedHealthItem": {
        "type": "object",
        "required": [
          "feed_key",
          "feed_type",
          "status"
        ],
        "properties": {
          "feed_key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "feed_type": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "error",
              "healthy",
              "failing",
              "never_synced"
            ]
          },
          "last_fetched_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_duration_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "consecutive_failures": {
            "type": "integer",
            "minimum": 0
          },
          "last_items_fetched": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "cooldown_minutes": {
            "type": "integer",
            "minimum": 1
          },
          "is_custom": {
            "type": "boolean"
          },
          "custom_feed_id": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "FeedHealthResponse": {
        "type": "object",
        "required": [
          "redis_mode",
          "summary",
          "feeds"
        ],
        "properties": {
          "redis_mode": {
            "type": "string"
          },
          "summary": {
            "$ref": "#/components/schemas/FeedHealthSummary"
          },
          "feeds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FeedHealthItem"
            }
          }
        }
      },
      "HealthzResponse": {
        "type": "object",
        "required": [
          "status",
          "checks",
          "feeds",
          "timestamp"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "degraded"
            ]
          },
          "checks": {
            "type": "object",
            "required": [
              "database",
              "redis"
            ],
            "properties": {
              "database": {
                "type": "string",
                "enum": [
                  "ok",
                  "error"
                ]
              },
              "redis": {
                "type": "string"
              }
            }
          },
          "feeds": {
            "$ref": "#/components/schemas/FeedHealthSummary"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ActivityHeatmapBucket": {
        "type": "object",
        "required": [
          "iso_date",
          "label",
          "weekday",
          "total",
          "critical",
          "high",
          "medium",
          "low",
          "security",
          "operational",
          "maintenance",
          "dominant_severity",
          "intensity",
          "drilldown_url"
        ],
        "properties": {
          "iso_date": {
            "type": "string",
            "format": "date"
          },
          "label": {
            "type": "string"
          },
          "weekday": {
            "type": "string"
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "critical": {
            "type": "integer",
            "minimum": 0
          },
          "high": {
            "type": "integer",
            "minimum": 0
          },
          "medium": {
            "type": "integer",
            "minimum": 0
          },
          "low": {
            "type": "integer",
            "minimum": 0
          },
          "security": {
            "type": "integer",
            "minimum": 0
          },
          "operational": {
            "type": "integer",
            "minimum": 0
          },
          "maintenance": {
            "type": "integer",
            "minimum": 0
          },
          "dominant_severity": {
            "type": "string",
            "enum": [
              "Critical",
              "High",
              "Medium",
              "Low",
              "None"
            ]
          },
          "intensity": {
            "type": "integer",
            "minimum": 0,
            "maximum": 4
          },
          "drilldown_url": {
            "type": "string"
          }
        }
      },
      "ActivityHeatmapSummary": {
        "type": "object",
        "required": [
          "total_alerts",
          "active_days",
          "quiet_days",
          "max_daily_count",
          "avg_daily_alerts",
          "peak_day",
          "severity_totals"
        ],
        "properties": {
          "total_alerts": {
            "type": "integer",
            "minimum": 0
          },
          "active_days": {
            "type": "integer",
            "minimum": 0
          },
          "quiet_days": {
            "type": "integer",
            "minimum": 0
          },
          "max_daily_count": {
            "type": "integer",
            "minimum": 0
          },
          "avg_daily_alerts": {
            "type": "number",
            "minimum": 0
          },
          "peak_day": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "iso_date",
                  "label",
                  "total",
                  "dominant_severity",
                  "drilldown_url"
                ],
                "properties": {
                  "iso_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "label": {
                    "type": "string"
                  },
                  "total": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "dominant_severity": {
                    "type": "string",
                    "enum": [
                      "Critical",
                      "High",
                      "Medium",
                      "Low",
                      "None"
                    ]
                  },
                  "drilldown_url": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "severity_totals": {
            "type": "object",
            "required": [
              "Critical",
              "High",
              "Medium",
              "Low"
            ],
            "properties": {
              "Critical": {
                "type": "integer",
                "minimum": 0
              },
              "High": {
                "type": "integer",
                "minimum": 0
              },
              "Medium": {
                "type": "integer",
                "minimum": 0
              },
              "Low": {
                "type": "integer",
                "minimum": 0
              }
            }
          }
        }
      },
      "AnalyticsActivityResponse": {
        "type": "object",
        "required": [
          "days",
          "start_date",
          "end_date",
          "filters",
          "summary",
          "buckets"
        ],
        "properties": {
          "days": {
            "type": "integer",
            "minimum": 7,
            "maximum": 90
          },
          "start_date": {
            "type": "string",
            "format": "date"
          },
          "end_date": {
            "type": "string",
            "format": "date"
          },
          "filters": {
            "type": "object",
            "additionalProperties": true
          },
          "summary": {
            "$ref": "#/components/schemas/ActivityHeatmapSummary"
          },
          "buckets": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ActivityHeatmapBucket"
            }
          }
        }
      },
      "ExecutivePostureSummary": {
        "type": "object",
        "required": [
          "overall_grade",
          "overall_score",
          "tracked_grade",
          "tracked_score",
          "avg_reliability_percent",
          "avg_mttr_minutes",
          "avg_mttr_label",
          "vendors_healthy",
          "vendors_warning",
          "vendors_critical",
          "total_alerts",
          "critical_alerts",
          "high_alerts",
          "medium_alerts",
          "low_alerts",
          "open_critical_high",
          "kev_count",
          "distinct_cve_count"
        ],
        "properties": {
          "overall_grade": {
            "type": "string"
          },
          "overall_score": {
            "type": [
              "number",
              "null"
            ]
          },
          "tracked_grade": {
            "type": [
              "string",
              "null"
            ]
          },
          "tracked_score": {
            "type": [
              "number",
              "null"
            ]
          },
          "avg_reliability_percent": {
            "type": [
              "number",
              "null"
            ]
          },
          "avg_mttr_minutes": {
            "type": [
              "number",
              "null"
            ]
          },
          "avg_mttr_label": {
            "type": "string"
          },
          "vendors_healthy": {
            "type": "integer",
            "minimum": 0
          },
          "vendors_warning": {
            "type": "integer",
            "minimum": 0
          },
          "vendors_critical": {
            "type": "integer",
            "minimum": 0
          },
          "total_alerts": {
            "type": "integer",
            "minimum": 0
          },
          "critical_alerts": {
            "type": "integer",
            "minimum": 0
          },
          "high_alerts": {
            "type": "integer",
            "minimum": 0
          },
          "medium_alerts": {
            "type": "integer",
            "minimum": 0
          },
          "low_alerts": {
            "type": "integer",
            "minimum": 0
          },
          "open_critical_high": {
            "type": "integer",
            "minimum": 0
          },
          "kev_count": {
            "type": "integer",
            "minimum": 0
          },
          "distinct_cve_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ExecutiveTriageVelocity": {
        "type": "object",
        "required": [
          "counts",
          "total",
          "triaged_count",
          "resolved_count",
          "triage_rate_percent",
          "resolution_rate_percent",
          "median_time_to_triage_minutes",
          "median_time_to_triage_label",
          "avg_time_to_triage_minutes",
          "avg_time_to_triage_label",
          "measured_alerts_count"
        ],
        "properties": {
          "counts": {
            "type": "object",
            "required": [
              "open",
              "investigating",
              "mitigated",
              "false_positive"
            ],
            "properties": {
              "open": {
                "type": "integer",
                "minimum": 0
              },
              "investigating": {
                "type": "integer",
                "minimum": 0
              },
              "mitigated": {
                "type": "integer",
                "minimum": 0
              },
              "false_positive": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "triaged_count": {
            "type": "integer",
            "minimum": 0
          },
          "resolved_count": {
            "type": "integer",
            "minimum": 0
          },
          "triage_rate_percent": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "resolution_rate_percent": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "median_time_to_triage_minutes": {
            "type": [
              "number",
              "null"
            ]
          },
          "median_time_to_triage_label": {
            "type": "string"
          },
          "avg_time_to_triage_minutes": {
            "type": [
              "number",
              "null"
            ]
          },
          "avg_time_to_triage_label": {
            "type": "string"
          },
          "measured_alerts_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ExecutiveRiskVendor": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "status",
          "security_grade",
          "security_score",
          "reliability_percent",
          "avg_mttr",
          "incidents_count",
          "window_alerts_count",
          "window_open_critical_high",
          "is_watched",
          "drilldown_url"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "green",
              "yellow",
              "red"
            ]
          },
          "security_grade": {
            "type": "string"
          },
          "security_score": {
            "type": "number"
          },
          "reliability_percent": {
            "type": "string"
          },
          "avg_mttr": {
            "type": "string"
          },
          "incidents_count": {
            "type": "integer",
            "minimum": 0
          },
          "window_alerts_count": {
            "type": "integer",
            "minimum": 0
          },
          "window_open_critical_high": {
            "type": "integer",
            "minimum": 0
          },
          "is_watched": {
            "type": "boolean"
          },
          "drilldown_url": {
            "type": "string"
          },
          "criticality_tier": {
            "type": "string",
            "enum": [
              "tier_1",
              "tier_2",
              "tier_3"
            ]
          },
          "criticality_short": {
            "type": "string",
            "enum": [
              "T1",
              "T2",
              "T3"
            ]
          },
          "sla_status": {
            "type": "string",
            "enum": [
              "compliant",
              "at_risk",
              "breached"
            ]
          },
          "sla_breaches": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ExecutivePriorityCve": {
        "type": "object",
        "required": [
          "cve_id",
          "is_kev",
          "highest_impact",
          "alert_count",
          "open_count",
          "affected_vendors",
          "first_seen",
          "last_seen",
          "nvd_url",
          "cisa_kev_url",
          "drilldown_url"
        ],
        "properties": {
          "cve_id": {
            "type": "string"
          },
          "is_kev": {
            "type": "boolean"
          },
          "highest_impact": {
            "type": "string",
            "enum": [
              "Critical",
              "High",
              "Medium",
              "Low"
            ]
          },
          "alert_count": {
            "type": "integer",
            "minimum": 1
          },
          "open_count": {
            "type": "integer",
            "minimum": 0
          },
          "affected_vendors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "slug"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "slug": {
                  "type": "string"
                }
              }
            }
          },
          "first_seen": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_seen": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "nvd_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "cisa_kev_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "drilldown_url": {
            "type": "string"
          }
        }
      },
      "ExecutiveGovernanceSummary": {
        "type": "object",
        "required": [
          "feed_health",
          "alert_rules",
          "mute_rules"
        ],
        "properties": {
          "feed_health": {
            "type": "object",
            "required": [
              "total_configured",
              "healthy",
              "failing",
              "never_synced",
              "avg_duration_ms",
              "redis_mode",
              "failing_feeds"
            ],
            "properties": {
              "total_configured": {
                "type": "integer",
                "minimum": 0
              },
              "healthy": {
                "type": "integer",
                "minimum": 0
              },
              "failing": {
                "type": "integer",
                "minimum": 0
              },
              "never_synced": {
                "type": "integer",
                "minimum": 0
              },
              "avg_duration_ms": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "redis_mode": {
                "type": "string"
              },
              "failing_feeds": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "feed_key",
                    "name",
                    "consecutive_failures",
                    "last_error"
                  ],
                  "properties": {
                    "feed_key": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "consecutive_failures": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "last_error": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "alert_rules": {
            "type": "object",
            "required": [
              "total",
              "enabled",
              "deliveries_in_window",
              "deliveries_success",
              "deliveries_failed",
              "deliveries_blocked",
              "success_rate_percent"
            ],
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "enabled": {
                "type": "integer",
                "minimum": 0
              },
              "deliveries_in_window": {
                "type": "integer",
                "minimum": 0
              },
              "deliveries_success": {
                "type": "integer",
                "minimum": 0
              },
              "deliveries_failed": {
                "type": "integer",
                "minimum": 0
              },
              "deliveries_blocked": {
                "type": "integer",
                "minimum": 0
              },
              "success_rate_percent": {
                "type": [
                  "number",
                  "null"
                ]
              }
            }
          },
          "mute_rules": {
            "type": "object",
            "required": [
              "total",
              "active",
              "total_suppressed_count",
              "window_muted_alerts_count",
              "muted_alerts_excluded"
            ],
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 0
              },
              "active": {
                "type": "integer",
                "minimum": 0
              },
              "total_suppressed_count": {
                "type": "integer",
                "minimum": 0
              },
              "window_muted_alerts_count": {
                "type": "integer",
                "minimum": 0
              },
              "muted_alerts_excluded": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "sla_compliance": {
            "$ref": "#/components/schemas/VendorSlaComplianceSummary"
          }
        }
      },
      "ExecutiveReportResponse": {
        "type": "object",
        "required": [
          "generated_at",
          "window",
          "scope",
          "posture",
          "triage",
          "categories",
          "activity",
          "top_risk_vendors",
          "priority_cves",
          "governance",
          "markdown"
        ],
        "properties": {
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "window": {
            "type": "object",
            "required": [
              "days",
              "start_date",
              "end_date"
            ],
            "properties": {
              "days": {
                "type": "integer",
                "minimum": 7,
                "maximum": 90
              },
              "start_date": {
                "type": "string",
                "format": "date"
              },
              "end_date": {
                "type": "string",
                "format": "date"
              }
            }
          },
          "scope": {
            "type": "object",
            "required": [
              "mode",
              "tracked_only",
              "share_id",
              "include_muted",
              "vendors_evaluated",
              "tracked_vendors_count"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "ecosystem",
                  "tracked",
                  "shared"
                ]
              },
              "tracked_only": {
                "type": "boolean"
              },
              "share_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "include_muted": {
                "type": "boolean"
              },
              "vendors_evaluated": {
                "type": "integer",
                "minimum": 0
              },
              "tracked_vendors_count": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "posture": {
            "$ref": "#/components/schemas/ExecutivePostureSummary"
          },
          "triage": {
            "$ref": "#/components/schemas/ExecutiveTriageVelocity"
          },
          "categories": {
            "type": "object",
            "required": [
              "Security Issue",
              "Operational Issue",
              "Maintenance"
            ],
            "properties": {
              "Security Issue": {
                "type": "integer",
                "minimum": 0
              },
              "Operational Issue": {
                "type": "integer",
                "minimum": 0
              },
              "Maintenance": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "activity": {
            "type": "object",
            "required": [
              "active_days",
              "avg_daily_alerts",
              "peak_day"
            ],
            "properties": {
              "active_days": {
                "type": "integer",
                "minimum": 0
              },
              "avg_daily_alerts": {
                "type": "number",
                "minimum": 0
              },
              "peak_day": {
                "oneOf": [
                  {
                    "type": "object",
                    "required": [
                      "iso_date",
                      "label",
                      "total",
                      "drilldown_url"
                    ],
                    "properties": {
                      "iso_date": {
                        "type": "string",
                        "format": "date"
                      },
                      "label": {
                        "type": "string"
                      },
                      "total": {
                        "type": "integer",
                        "minimum": 1
                      },
                      "drilldown_url": {
                        "type": "string"
                      }
                    }
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            }
          },
          "top_risk_vendors": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/ExecutiveRiskVendor"
            }
          },
          "priority_cves": {
            "type": "array",
            "maxItems": 15,
            "items": {
              "$ref": "#/components/schemas/ExecutivePriorityCve"
            }
          },
          "governance": {
            "$ref": "#/components/schemas/ExecutiveGovernanceSummary"
          },
          "markdown": {
            "type": "string"
          }
        }
      },
      "ShiftHandoffReport": {
        "type": "object",
        "required": [
          "generated_at",
          "window",
          "scope",
          "shift_status",
          "incidents",
          "untriaged_queue",
          "tprm_sla",
          "automation_activity",
          "analyst_activity",
          "action_items",
          "markdown"
        ],
        "properties": {
          "generated_at": {
            "type": "string",
            "format": "date-time"
          },
          "window": {
            "type": "object",
            "required": [
              "hours",
              "start_at",
              "end_at",
              "label"
            ],
            "properties": {
              "hours": {
                "type": "integer",
                "enum": [
                  8,
                  12,
                  24
                ]
              },
              "start_at": {
                "type": "string",
                "format": "date-time"
              },
              "end_at": {
                "type": "string",
                "format": "date-time"
              },
              "label": {
                "type": "string"
              }
            }
          },
          "scope": {
            "type": "object",
            "required": [
              "mode",
              "tracked_only",
              "share_id",
              "include_muted",
              "vendor_count",
              "tracked_vendor_count"
            ],
            "properties": {
              "mode": {
                "type": "string",
                "enum": [
                  "ecosystem",
                  "tracked",
                  "shared"
                ]
              },
              "tracked_only": {
                "type": "boolean"
              },
              "share_id": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "include_muted": {
                "type": "boolean"
              },
              "vendor_count": {
                "type": "integer",
                "minimum": 0
              },
              "tracked_vendor_count": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "shift_status": {
            "type": "object",
            "required": [
              "level",
              "headline",
              "new_alerts",
              "critical_alerts",
              "high_alerts",
              "kev_alerts",
              "open_incidents",
              "p1_p2_open_incidents",
              "untriaged_priority_count",
              "sla_breached_vendors",
              "failing_feeds"
            ],
            "properties": {
              "level": {
                "type": "string",
                "enum": [
                  "critical",
                  "elevated",
                  "normal"
                ]
              },
              "headline": {
                "type": "string"
              },
              "new_alerts": {
                "type": "integer",
                "minimum": 0
              },
              "critical_alerts": {
                "type": "integer",
                "minimum": 0
              },
              "high_alerts": {
                "type": "integer",
                "minimum": 0
              },
              "kev_alerts": {
                "type": "integer",
                "minimum": 0
              },
              "open_incidents": {
                "type": "integer",
                "minimum": 0
              },
              "p1_p2_open_incidents": {
                "type": "integer",
                "minimum": 0
              },
              "untriaged_priority_count": {
                "type": "integer",
                "minimum": 0
              },
              "sla_breached_vendors": {
                "type": "integer",
                "minimum": 0
              },
              "failing_feeds": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "incidents": {
            "type": "object",
            "required": [
              "open_total",
              "by_severity",
              "opened_in_shift",
              "resolved_in_shift",
              "incomplete_tasks",
              "active_cases"
            ],
            "properties": {
              "open_total": {
                "type": "integer",
                "minimum": 0
              },
              "by_severity": {
                "type": "object",
                "required": [
                  "P1",
                  "P2",
                  "P3",
                  "P4"
                ],
                "properties": {
                  "P1": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "P2": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "P3": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "P4": {
                    "type": "integer",
                    "minimum": 0
                  }
                }
              },
              "opened_in_shift": {
                "type": "integer",
                "minimum": 0
              },
              "resolved_in_shift": {
                "type": "integer",
                "minimum": 0
              },
              "incomplete_tasks": {
                "type": "integer",
                "minimum": 0
              },
              "active_cases": {
                "type": "array",
                "maxItems": 10,
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "case_code",
                    "title",
                    "severity",
                    "status",
                    "commander",
                    "alert_count",
                    "task_count",
                    "completed_task_count",
                    "incomplete_tasks",
                    "created_at",
                    "updated_at",
                    "target_url"
                  ],
                  "properties": {
                    "id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "case_code": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "severity": {
                      "type": "string",
                      "enum": [
                        "P1",
                        "P2",
                        "P3",
                        "P4"
                      ]
                    },
                    "status": {
                      "type": "string"
                    },
                    "commander": {
                      "type": "string"
                    },
                    "alert_count": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "task_count": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "completed_task_count": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "incomplete_tasks": {
                      "type": "integer",
                      "minimum": 0
                    },
                    "created_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "target_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "untriaged_queue": {
            "type": "object",
            "required": [
              "total_open",
              "tier1_open",
              "kev_open",
              "critical_open",
              "items"
            ],
            "properties": {
              "total_open": {
                "type": "integer",
                "minimum": 0
              },
              "tier1_open": {
                "type": "integer",
                "minimum": 0
              },
              "kev_open": {
                "type": "integer",
                "minimum": 0
              },
              "critical_open": {
                "type": "integer",
                "minimum": 0
              },
              "items": {
                "type": "array",
                "maxItems": 15,
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "summary",
                    "impact_score",
                    "category",
                    "source_type",
                    "source_key",
                    "is_kev",
                    "vendor_id",
                    "vendor_name",
                    "vendor_slug",
                    "vendor_tier",
                    "vendor_tier_short",
                    "cve_ids",
                    "source_url",
                    "timestamp",
                    "target_url"
                  ],
                  "properties": {
                    "id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "summary": {
                      "type": "string"
                    },
                    "impact_score": {
                      "type": "string"
                    },
                    "category": {
                      "type": "string"
                    },
                    "source_type": {
                      "type": "string"
                    },
                    "source_key": {
                      "type": "string"
                    },
                    "is_kev": {
                      "type": "boolean"
                    },
                    "vendor_id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "vendor_name": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "vendor_slug": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "vendor_tier": {
                      "type": "string"
                    },
                    "vendor_tier_short": {
                      "type": "string"
                    },
                    "cve_ids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "source_url": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "timestamp": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "target_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "tprm_sla": {
            "type": "object",
            "required": [
              "breached_count",
              "at_risk_count",
              "tier1_breached_count",
              "compliance_rate_percent",
              "breached_vendors"
            ],
            "properties": {
              "breached_count": {
                "type": "integer",
                "minimum": 0
              },
              "at_risk_count": {
                "type": "integer",
                "minimum": 0
              },
              "tier1_breached_count": {
                "type": "integer",
                "minimum": 0
              },
              "compliance_rate_percent": {
                "type": [
                  "number",
                  "null"
                ],
                "minimum": 0,
                "maximum": 100
              },
              "breached_vendors": {
                "type": "array",
                "maxItems": 10,
                "items": {
                  "type": "object",
                  "required": [
                    "id",
                    "name",
                    "slug",
                    "criticality_tier",
                    "criticality_short",
                    "security_score",
                    "security_grade",
                    "tprm_owner",
                    "breaches",
                    "breach_reasons",
                    "target_url"
                  ],
                  "properties": {
                    "id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "name": {
                      "type": "string"
                    },
                    "slug": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "criticality_tier": {
                      "type": "string"
                    },
                    "criticality_short": {
                      "type": "string"
                    },
                    "security_score": {
                      "type": "number"
                    },
                    "security_grade": {
                      "type": "string"
                    },
                    "tprm_owner": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "breaches": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "breach_reasons": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "target_url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "automation_activity": {
            "type": "object",
            "required": [
              "total_executions",
              "executed",
              "skipped_muted",
              "skipped_cap",
              "errors",
              "auto_triaged",
              "auto_escalated_created",
              "auto_escalated_linked",
              "recent_runs"
            ],
            "properties": {
              "total_executions": {
                "type": "integer",
                "minimum": 0
              },
              "executed": {
                "type": "integer",
                "minimum": 0
              },
              "skipped_muted": {
                "type": "integer",
                "minimum": 0
              },
              "skipped_cap": {
                "type": "integer",
                "minimum": 0
              },
              "errors": {
                "type": "integer",
                "minimum": 0
              },
              "auto_triaged": {
                "type": "integer",
                "minimum": 0
              },
              "auto_escalated_created": {
                "type": "integer",
                "minimum": 0
              },
              "auto_escalated_linked": {
                "type": "integer",
                "minimum": 0
              },
              "recent_runs": {
                "type": "array",
                "maxItems": 10,
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "rule_id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "rule_name": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "alert_id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "alert_summary": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "vendor_slug": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "incident_case_id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "incident_case_code": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "incident_action": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "triage_applied": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "summary": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "created_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "analyst_activity": {
            "type": "object",
            "required": [
              "total_events",
              "distinct_analysts",
              "top_analysts",
              "by_resource",
              "triage_actions",
              "incident_actions",
              "recent_highlights"
            ],
            "properties": {
              "total_events": {
                "type": "integer",
                "minimum": 0
              },
              "distinct_analysts": {
                "type": "integer",
                "minimum": 0
              },
              "top_analysts": {
                "type": "array",
                "maxItems": 5,
                "items": {
                  "type": "object",
                  "required": [
                    "actor",
                    "count"
                  ],
                  "properties": {
                    "actor": {
                      "type": "string"
                    },
                    "count": {
                      "type": "integer",
                      "minimum": 0
                    }
                  }
                }
              },
              "by_resource": {
                "type": "object",
                "additionalProperties": {
                  "type": "integer",
                  "minimum": 0
                }
              },
              "triage_actions": {
                "type": "integer",
                "minimum": 0
              },
              "incident_actions": {
                "type": "integer",
                "minimum": 0
              },
              "recent_highlights": {
                "type": "array",
                "maxItems": 10,
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "action": {
                      "type": "string"
                    },
                    "resource_type": {
                      "type": "string"
                    },
                    "resource_id": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "actor": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "action_items": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "object",
              "required": [
                "priority",
                "category",
                "title",
                "detail",
                "target_url"
              ],
              "properties": {
                "priority": {
                  "type": "string",
                  "enum": [
                    "P1",
                    "P2",
                    "P3"
                  ]
                },
                "category": {
                  "type": "string",
                  "enum": [
                    "incident",
                    "kev",
                    "sla",
                    "triage",
                    "feeds",
                    "automation"
                  ]
                },
                "title": {
                  "type": "string"
                },
                "detail": {
                  "type": "string"
                },
                "target_url": {
                  "type": "string"
                }
              }
            }
          },
          "markdown": {
            "type": "string"
          }
        }
      },
      "ReportDeliveryRequest": {
        "type": "object",
        "description": "Outbound report delivery payload. Supply either rule_id or rule_ids (1..10 unique enabled rule IDs). Use hours (8|12|24) for shift-handoff delivery or days (7..90) for executive report delivery.",
        "properties": {
          "rule_id": {
            "type": "integer",
            "minimum": 1,
            "description": "Single enabled target AlertRule ID."
          },
          "rule_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "uniqueItems": true,
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "description": "List of 1..10 unique enabled AlertRule IDs."
          },
          "hours": {
            "type": "integer",
            "enum": [
              8,
              12,
              24
            ],
            "default": 8,
            "description": "Shift handoff window in hours (shift-handoff delivery only)."
          },
          "days": {
            "type": "integer",
            "minimum": 7,
            "maximum": 90,
            "default": 30,
            "description": "Executive report window in UTC days (executive delivery only)."
          },
          "tracked": {
            "type": "boolean",
            "default": false,
            "description": "When true, scope report to vendors in the caller's tracked_vendors cookie (overridden by share_id)."
          },
          "include_muted": {
            "type": "boolean",
            "default": true,
            "description": "When false, exclude alerts matching active mute/snooze rules."
          },
          "share_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional shared watchlist ID to scope the brief."
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500,
            "description": "Optional sanitized handoff or briefing note attached to the outbound message (max 500 chars)."
          },
          "actor": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64,
            "description": "Optional SOC analyst/operator name recorded in the outbound message and governance audit log."
          }
        }
      },
      "ReportDeliveryItem": {
        "type": "object",
        "required": [
          "id",
          "rule_id",
          "rule_name",
          "event_type",
          "channel_type",
          "status",
          "attempts",
          "target_url_masked"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "rule_id": {
            "type": "integer"
          },
          "rule_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "alert_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "incident_case_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "event_type": {
            "type": "string",
            "enum": [
              "report.shift_handoff",
              "report.executive"
            ]
          },
          "alert_summary": {
            "type": [
              "string",
              "null"
            ]
          },
          "is_test": {
            "type": "boolean"
          },
          "channel_type": {
            "type": "string",
            "enum": [
              "webhook",
              "slack",
              "discord",
              "teams"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "success",
              "failed",
              "blocked"
            ]
          },
          "http_status": {
            "type": [
              "integer",
              "null"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 1
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ]
          },
          "error_message": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "target_host": {
            "type": [
              "string",
              "null"
            ]
          },
          "target_url_masked": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ReportDeliveryResponse": {
        "type": "object",
        "required": [
          "report_type",
          "event_type",
          "delivered_at",
          "summary",
          "deliveries"
        ],
        "properties": {
          "report_type": {
            "type": "string",
            "enum": [
              "shift_handoff",
              "executive"
            ]
          },
          "event_type": {
            "type": "string",
            "enum": [
              "report.shift_handoff",
              "report.executive"
            ]
          },
          "delivered_at": {
            "type": "string",
            "format": "date-time"
          },
          "summary": {
            "type": "object",
            "required": [
              "total",
              "success",
              "failed",
              "blocked"
            ],
            "properties": {
              "total": {
                "type": "integer",
                "minimum": 1
              },
              "success": {
                "type": "integer",
                "minimum": 0
              },
              "failed": {
                "type": "integer",
                "minimum": 0
              },
              "blocked": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "deliveries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ReportDeliveryItem"
            }
          }
        }
      },
      "IncidentPlaybookTaskTemplate": {
        "type": "object",
        "required": [
          "title",
          "phase"
        ],
        "properties": {
          "title": {
            "type": "string"
          },
          "phase": {
            "type": "string",
            "enum": [
              "triage",
              "containment",
              "eradication",
              "recovery",
              "comms"
            ]
          }
        }
      },
      "IncidentPlaybookTemplate": {
        "type": "object",
        "required": [
          "key",
          "name",
          "description",
          "default_severity",
          "task_count",
          "tasks"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "default_severity": {
            "type": "string",
            "enum": [
              "P1",
              "P2",
              "P3",
              "P4"
            ]
          },
          "task_count": {
            "type": "integer",
            "minimum": 1
          },
          "tasks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncidentPlaybookTaskTemplate"
            }
          }
        }
      },
      "IncidentKpiSummary": {
        "type": "object",
        "required": [
          "total",
          "active",
          "p1_active",
          "contained",
          "resolved_or_closed",
          "avg_mttr_minutes"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "active": {
            "type": "integer",
            "minimum": 0
          },
          "p1_active": {
            "type": "integer",
            "minimum": 0
          },
          "contained": {
            "type": "integer",
            "minimum": 0
          },
          "resolved_or_closed": {
            "type": "integer",
            "minimum": 0
          },
          "avg_mttr_minutes": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          }
        }
      },
      "IncidentCaseItem": {
        "type": "object",
        "required": [
          "id",
          "case_code",
          "title",
          "description",
          "severity",
          "status",
          "commander",
          "playbook_key",
          "summary_notes",
          "alert_count",
          "task_count",
          "completed_task_count",
          "event_count",
          "mttr_minutes",
          "resolved_at",
          "closed_at",
          "created_at",
          "updated_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "case_code": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "severity": {
            "type": "string",
            "enum": [
              "P1",
              "P2",
              "P3",
              "P4"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "investigating",
              "contained",
              "resolved",
              "closed"
            ]
          },
          "commander": {
            "type": "string",
            "maxLength": 64
          },
          "playbook_key": {
            "type": [
              "string",
              "null"
            ]
          },
          "summary_notes": {
            "type": [
              "string",
              "null"
            ]
          },
          "alert_count": {
            "type": "integer",
            "minimum": 0
          },
          "task_count": {
            "type": "integer",
            "minimum": 0
          },
          "completed_task_count": {
            "type": "integer",
            "minimum": 0
          },
          "event_count": {
            "type": "integer",
            "minimum": 0
          },
          "mttr_minutes": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          },
          "resolved_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "closed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "IncidentLinkedAlert": {
        "type": "object",
        "required": [
          "id",
          "summary",
          "details",
          "impact_score",
          "category",
          "classification",
          "source_type",
          "source_key",
          "source_url",
          "triage_status",
          "is_acknowledged",
          "timestamp",
          "vendor",
          "cve_ids",
          "linked_by",
          "linked_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "summary": {
            "type": "string"
          },
          "details": {
            "type": "string"
          },
          "impact_score": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "classification": {
            "type": "string"
          },
          "source_type": {
            "type": "string"
          },
          "source_key": {
            "type": "string"
          },
          "source_url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "triage_status": {
            "type": "string",
            "enum": [
              "open",
              "investigating",
              "mitigated",
              "false_positive"
            ]
          },
          "is_acknowledged": {
            "type": "boolean"
          },
          "timestamp": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "vendor": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "id",
                  "name",
                  "slug",
                  "status"
                ],
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "cve_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "linked_by": {
            "type": "string"
          },
          "linked_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "IncidentCaseTask": {
        "type": "object",
        "required": [
          "id",
          "case_id",
          "title",
          "phase",
          "is_completed",
          "completed_by",
          "completed_at",
          "sort_order",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "case_id": {
            "type": "integer",
            "minimum": 1
          },
          "title": {
            "type": "string",
            "maxLength": 200
          },
          "phase": {
            "type": "string",
            "enum": [
              "triage",
              "containment",
              "eradication",
              "recovery",
              "comms"
            ]
          },
          "is_completed": {
            "type": "boolean"
          },
          "completed_by": {
            "type": [
              "string",
              "null"
            ]
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sort_order": {
            "type": "integer",
            "minimum": 0
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "IncidentCaseEvent": {
        "type": "object",
        "required": [
          "id",
          "case_id",
          "event_type",
          "author",
          "body",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "case_id": {
            "type": "integer",
            "minimum": 1
          },
          "event_type": {
            "type": "string",
            "enum": [
              "created",
              "status_change",
              "severity_change",
              "owner_change",
              "alert_linked",
              "alert_unlinked",
              "task_completed",
              "task_reopened",
              "note"
            ]
          },
          "author": {
            "type": "string"
          },
          "body": {
            "type": "string"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "IncidentListResponse": {
        "type": "object",
        "required": [
          "items",
          "total",
          "kpis",
          "playbook_templates",
          "max_cases",
          "oidc_configured",
          "authenticated"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncidentCaseItem"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "kpis": {
            "$ref": "#/components/schemas/IncidentKpiSummary"
          },
          "playbook_templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncidentPlaybookTemplate"
            }
          },
          "max_cases": {
            "type": "integer",
            "minimum": 1
          },
          "oidc_configured": {
            "type": "boolean"
          },
          "authenticated": {
            "type": "boolean"
          }
        }
      },
      "IncidentCreateRequest": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000
          },
          "severity": {
            "type": "string",
            "enum": [
              "P1",
              "P2",
              "P3",
              "P4"
            ],
            "default": "P2"
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "investigating",
              "contained",
              "resolved",
              "closed"
            ],
            "default": "open"
          },
          "commander": {
            "type": "string",
            "maxLength": 64,
            "default": "SOC Analyst"
          },
          "playbook_key": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "cve_zero_day",
              "saas_outage",
              "account_compromise",
              "general_soc",
              null
            ]
          },
          "summary_notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 8000
          },
          "alert_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 1
            },
            "maxItems": 100
          },
          "actor": {
            "type": "string",
            "maxLength": 64
          }
        }
      },
      "IncidentUpdateRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 4000
          },
          "severity": {
            "type": "string",
            "enum": [
              "P1",
              "P2",
              "P3",
              "P4"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "investigating",
              "contained",
              "resolved",
              "closed"
            ]
          },
          "commander": {
            "type": "string",
            "maxLength": 64
          },
          "summary_notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 8000
          },
          "actor": {
            "type": "string",
            "maxLength": 64
          }
        }
      },
      "IncidentCaseEnvelope": {
        "type": "object",
        "required": [
          "case"
        ],
        "properties": {
          "case": {
            "$ref": "#/components/schemas/IncidentCaseItem"
          }
        }
      },
      "IncidentAiPostmortemSummary": {
        "type": "object",
        "required": [
          "markdown",
          "source",
          "generated_at"
        ],
        "properties": {
          "markdown": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "gemini",
              "fallback"
            ]
          },
          "generated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "IncidentAiPostmortemRequest": {
        "type": "object",
        "properties": {
          "force": {
            "type": "boolean",
            "default": false,
            "description": "When true, bypasses any cached AI postmortem and generates a fresh synthesis."
          }
        }
      },
      "IncidentAiPostmortemResponse": {
        "type": "object",
        "required": [
          "case_id",
          "case_code",
          "markdown",
          "source",
          "generated_at",
          "cached"
        ],
        "properties": {
          "case_id": {
            "type": "integer",
            "minimum": 1
          },
          "case_code": {
            "type": "string",
            "example": "INC-0001"
          },
          "markdown": {
            "type": "string"
          },
          "source": {
            "type": "string",
            "enum": [
              "gemini",
              "fallback"
            ]
          },
          "generated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cached": {
            "type": "boolean"
          }
        }
      },
      "IncidentDossierResponse": {
        "type": "object",
        "required": [
          "case",
          "alerts",
          "tasks",
          "events",
          "impacted_vendors",
          "impacted_cves",
          "ai_postmortem"
        ],
        "properties": {
          "case": {
            "$ref": "#/components/schemas/IncidentCaseItem"
          },
          "alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncidentLinkedAlert"
            }
          },
          "tasks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncidentCaseTask"
            }
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncidentCaseEvent"
            }
          },
          "impacted_vendors": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "slug",
                "status"
              ],
              "properties": {
                "id": {
                  "type": "integer"
                },
                "name": {
                  "type": "string"
                },
                "slug": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              }
            }
          },
          "impacted_cves": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ai_postmortem": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/IncidentAiPostmortemSummary"
              },
              {
                "type": "null"
              }
            ],
            "description": "Cached AI-synthesized postmortem metadata and Markdown, or null if not yet generated."
          }
        }
      },
      "IncidentDeleteResponse": {
        "type": "object",
        "required": [
          "status",
          "id"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "deleted"
            ]
          },
          "id": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "IncidentLinkAlertsRequest": {
        "type": "object",
        "required": [
          "alert_ids"
        ],
        "properties": {
          "alert_ids": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "integer",
              "minimum": 1
            }
          },
          "linked_by": {
            "type": "string",
            "maxLength": 64
          }
        }
      },
      "IncidentLinkAlertsResponse": {
        "type": "object",
        "required": [
          "case_id",
          "linked_alert_ids",
          "already_linked_ids",
          "alert_count"
        ],
        "properties": {
          "case_id": {
            "type": "integer",
            "minimum": 1
          },
          "linked_alert_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "already_linked_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "alert_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "IncidentUnlinkAlertResponse": {
        "type": "object",
        "required": [
          "status",
          "case_id",
          "alert_id",
          "alert_count"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "unlinked"
            ]
          },
          "case_id": {
            "type": "integer",
            "minimum": 1
          },
          "alert_id": {
            "type": "integer",
            "minimum": 1
          },
          "alert_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "IncidentTaskCreateRequest": {
        "type": "object",
        "required": [
          "title"
        ],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "phase": {
            "type": "string",
            "enum": [
              "triage",
              "containment",
              "eradication",
              "recovery",
              "comms"
            ],
            "default": "containment"
          },
          "sort_order": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          }
        }
      },
      "IncidentTaskUpdateRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "phase": {
            "type": "string",
            "enum": [
              "triage",
              "containment",
              "eradication",
              "recovery",
              "comms"
            ]
          },
          "is_completed": {
            "type": "boolean"
          },
          "completed_by": {
            "type": "string",
            "maxLength": 64
          },
          "sort_order": {
            "type": "integer",
            "minimum": 0,
            "maximum": 10000
          }
        }
      },
      "IncidentTaskEnvelope": {
        "type": "object",
        "required": [
          "task"
        ],
        "properties": {
          "task": {
            "$ref": "#/components/schemas/IncidentCaseTask"
          }
        }
      },
      "IncidentEventCreateRequest": {
        "type": "object",
        "required": [
          "body"
        ],
        "properties": {
          "body": {
            "type": "string",
            "minLength": 1,
            "maxLength": 2000
          },
          "author": {
            "type": "string",
            "maxLength": 64,
            "default": "SOC Analyst"
          }
        }
      },
      "IncidentEventEnvelope": {
        "type": "object",
        "required": [
          "event"
        ],
        "properties": {
          "event": {
            "$ref": "#/components/schemas/IncidentCaseEvent"
          }
        }
      },
      "CveTriageCounts": {
        "type": "object",
        "required": [
          "open",
          "investigating",
          "mitigated",
          "false_positive"
        ],
        "properties": {
          "open": {
            "type": "integer",
            "minimum": 0
          },
          "investigating": {
            "type": "integer",
            "minimum": 0
          },
          "mitigated": {
            "type": "integer",
            "minimum": 0
          },
          "false_positive": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "CveAffectedVendor": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "status",
          "is_tracked",
          "alert_count",
          "open_count",
          "highest_impact"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "green",
              "yellow",
              "red"
            ]
          },
          "is_tracked": {
            "type": "boolean"
          },
          "alert_count": {
            "type": "integer",
            "minimum": 1
          },
          "open_count": {
            "type": "integer",
            "minimum": 0
          },
          "highest_impact": {
            "type": "string",
            "enum": [
              "Critical",
              "High",
              "Medium",
              "Low"
            ]
          }
        }
      },
      "CveLinkedCaseSummary": {
        "type": "object",
        "required": [
          "id",
          "case_code",
          "title",
          "severity",
          "status"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "case_code": {
            "type": "string",
            "example": "INC-0001"
          },
          "title": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "P1",
              "P2",
              "P3",
              "P4"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "investigating",
              "contained",
              "resolved",
              "closed"
            ]
          }
        }
      },
      "CveLinkedCaseDetail": {
        "type": "object",
        "required": [
          "id",
          "case_code",
          "title",
          "severity",
          "status",
          "commander",
          "updated_at",
          "alert_count",
          "task_count",
          "completed_task_count"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "case_code": {
            "type": "string",
            "example": "INC-0001"
          },
          "title": {
            "type": "string"
          },
          "severity": {
            "type": "string",
            "enum": [
              "P1",
              "P2",
              "P3",
              "P4"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "investigating",
              "contained",
              "resolved",
              "closed"
            ]
          },
          "commander": {
            "type": "string"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "alert_count": {
            "type": "integer",
            "minimum": 0
          },
          "task_count": {
            "type": "integer",
            "minimum": 0
          },
          "completed_task_count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "CveHubLinks": {
        "type": "object",
        "required": [
          "nvd_url",
          "cisa_kev_url",
          "cve_org_url",
          "feed_url",
          "dossier_url"
        ],
        "properties": {
          "nvd_url": {
            "type": "string",
            "format": "uri"
          },
          "cisa_kev_url": {
            "type": "string",
            "format": "uri"
          },
          "cve_org_url": {
            "type": "string",
            "format": "uri"
          },
          "feed_url": {
            "type": "string"
          },
          "dossier_url": {
            "type": "string"
          }
        }
      },
      "CveCatalogItem": {
        "type": "object",
        "required": [
          "cve_id",
          "is_kev",
          "highest_impact",
          "remediation_status",
          "remediation_percent",
          "alert_count",
          "open_count",
          "triage_counts",
          "affected_vendor_count",
          "tracked_vendor_count",
          "affected_vendors",
          "source_keys",
          "linked_case_count",
          "linked_cases",
          "first_seen",
          "last_seen",
          "sample_summary",
          "links"
        ],
        "properties": {
          "cve_id": {
            "type": "string",
            "example": "CVE-2026-1234"
          },
          "is_kev": {
            "type": "boolean"
          },
          "highest_impact": {
            "type": "string",
            "enum": [
              "Critical",
              "High",
              "Medium",
              "Low"
            ]
          },
          "remediation_status": {
            "type": "string",
            "enum": [
              "unmitigated",
              "investigating",
              "mitigated",
              "false_positive"
            ]
          },
          "remediation_percent": {
            "type": "number",
            "minimum": 0,
            "maximum": 100
          },
          "alert_count": {
            "type": "integer",
            "minimum": 1
          },
          "open_count": {
            "type": "integer",
            "minimum": 0
          },
          "triage_counts": {
            "$ref": "#/components/schemas/CveTriageCounts"
          },
          "affected_vendor_count": {
            "type": "integer",
            "minimum": 0
          },
          "tracked_vendor_count": {
            "type": "integer",
            "minimum": 0
          },
          "affected_vendors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CveAffectedVendor"
            }
          },
          "source_keys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "linked_case_count": {
            "type": "integer",
            "minimum": 0
          },
          "linked_cases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CveLinkedCaseSummary"
            }
          },
          "first_seen": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_seen": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sample_summary": {
            "type": "string"
          },
          "links": {
            "$ref": "#/components/schemas/CveHubLinks"
          }
        }
      },
      "CveDetailItem": {
        "allOf": [
          {
            "$ref": "#/components/schemas/CveCatalogItem"
          },
          {
            "type": "object",
            "required": [
              "alert_ids",
              "open_alert_ids",
              "suggested_severity",
              "suggested_playbook_key"
            ],
            "properties": {
              "alert_ids": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "open_alert_ids": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "suggested_severity": {
                "type": "string",
                "enum": [
                  "P1",
                  "P2",
                  "P3",
                  "P4"
                ]
              },
              "suggested_playbook_key": {
                "type": "string",
                "example": "cve_zero_day"
              }
            }
          }
        ]
      },
      "CveDossierAlert": {
        "type": "object",
        "required": [
          "id",
          "summary",
          "details",
          "impact_score",
          "category",
          "classification",
          "source_type",
          "source_key",
          "source_url",
          "triage_status",
          "is_acknowledged",
          "note_count",
          "timestamp",
          "vendor",
          "cve_ids"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "summary": {
            "type": "string"
          },
          "details": {
            "type": "string"
          },
          "impact_score": {
            "type": "string",
            "enum": [
              "Critical",
              "High",
              "Medium",
              "Low"
            ]
          },
          "category": {
            "type": "string"
          },
          "classification": {
            "type": "string"
          },
          "source_type": {
            "type": "string"
          },
          "source_key": {
            "type": "string"
          },
          "source_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "triage_status": {
            "type": "string",
            "enum": [
              "open",
              "investigating",
              "mitigated",
              "false_positive"
            ]
          },
          "is_acknowledged": {
            "type": "boolean"
          },
          "note_count": {
            "type": "integer",
            "minimum": 0
          },
          "timestamp": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "vendor": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "id",
                  "name",
                  "slug",
                  "status",
                  "is_tracked"
                ],
                "properties": {
                  "id": {
                    "type": "integer"
                  },
                  "name": {
                    "type": "string"
                  },
                  "slug": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "green",
                      "yellow",
                      "red"
                    ]
                  },
                  "is_tracked": {
                    "type": "boolean"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "cve_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CveKpiSummary": {
        "type": "object",
        "required": [
          "total_cves",
          "kev_cves",
          "unmitigated_critical_high",
          "affected_vendors",
          "affected_tracked_vendors",
          "escalated_cves"
        ],
        "properties": {
          "total_cves": {
            "type": "integer",
            "minimum": 0
          },
          "kev_cves": {
            "type": "integer",
            "minimum": 0
          },
          "unmitigated_critical_high": {
            "type": "integer",
            "minimum": 0
          },
          "affected_vendors": {
            "type": "integer",
            "minimum": 0
          },
          "affected_tracked_vendors": {
            "type": "integer",
            "minimum": 0
          },
          "escalated_cves": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "CveListResponse": {
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "per_page",
          "total_pages",
          "kpis",
          "filters",
          "oidc_configured",
          "authenticated"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CveCatalogItem"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "per_page": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "total_pages": {
            "type": "integer",
            "minimum": 0
          },
          "kpis": {
            "$ref": "#/components/schemas/CveKpiSummary"
          },
          "filters": {
            "type": "object",
            "additionalProperties": true
          },
          "oidc_configured": {
            "type": "boolean"
          },
          "authenticated": {
            "type": "boolean"
          }
        }
      },
      "CveDetailResponse": {
        "type": "object",
        "required": [
          "cve",
          "alerts",
          "linked_cases",
          "oidc_configured",
          "authenticated"
        ],
        "properties": {
          "cve": {
            "$ref": "#/components/schemas/CveDetailItem"
          },
          "alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CveDossierAlert"
            }
          },
          "linked_cases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CveLinkedCaseDetail"
            }
          },
          "oidc_configured": {
            "type": "boolean"
          },
          "authenticated": {
            "type": "boolean"
          }
        }
      },
      "CveExportJsonBundle": {
        "type": "object",
        "required": [
          "exported_at",
          "cve",
          "count",
          "truncated",
          "alerts",
          "linked_cases"
        ],
        "properties": {
          "exported_at": {
            "type": "string",
            "format": "date-time"
          },
          "cve": {
            "$ref": "#/components/schemas/CveDetailItem"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "truncated": {
            "type": "boolean"
          },
          "alerts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CveDossierAlert"
            }
          },
          "linked_cases": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CveLinkedCaseDetail"
            }
          }
        }
      },
      "AuditEvent": {
        "type": "object",
        "required": [
          "id",
          "action",
          "resource_type",
          "resource_id",
          "actor",
          "actor_ip_hash",
          "summary",
          "metadata",
          "created_at"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "action": {
            "type": "string",
            "maxLength": 64
          },
          "resource_type": {
            "type": "string",
            "enum": [
              "alert",
              "alert_rule",
              "mute_rule",
              "incident",
              "watchlist",
              "system"
            ]
          },
          "resource_id": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 64
          },
          "actor": {
            "type": "string",
            "maxLength": 64
          },
          "actor_ip_hash": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 16
          },
          "summary": {
            "type": "string",
            "maxLength": 280
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AuditLogSummary": {
        "type": "object",
        "required": [
          "total_matching",
          "last_24h_count",
          "distinct_actors",
          "top_resource_type",
          "by_resource_type"
        ],
        "properties": {
          "total_matching": {
            "type": "integer",
            "minimum": 0
          },
          "last_24h_count": {
            "type": "integer",
            "minimum": 0
          },
          "distinct_actors": {
            "type": "integer",
            "minimum": 0
          },
          "top_resource_type": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "alert",
              "alert_rule",
              "mute_rule",
              "incident",
              "watchlist",
              "system",
              null
            ]
          },
          "by_resource_type": {
            "type": "object",
            "additionalProperties": {
              "type": "integer",
              "minimum": 0
            }
          }
        }
      },
      "AuditLogResponse": {
        "type": "object",
        "required": [
          "items",
          "total",
          "page",
          "per_page",
          "total_pages",
          "summary",
          "filters",
          "oidc_configured",
          "authenticated"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditEvent"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "page": {
            "type": "integer",
            "minimum": 1
          },
          "per_page": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "total_pages": {
            "type": "integer",
            "minimum": 0
          },
          "summary": {
            "$ref": "#/components/schemas/AuditLogSummary"
          },
          "filters": {
            "type": "object",
            "additionalProperties": true
          },
          "oidc_configured": {
            "type": "boolean"
          },
          "authenticated": {
            "type": "boolean"
          }
        }
      },
      "AuditLogExportJsonResponse": {
        "type": "object",
        "required": [
          "exported_at",
          "count",
          "truncated",
          "filters",
          "summary",
          "items"
        ],
        "properties": {
          "exported_at": {
            "type": "string",
            "format": "date-time"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "truncated": {
            "type": "boolean"
          },
          "filters": {
            "type": "object",
            "additionalProperties": true
          },
          "summary": {
            "$ref": "#/components/schemas/AuditLogSummary"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditEvent"
            }
          }
        }
      },
      "CustomFeedHealth": {
        "type": "object",
        "required": [
          "status",
          "last_fetched_at",
          "last_attempt_at",
          "last_duration_ms",
          "consecutive_failures",
          "last_items_fetched",
          "last_error"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "error",
              "never_synced"
            ]
          },
          "last_fetched_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_attempt_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "last_duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "consecutive_failures": {
            "type": "integer",
            "minimum": 0
          },
          "last_items_fetched": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "last_error": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CustomFeed": {
        "type": "object",
        "required": [
          "id",
          "feed_key",
          "name",
          "feed_type",
          "feed_url",
          "vendor_id",
          "vendor_slug",
          "vendor_name",
          "enabled",
          "poll_interval_minutes",
          "notes",
          "last_synced_at",
          "created_at",
          "updated_at",
          "health"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "feed_key": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "feed_type": {
            "type": "string",
            "enum": [
              "status",
              "osint"
            ]
          },
          "feed_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
          },
          "vendor_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "vendor_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "vendor_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "poll_interval_minutes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 1440
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "last_synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "health": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CustomFeedHealth"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CustomFeedSummary": {
        "type": "object",
        "required": [
          "total",
          "enabled",
          "healthy",
          "failing",
          "never_synced",
          "max_feeds",
          "oidc_configured",
          "authenticated"
        ],
        "properties": {
          "total": {
            "type": "integer",
            "minimum": 0
          },
          "enabled": {
            "type": "integer",
            "minimum": 0
          },
          "healthy": {
            "type": "integer",
            "minimum": 0
          },
          "failing": {
            "type": "integer",
            "minimum": 0
          },
          "never_synced": {
            "type": "integer",
            "minimum": 0
          },
          "max_feeds": {
            "type": "integer",
            "minimum": 1
          },
          "oidc_configured": {
            "type": "boolean"
          },
          "authenticated": {
            "type": "boolean"
          }
        }
      },
      "CustomFeedListResponse": {
        "type": "object",
        "required": [
          "feeds",
          "summary"
        ],
        "properties": {
          "feeds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomFeed"
            }
          },
          "summary": {
            "$ref": "#/components/schemas/CustomFeedSummary"
          }
        }
      },
      "CustomFeedNewVendorRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "slug": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 2,
            "maxLength": 80
          },
          "criticality_tier": {
            "type": "string",
            "enum": [
              "tier_1",
              "tier_2",
              "tier_3"
            ],
            "default": "tier_2"
          }
        }
      },
      "CustomFeedVendorCreated": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "status",
          "criticality_tier"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "minimum": 1
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "green",
              "yellow",
              "red"
            ]
          },
          "criticality_tier": {
            "type": "string",
            "enum": [
              "tier_1",
              "tier_2",
              "tier_3"
            ]
          }
        }
      },
      "CustomFeedCreateRequest": {
        "type": "object",
        "required": [
          "name",
          "feed_url"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "feed_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
          },
          "feed_type": {
            "type": "string",
            "enum": [
              "status",
              "osint"
            ],
            "default": "status"
          },
          "vendor_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "vendor_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "new_vendor": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CustomFeedNewVendorRequest"
              },
              {
                "type": "null"
              }
            ]
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "poll_interval_minutes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 1440,
            "default": 15
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "actor": {
            "type": "string",
            "maxLength": 64
          }
        }
      },
      "CustomFeedCreateResponse": {
        "type": "object",
        "required": [
          "feed",
          "vendor_created"
        ],
        "properties": {
          "feed": {
            "$ref": "#/components/schemas/CustomFeed"
          },
          "vendor_created": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CustomFeedVendorCreated"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "CustomFeedDetailResponse": {
        "type": "object",
        "required": [
          "feed"
        ],
        "properties": {
          "feed": {
            "$ref": "#/components/schemas/CustomFeed"
          }
        }
      },
      "CustomFeedUpdateRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "feed_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
          },
          "feed_type": {
            "type": "string",
            "enum": [
              "status",
              "osint"
            ]
          },
          "vendor_id": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "vendor_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "enabled": {
            "type": "boolean"
          },
          "poll_interval_minutes": {
            "type": "integer",
            "minimum": 5,
            "maximum": 1440
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 500
          },
          "actor": {
            "type": "string",
            "maxLength": 64
          }
        }
      },
      "CustomFeedDeleteResponse": {
        "type": "object",
        "required": [
          "deleted",
          "id"
        ],
        "properties": {
          "deleted": {
            "type": "boolean"
          },
          "id": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "CustomFeedTestRequest": {
        "type": "object",
        "properties": {
          "feed_id": {
            "type": "integer",
            "minimum": 1
          },
          "feed_url": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
          },
          "feed_type": {
            "type": "string",
            "enum": [
              "status",
              "osint"
            ],
            "default": "status"
          },
          "vendor_name": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 100
          }
        }
      },
      "CustomFeedPreviewSample": {
        "type": "object",
        "required": [
          "summary",
          "details",
          "impact_score",
          "category",
          "classification",
          "source_type",
          "source_url",
          "published_at",
          "vendor_status"
        ],
        "properties": {
          "summary": {
            "type": "string"
          },
          "details": {
            "type": [
              "string",
              "null"
            ]
          },
          "impact_score": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "classification": {
            "type": "string"
          },
          "source_type": {
            "type": "string"
          },
          "source_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "vendor_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "green",
              "yellow",
              "red",
              null
            ]
          }
        }
      },
      "CustomFeedTestResponse": {
        "type": "object",
        "required": [
          "ok",
          "feed_format",
          "final_url",
          "duration_ms",
          "items_found",
          "samples",
          "error"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "feed_format": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "rss",
              "atom",
              null
            ]
          },
          "final_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "duration_ms": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "items_found": {
            "type": "integer",
            "minimum": 0
          },
          "samples": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CustomFeedPreviewSample"
            }
          },
          "error": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "CustomFeedSyncResponse": {
        "type": "object",
        "required": [
          "feed",
          "health",
          "new_alerts_count",
          "alert_ids",
          "vendor_status"
        ],
        "properties": {
          "feed": {
            "$ref": "#/components/schemas/CustomFeed"
          },
          "health": {
            "$ref": "#/components/schemas/CustomFeedHealth"
          },
          "new_alerts_count": {
            "type": "integer",
            "minimum": 0
          },
          "alert_ids": {
            "type": "array",
            "items": {
              "type": "integer"
            }
          },
          "vendor_status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "green",
              "yellow",
              "red",
              null
            ]
          }
        }
      }
    }
  },
  "x-sentinel": {
    "auth_mode": "oidc_fail_closed",
    "oidc_configured": false,
    "rate_limit_headers": [
      "X-RateLimit-Limit",
      "X-RateLimit-Remaining",
      "X-RateLimit-Reset",
      "Retry-After"
    ],
    "endpoint_count": 80
  }
}