{
  "openapi": "3.0.3",
  "info": {
    "title": "Monitors API",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.olostep.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "Authorization": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer authentication header of the form Bearer <token>, where <token> is your auth token."
      }
    },
    "schemas": {
      "MonitorTracked": {
        "type": "object",
        "description": "Resolved targets the monitor tracks after planning completes.",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true,
            "description": "Tracked surface type (for example `url` or `web_query`)."
          },
          "urls": {
            "type": "array",
            "items": { "type": "string", "format": "uri" },
            "description": "Concrete URLs being monitored."
          },
          "web_query": {
            "type": "string",
            "nullable": true,
            "description": "Web search query used when the monitor tracks a dynamic result set."
          }
        }
      },
      "MonitorSourcePolicy": {
        "type": "object",
        "description": "Optional URL/domain allow and deny lists applied during planning and execution.",
        "properties": {
          "include_urls": {
            "type": "array",
            "items": { "type": "string", "format": "uri" }
          },
          "exclude_urls": {
            "type": "array",
            "items": { "type": "string", "format": "uri" }
          },
          "include_domains": {
            "type": "array",
            "items": { "type": "string" }
          },
          "exclude_domains": {
            "type": "array",
            "items": { "type": "string" }
          }
        }
      },
      "MonitorSchedule": {
        "type": "object",
        "properties": {
          "frequency": {
            "type": "string",
            "nullable": true,
            "description": "Natural-language schedule text (for example `every hour`)."
          },
          "cron": {
            "type": "string",
            "nullable": true,
            "description": "Cron expression derived from `frequency`."
          },
          "timezone": {
            "type": "string",
            "example": "UTC",
            "description": "Schedule timezone. Currently `UTC` for monitor schedules."
          },
          "next_run_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true,
            "description": "Next scheduled run (ISO 8601). `null` when the monitor is not `active`."
          }
        }
      },
      "NotificationChannel": {
        "type": "object",
        "required": ["type", "target"],
        "properties": {
          "type": {
            "type": "string",
            "enum": ["email", "slack", "sms"],
            "description": "Delivery channel type."
          },
          "target": {
            "type": "string",
            "description": "Email address, Slack webhook URL, or E.164 phone number (for SMS)."
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["changed", "first_snapshot"]
            },
            "description": "Optional per-channel event filter. When omitted, channel delivery follows top-level `notification.events` (or defaults when channels are set)."
          }
        }
      },
      "MonitorNotification": {
        "type": "object",
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["changed", "first_snapshot"]
            },
            "description": "When to notify. `changed` — deliver when a change is detected vs. the previous snapshot. `first_snapshot` — deliver when the first baseline snapshot is taken. Defaults to both when `channels` is non-empty and `events` is empty."
          },
          "channels": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/NotificationChannel" },
            "description": "Email, Slack, or SMS delivery targets. Resolved at runtime by the monitor pipeline."
          }
        }
      },
      "MonitorWebhook": {
        "type": "object",
        "required": ["url"],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "description": "HTTP/HTTPS URL that receives monitor payloads (separate from `notification.channels`)."
          }
        }
      },
      "MonitorLastRun": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true,
            "description": "Run ID of the latest snapshot (`run_…`)."
          },
          "status": {
            "type": "string",
            "example": "completed"
          },
          "change_detected": {
            "type": "boolean",
            "nullable": true
          },
          "ran_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        }
      },
      "MonitorAgent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true,
            "description": "Internal shadow agent ID used to execute the monitor DAG."
          }
        }
      },
      "Monitor": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique monitor identifier (`monitor_…`)."
          },
          "object": {
            "type": "string",
            "example": "monitor"
          },
          "query": {
            "type": "string",
            "description": "Monitoring intent in natural language."
          },
          "tracked": {
            "$ref": "#/components/schemas/MonitorTracked"
          },
          "source_policy": {
            "$ref": "#/components/schemas/MonitorSourcePolicy"
          },
          "schedule": {
            "$ref": "#/components/schemas/MonitorSchedule"
          },
          "notification": {
            "$ref": "#/components/schemas/MonitorNotification"
          },
          "webhook": {
            "allOf": [{ "$ref": "#/components/schemas/MonitorWebhook" }],
            "nullable": true
          },
          "output_schema": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true,
            "description": "Optional JSON Schema for structured extraction output."
          },
          "status": {
            "type": "string",
            "enum": ["provisioning", "active", "paused", "failed", "deleted"],
            "description": "Monitor lifecycle status."
          },
          "error_message": {
            "type": "string",
            "nullable": true,
            "description": "Present when `status` is `failed`."
          },
          "last_run": {
            "allOf": [{ "$ref": "#/components/schemas/MonitorLastRun" }],
            "nullable": true,
            "description": "Latest snapshot summary. Included on `GET /v1/monitors/{monitor_id}`."
          },
          "agent": {
            "$ref": "#/components/schemas/MonitorAgent"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "created": {
            "type": "integer",
            "description": "Unix timestamp (seconds)."
          },
          "updated": {
            "type": "integer",
            "description": "Unix timestamp (seconds)."
          },
          "total_count": {
            "type": "integer",
            "description": "Total snapshot count. Included on `GET /v1/monitors/{monitor_id}` unless `include_total_count=false`."
          },
          "mermaid_diagram": {
            "type": "string",
            "description": "Mermaid flowchart of the monitor DAG. Included when `include-diagram=true` on get."
          }
        }
      },
      "MonitorEvent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Event identifier (`run_id` or `created_at` fallback)."
          },
          "run_id": {
            "type": "string",
            "nullable": true
          },
          "created": {
            "type": "integer",
            "nullable": true,
            "description": "Unix timestamp (seconds)."
          },
          "changed": {
            "type": "boolean",
            "nullable": true
          },
          "summary": {
            "type": "string",
            "nullable": true
          },
          "snapshot_url": {
            "type": "string",
            "format": "uri",
            "nullable": true,
            "description": "Short-lived pre-signed URL to retrieve snapshot JSON."
          }
        }
      },
      "MonitorPlanningSpec": {
        "type": "object",
        "nullable": true,
        "properties": {
          "saved_at": { "type": "string", "nullable": true },
          "status": { "type": "string", "nullable": true },
          "goal": { "type": "string", "nullable": true },
          "reasoning": { "type": "string", "nullable": true },
          "constraints": { "type": "string", "nullable": true },
          "assumptions": { "type": "string", "nullable": true },
          "input": { "type": "object", "additionalProperties": true, "nullable": true },
          "output": { "type": "object", "additionalProperties": true, "nullable": true },
          "chat_history": {
            "type": "array",
            "items": { "type": "object", "additionalProperties": true }
          }
        }
      },
      "MonitorPlanningDag": {
        "type": "object",
        "nullable": true,
        "properties": {
          "user_query": { "type": "string", "nullable": true },
          "query_intent_mode": { "type": "string", "nullable": true },
          "query_intent_stream_change_type": { "type": "string", "nullable": true },
          "scrape_strategy": { "type": "string", "nullable": true },
          "subtasks": {
            "type": "array",
            "items": { "type": "object", "additionalProperties": true }
          },
          "graph": { "type": "object", "additionalProperties": true, "nullable": true },
          "has_unresolved": { "type": "boolean" },
          "unresolved": {
            "type": "array",
            "items": { "type": "object", "additionalProperties": true }
          },
          "validation": {
            "type": "object",
            "nullable": true,
            "properties": {
              "is_valid": { "type": "boolean" },
              "attempts": { "type": "integer" },
              "history": {
                "type": "array",
                "items": { "type": "object", "additionalProperties": true }
              }
            }
          }
        }
      },
      "AgentLogEvent": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "ts": { "type": "integer", "description": "CloudWatch event timestamp (ms)." },
          "ingestion_ts": { "type": "integer" },
          "stream": { "type": "string" },
          "message": { "type": "string" },
          "event": {
            "type": "object",
            "additionalProperties": true,
            "description": "Parsed log line (for example `work_received`, `node_start`, `run_complete`)."
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": { "type": "string" },
          "monitor_id": {
            "type": "string",
            "description": "Present on some create/update error responses."
          }
        }
      }
    }
  },
  "paths": {
    "/v1/monitors": {
      "post": {
        "summary": "Create Monitor",
        "description": "Creates a monitor from a natural-language `query`, provisions an internal agent and schedule, generates a workflow spec, and queues DAG planning. Returns HTTP `202` with `status: provisioning` when the request completes without streaming. Pass `?stream=1` or `Accept: text/event-stream` to receive Server-Sent Events for provisioning phases and spec reasoning tokens. The monitor becomes `active` after planning resolves tracked targets.",
        "security": [{ "Authorization": [] }],
        "parameters": [
          {
            "name": "stream",
            "in": "query",
            "required": false,
            "schema": { "type": "string", "enum": ["1", "true"] },
            "description": "When set, the response is `text/event-stream` with `phase`, `reasoning_token`, `complete`, and `error` events."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["query"],
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "What to monitor, in natural language."
                  },
                  "source_policy": {
                    "$ref": "#/components/schemas/MonitorSourcePolicy"
                  },
                  "frequency": {
                    "type": "string",
                    "maxLength": 50,
                    "default": "every hour",
                    "description": "Natural-language schedule (for example `every day at 9am`). Minimum interval is every 10 minutes. Schedules use UTC."
                  },
                  "notification": {
                    "$ref": "#/components/schemas/MonitorNotification"
                  },
                  "webhook": {
                    "$ref": "#/components/schemas/MonitorWebhook"
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true
                  },
                  "output_schema": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "JSON Schema for structured extraction output."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Monitor accepted; provisioning started (non-streaming).",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Monitor" }
              }
            }
          },
          "200": {
            "description": "Provisioning stream (`text/event-stream`) when `stream=1`. Ends with a `complete` event containing the monitor object.",
            "content": {
              "text/event-stream": {
                "schema": { "type": "string" }
              }
            }
          },
          "400": {
            "description": "Invalid request (query, frequency, source_policy, notification, webhook, metadata, or output_schema).",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          },
          "401": { "description": "Invalid API key." },
          "500": { "description": "Internal server error while creating monitor." },
          "503": {
            "description": "FDA master agent unavailable during provisioning."
          }
        }
      },
      "get": {
        "summary": "List Monitors",
        "description": "Lists monitors for your team. Deleted monitors are excluded unless `include_deleted=true`.",
        "security": [{ "Authorization": [] }],
        "parameters": [
          {
            "name": "include_deleted",
            "in": "query",
            "required": false,
            "schema": { "type": "string", "enum": ["true", "false"], "default": "false" }
          }
        ],
        "responses": {
          "200": {
            "description": "Monitor list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "monitors": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/Monitor" }
                    },
                    "count": { "type": "integer" }
                  }
                }
              }
            }
          },
          "401": { "description": "Invalid API key." },
          "500": { "description": "Internal server error while listing monitors." }
        }
      }
    },
    "/v1/monitors/{monitor_id}": {
      "get": {
        "summary": "Get Monitor",
        "description": "Retrieves a monitor, including `last_run` and snapshot `total_count` by default.",
        "security": [{ "Authorization": [] }],
        "parameters": [
          {
            "name": "monitor_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "pattern": "^monitor_" }
          },
          {
            "name": "include_total_count",
            "in": "query",
            "required": false,
            "schema": { "type": "string", "enum": ["true", "false", "0", "1"] },
            "description": "Set to `false` or `0` to omit `total_count`."
          },
          {
            "name": "include-diagram",
            "in": "query",
            "required": false,
            "schema": { "type": "string", "enum": ["true", "1"] },
            "description": "When true, includes `mermaid_diagram` for the monitor DAG."
          }
        ],
        "responses": {
          "200": {
            "description": "Monitor retrieved.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Monitor" }
              }
            }
          },
          "400": {
            "description": "Invalid monitor_id.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "401": { "description": "Invalid API key." },
          "404": { "description": "Monitor not found." },
          "500": { "description": "Internal server error." }
        }
      },
      "post": {
        "summary": "Update Monitor",
        "description": "Updates `frequency`, `metadata`, `notification`, and/or `webhook`. Frequency changes delete and recreate the underlying schedule. Set `webhook` to `null` to remove it. Returns `409` while `status` is `provisioning`.",
        "security": [{ "Authorization": [] }],
        "parameters": [
          {
            "name": "monitor_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "pattern": "^monitor_" }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "frequency": {
                    "type": "string",
                    "description": "Natural-language schedule text. Recreates the internal schedule."
                  },
                  "metadata": {
                    "type": "object",
                    "additionalProperties": true,
                    "description": "Merged with existing metadata; empty string values delete keys."
                  },
                  "notification": {
                    "$ref": "#/components/schemas/MonitorNotification"
                  },
                  "webhook": {
                    "allOf": [{ "$ref": "#/components/schemas/MonitorWebhook" }],
                    "nullable": true,
                    "description": "Pass `null` to remove the webhook."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Monitor updated.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Monitor" }
              }
            }
          },
          "400": {
            "description": "Invalid request or monitor deleted.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "401": { "description": "Invalid API key." },
          "404": { "description": "Monitor not found." },
          "409": {
            "description": "Monitor is still provisioning.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "500": { "description": "Internal server error." }
        }
      },
      "delete": {
        "summary": "Delete Monitor",
        "description": "Soft-deletes the monitor (`status: deleted`) and removes its schedule and shadow agent row.",
        "security": [{ "Authorization": [] }],
        "parameters": [
          {
            "name": "monitor_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "pattern": "^monitor_" }
          }
        ],
        "responses": {
          "200": {
            "description": "Monitor deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": { "type": "string" },
                    "monitor_id": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid monitor_id or already deleted.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "401": { "description": "Invalid API key." },
          "404": { "description": "Monitor not found." },
          "500": { "description": "Internal server error." }
        }
      }
    },
    "/v1/monitors/{monitor_id}/events": {
      "get": {
        "summary": "List Monitor Events",
        "description": "Lists snapshot events (newest first) with short-lived pre-signed `snapshot_url` values.",
        "security": [{ "Authorization": [] }],
        "parameters": [
          {
            "name": "monitor_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "pattern": "^monitor_" }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 25 }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": { "type": "string" },
            "description": "Opaque cursor from `next_cursor`."
          },
          {
            "name": "count_only",
            "in": "query",
            "schema": { "type": "string", "enum": ["true", "1"] },
            "description": "When true, returns only `{ \"total_count\": N }`."
          }
        ],
        "responses": {
          "200": {
            "description": "Event page or count.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "data": {
                          "type": "array",
                          "items": { "$ref": "#/components/schemas/MonitorEvent" }
                        },
                        "has_more": { "type": "boolean" },
                        "next_cursor": { "type": "string", "nullable": true },
                        "total_count": { "type": "integer" }
                      }
                    },
                    {
                      "type": "object",
                      "properties": {
                        "total_count": { "type": "integer" }
                      },
                      "required": ["total_count"]
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Invalid monitor_id or cursor.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "401": { "description": "Invalid API key." },
          "404": { "description": "Monitor not found." },
          "500": { "description": "Internal server error." }
        }
      }
    },
    "/v1/monitors/{monitor_id}/planning": {
      "get": {
        "summary": "Get Monitor Planning",
        "description": "Returns the FDA workflow spec and planner DAG stored for the monitor's shadow agent.",
        "security": [{ "Authorization": [] }],
        "parameters": [
          {
            "name": "monitor_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "pattern": "^monitor_" }
          }
        ],
        "responses": {
          "200": {
            "description": "Planning artifacts.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "spec": { "$ref": "#/components/schemas/MonitorPlanningSpec" },
                    "dag": { "$ref": "#/components/schemas/MonitorPlanningDag" }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid monitor_id.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "401": { "description": "Invalid API key." },
          "404": {
            "description": "Monitor not found or monitor has no agent yet."
          },
          "500": { "description": "Internal server error." }
        }
      }
    },
    "/v1/monitors/{monitor_id}/agent-logs": {
      "get": {
        "summary": "Stream Monitor Agent Logs",
        "description": "Tails CloudWatch logs for the monitor's shadow agent, filtered to lines mentioning this `monitor_id`. Requires `?stream=1` or `Accept: text/event-stream`.",
        "security": [{ "Authorization": [] }],
        "parameters": [
          {
            "name": "monitor_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "pattern": "^monitor_" }
          },
          {
            "name": "stream",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "enum": ["1", "true"] }
          },
          {
            "name": "since",
            "in": "query",
            "schema": { "type": "integer" },
            "description": "Start timestamp in milliseconds (default: 30 minutes ago)."
          }
        ],
        "responses": {
          "200": {
            "description": "SSE stream with `ready`, `log`, `heartbeat`, and `error` events.",
            "content": {
              "text/event-stream": { "schema": { "type": "string" } }
            }
          },
          "400": {
            "description": "Invalid monitor_id or missing stream parameter.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "401": { "description": "Invalid API key." },
          "404": { "description": "Monitor not found." },
          "500": { "description": "Internal server error." }
        }
      }
    },
    "/v1/monitors/{monitor_id}/runs/{run_id}": {
      "get": {
        "summary": "Get Monitor Run",
        "description": "Returns snapshot metadata and parsed agent log events for a single run.",
        "security": [{ "Authorization": [] }],
        "parameters": [
          {
            "name": "monitor_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "pattern": "^monitor_" }
          },
          {
            "name": "run_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "pattern": "^run_" }
          }
        ],
        "responses": {
          "200": {
            "description": "Run detail.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "monitor_id": { "type": "string" },
                    "run_id": { "type": "string" },
                    "snapshot": {
                      "type": "object",
                      "additionalProperties": true,
                      "nullable": true
                    },
                    "log_group": { "type": "string", "nullable": true },
                    "events": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/AgentLogEvent" }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid monitor_id or run_id.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "401": { "description": "Invalid API key." },
          "404": { "description": "Monitor not found." },
          "500": { "description": "Internal server error." }
        }
      }
    },
    "/v1/monitors/{monitor_id}/pause": {
      "post": {
        "summary": "Pause Monitor",
        "description": "Disables the monitor schedule and sets `status` to `paused`. Only `active` monitors can be paused.",
        "security": [{ "Authorization": [] }],
        "parameters": [
          {
            "name": "monitor_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "pattern": "^monitor_" }
          }
        ],
        "responses": {
          "200": {
            "description": "Monitor paused.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Monitor" }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "401": { "description": "Invalid API key." },
          "404": { "description": "Monitor not found." },
          "409": {
            "description": "Schedule missing or monitor no longer active.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "500": { "description": "Internal server error." }
        }
      }
    },
    "/v1/monitors/{monitor_id}/resume": {
      "post": {
        "summary": "Resume Monitor",
        "description": "Re-enables the monitor schedule and sets `status` to `active`. Only `paused` monitors can be resumed.",
        "security": [{ "Authorization": [] }],
        "parameters": [
          {
            "name": "monitor_id",
            "in": "path",
            "required": true,
            "schema": { "type": "string", "pattern": "^monitor_" }
          }
        ],
        "responses": {
          "200": {
            "description": "Monitor resumed.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Monitor" }
              }
            }
          },
          "400": {
            "description": "Invalid request.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "401": { "description": "Invalid API key." },
          "404": { "description": "Monitor not found." },
          "409": {
            "description": "Schedule missing or monitor no longer paused.",
            "content": {
              "application/json": { "schema": { "$ref": "#/components/schemas/ErrorResponse" } }
            }
          },
          "500": { "description": "Internal server error." }
        }
      }
    }
  }
}
