{"openapi":"3.1.0","info":{"title":"ServerMetry API","version":"1.0.0","description":"Self-hosted server monitoring API. Admin endpoints require a session cookie (Better Auth). Agent endpoints require the `X-Server-Key` header."},"servers":[{"url":"/","description":"Current server"}],"security":[],"tags":[{"name":"Health","description":"Health check"},{"name":"Servers","description":"Server CRUD & API key management"},{"name":"Metrics","description":"Metrics retrieval and uptime stats"},{"name":"Alerts","description":"Alert listing and resolution"},{"name":"Alert Rules","description":"Alert rule CRUD"},{"name":"Notification Channels","description":"Notification channel CRUD"},{"name":"Server Config","description":"Per-server configuration"},{"name":"Maintenance","description":"Global maintenance windows"},{"name":"Server Maintenance","description":"Per-server maintenance windows"},{"name":"Templates","description":"Server configuration templates"},{"name":"Dashboard","description":"Aggregated overview stats"},{"name":"Organization","description":"Organization & member management"},{"name":"Public","description":"Unauthenticated public endpoints"},{"name":"Audit Log","description":"Audit log viewing"},{"name":"Agent","description":"Agent endpoints (authenticated via X-Server-Key)"},{"name":"Test Mode","description":"Test mode toggle"},{"name":"Test Override","description":"Per-server metric overrides for alert testing"},{"name":"Backup Plans","description":"Backup plan CRUD and ping endpoint"},{"name":"Server Services","description":"Per-server service definitions (ports, protocols)"},{"name":"IP Management","description":"IP network and address assignment management"},{"name":"Backup Alert Rules","description":"Backup failure, overdue and runtime rules"},{"name":"Website Alert Rules","description":"Website downtime, response time and TLS expiry alert rules"},{"name":"Websites","description":"Website availability monitoring and HTTP security scans"},{"name":"Status Pages","description":"Public status pages and incident lifecycle"},{"name":"Projects","description":"Customer/project management with server, service, and IP assignment grouping"},{"name":"Billing","description":"Subscription plans, Stripe checkout, and usage limits"},{"name":"Admin","description":"Super-admin endpoints (requires role=admin)"},{"name":"User","description":"User profile and preferences"}],"components":{"schemas":{},"parameters":{}},"paths":{"/api/v1/agent/metrics":{"post":{"operationId":"postAgentMetrics","tags":["Agent"],"summary":"Post server metrics","security":[{"agentKey":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"os":{"type":"string","nullable":true},"kernelVersion":{"type":"string","nullable":true},"uptimeSeconds":{"type":"integer","nullable":true},"agentVersion":{"type":"string","nullable":true},"cpuModel":{"type":"string","nullable":true},"cpuMhz":{"type":"integer","nullable":true},"cpuThreads":{"type":"integer","nullable":true},"cpuUsagePercent":{"type":"number","minimum":0,"maximum":100},"cpuAvg1MinPercent":{"type":"number","nullable":true,"minimum":0,"maximum":100},"cpuCores":{"type":"integer","minimum":1},"loadAvg1":{"type":"number"},"loadAvg5":{"type":"number"},"loadAvg15":{"type":"number"},"memTotalMb":{"type":"number"},"memUsedMb":{"type":"number"},"memUsagePercent":{"type":"number","minimum":0,"maximum":100},"swapTotalMb":{"type":"number"},"swapUsedMb":{"type":"number"},"diskUsages":{"type":"array","items":{"type":"object","properties":{"mountpoint":{"type":"string"},"totalGb":{"type":"number"},"usedGb":{"type":"number"},"usagePercent":{"type":"number"},"filesystem":{"type":"string"}},"required":["mountpoint","totalGb","usedGb","usagePercent"]}},"networkInterfaces":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"rxBytes":{"type":"number"},"txBytes":{"type":"number"},"rxPackets":{"type":"number"},"txPackets":{"type":"number"},"addresses":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string","minLength":1,"maxLength":45},"family":{"type":"string","enum":["inet","inet6"]}},"required":["address"]}}},"required":["name","rxBytes","txBytes"]}},"diskHealth":{"type":"object","nullable":true,"properties":{"raidCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"smartCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"raids":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"level":{"type":"string"},"state":{"type":"string"},"devices":{"type":"array","items":{"type":"string"}},"degraded":{"type":"boolean"},"failedDevices":{"type":"array","items":{"type":"string"}}},"required":["name"]},"default":[]},"disks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"model":{"type":"string","nullable":true},"health":{"type":"string"},"temperatureC":{"type":"number","nullable":true}},"required":["name"]},"default":[]},"raidDegradedCount":{"type":"integer","minimum":0,"default":0},"diskUnhealthyCount":{"type":"integer","minimum":0,"default":0}}},"processCount":{"type":"integer"},"openFiles":{"type":"integer","nullable":true},"ioReadKbps":{"type":"number","nullable":true},"ioWriteKbps":{"type":"number","nullable":true},"topProcesses":{"type":"array","nullable":true,"items":{"type":"object","properties":{"pid":{"type":"integer"},"name":{"type":"string"},"cpuPercent":{"type":"number"},"memMb":{"type":"number"},"user":{"type":"string","nullable":true}},"required":["pid","name","cpuPercent","memMb"]}},"pendingUpdates":{"type":"integer","nullable":true,"minimum":0},"pendingSecurityUpdates":{"type":"integer","nullable":true,"minimum":0},"pendingPackages":{"type":"array","nullable":true,"items":{"type":"object","properties":{"name":{"type":"string"},"currentVersion":{"type":"string"},"newVersion":{"type":"string"},"security":{"type":"boolean"}},"required":["name","currentVersion","newVersion","security"]}},"serviceStatuses":{"type":"array","nullable":true,"items":{"type":"object","properties":{"serviceId":{"type":"string"},"status":{"type":"string","enum":["up","down"]},"error":{"type":"string","nullable":true}},"required":["serviceId","status"]}}},"required":["cpuUsagePercent","cpuCores","loadAvg1","loadAvg5","loadAvg15","memTotalMb","memUsedMb","memUsagePercent","swapTotalMb","swapUsedMb","diskUsages","networkInterfaces","processCount"]}}}},"responses":{"201":{"description":"Metric ingested","content":{"application/json":{"schema":{"type":"object","properties":{"metricId":{"type":"string"},"configChangedAt":{"type":"string"},"enableAutoUpdates":{"type":"boolean"},"commands":{"type":"array","items":{"type":"string"}}},"required":["metricId","configChangedAt","enableAutoUpdates","commands"]}}}},"400":{"description":"Validation error"}}}},"/api/v1/agent/config":{"get":{"operationId":"getAgentConfig","tags":["Agent"],"summary":"Get agent config","security":[{"agentKey":[]}],"responses":{"200":{"description":"Agent configuration","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"config":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"serverId":{"type":"string"},"timezone":{"type":"string","nullable":true},"reportIntervalSeconds":{"type":"number"},"enableAutoUpdates":{"type":"boolean"},"locale":{"type":"string","nullable":true},"updatedAt":{"type":"string"}},"required":["id","serverId","timezone","reportIntervalSeconds","enableAutoUpdates","locale","updatedAt"]},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"port":{"type":"number","nullable":true},"protocol":{"type":"string","nullable":true}},"required":["id","name","port","protocol"]}}},"required":["config","services"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/agent/heartbeat":{"post":{"operationId":"postAgentHeartbeat","tags":["Agent"],"summary":"Agent heartbeat","security":[{"agentKey":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"uptimeSeconds":{"type":"integer"},"agentVersion":{"type":"string"}}}}}},"responses":{"200":{"description":"Heartbeat acknowledged","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}},"400":{"description":"Validation error"}}}},"/api/v1/agent/ports":{"post":{"operationId":"postDiscoveredPorts","tags":["Agent"],"summary":"Report discovered open ports","security":[{"agentKey":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"ports":{"type":"array","items":{"type":"object","properties":{"port":{"type":"integer","minimum":1,"maximum":65535},"protocol":{"type":"string","maxLength":10}},"required":["port","protocol"]},"maxItems":1000}},"required":["ports"]}}}},"responses":{"200":{"description":"Stored","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/servers":{"get":{"operationId":"listServers","tags":["Servers"],"summary":"List all servers","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","description":"Comma-separated list of tags to filter by"},"required":false,"description":"Comma-separated list of tags to filter by","name":"tags","in":"query"}],"responses":{"200":{"description":"Paginated server list","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"hostname":{"type":"string"},"ipAddress":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"countryCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"apiKeyPrefix":{"type":"string"},"status":{"type":"string","enum":["PENDING","ONLINE","OFFLINE","WARNING","CRITICAL"]},"lastSeenAt":{"type":"string","nullable":true},"offlineSince":{"type":"string","nullable":true},"os":{"type":"string","nullable":true},"kernelVersion":{"type":"string","nullable":true},"uptimeSeconds":{"type":"number","nullable":true},"agentVersion":{"type":"string","nullable":true},"cpuModel":{"type":"string","nullable":true},"cpuMhz":{"type":"number","nullable":true},"cpuThreads":{"type":"number","nullable":true},"environment":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"maintenanceMode":{"type":"boolean"},"discoveredInterfaces":{"type":"array","nullable":true,"items":{"type":"object","properties":{"name":{"type":"string"},"addresses":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"family":{"type":"string","enum":["inet","inet6"]}},"required":["address"]}}},"required":["name","addresses"]}},"diskHealth":{"type":"object","nullable":true,"properties":{"raidCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"smartCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"raids":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"level":{"type":"string"},"state":{"type":"string"},"devices":{"type":"array","items":{"type":"string"}},"degraded":{"type":"boolean"},"failedDevices":{"type":"array","items":{"type":"string"}}},"required":["name"]}},"disks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"model":{"type":"string","nullable":true},"health":{"type":"string"},"temperatureC":{"type":"number","nullable":true}},"required":["name"]}},"raidDegradedCount":{"type":"number"},"diskUnhealthyCount":{"type":"number"}},"required":["raids","disks","raidDegradedCount","diskUnhealthyCount"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","nullable":true}},"required":["id","name","color"]}}},"required":["id","orgId","name","hostname","ipAddress","country","countryCode","city","apiKeyPrefix","status","lastSeenAt","offlineSince","os","kernelVersion","uptimeSeconds","agentVersion","cpuModel","cpuMhz","cpuThreads","environment","tags","maintenanceMode","createdAt","updatedAt"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"operationId":"createServer","tags":["Servers"],"summary":"Create a server","description":"Returns the plain-text API key once -- store it securely.","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"hostname":{"type":"string","minLength":1,"maxLength":255},"ipAddress":{"anyOf":[{"type":"string","format":"ip"},{"type":"string","format":"ip"}]},"environment":{"type":"string","maxLength":50},"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":30},"maxItems":4}},"required":["name","hostname"]}}}},"responses":{"201":{"description":"Server created","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"hostname":{"type":"string"},"ipAddress":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"countryCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"apiKeyPrefix":{"type":"string"},"status":{"type":"string","enum":["PENDING","ONLINE","OFFLINE","WARNING","CRITICAL"]},"lastSeenAt":{"type":"string","nullable":true},"offlineSince":{"type":"string","nullable":true},"os":{"type":"string","nullable":true},"kernelVersion":{"type":"string","nullable":true},"uptimeSeconds":{"type":"number","nullable":true},"agentVersion":{"type":"string","nullable":true},"cpuModel":{"type":"string","nullable":true},"cpuMhz":{"type":"number","nullable":true},"cpuThreads":{"type":"number","nullable":true},"environment":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"maintenanceMode":{"type":"boolean"},"discoveredInterfaces":{"type":"array","nullable":true,"items":{"type":"object","properties":{"name":{"type":"string"},"addresses":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"family":{"type":"string","enum":["inet","inet6"]}},"required":["address"]}}},"required":["name","addresses"]}},"diskHealth":{"type":"object","nullable":true,"properties":{"raidCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"smartCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"raids":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"level":{"type":"string"},"state":{"type":"string"},"devices":{"type":"array","items":{"type":"string"}},"degraded":{"type":"boolean"},"failedDevices":{"type":"array","items":{"type":"string"}}},"required":["name"]}},"disks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"model":{"type":"string","nullable":true},"health":{"type":"string"},"temperatureC":{"type":"number","nullable":true}},"required":["name"]}},"raidDegradedCount":{"type":"number"},"diskUnhealthyCount":{"type":"number"}},"required":["raids","disks","raidDegradedCount","diskUnhealthyCount"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","nullable":true}},"required":["id","name","color"]}},"apiKey":{"type":"string"}},"required":["id","orgId","name","hostname","ipAddress","country","countryCode","city","apiKeyPrefix","status","lastSeenAt","offlineSince","os","kernelVersion","uptimeSeconds","agentVersion","cpuModel","cpuMhz","cpuThreads","environment","tags","maintenanceMode","createdAt","updatedAt","apiKey"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Validation error"},"403":{"description":"Plan limit reached"}}}},"/api/v1/servers/{id}":{"get":{"operationId":"getServer","tags":["Servers"],"summary":"Get a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Server with latest metric","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"hostname":{"type":"string"},"ipAddress":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"countryCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"apiKeyPrefix":{"type":"string"},"status":{"type":"string","enum":["PENDING","ONLINE","OFFLINE","WARNING","CRITICAL"]},"lastSeenAt":{"type":"string","nullable":true},"offlineSince":{"type":"string","nullable":true},"os":{"type":"string","nullable":true},"kernelVersion":{"type":"string","nullable":true},"uptimeSeconds":{"type":"number","nullable":true},"agentVersion":{"type":"string","nullable":true},"cpuModel":{"type":"string","nullable":true},"cpuMhz":{"type":"number","nullable":true},"cpuThreads":{"type":"number","nullable":true},"environment":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"maintenanceMode":{"type":"boolean"},"discoveredInterfaces":{"type":"array","nullable":true,"items":{"type":"object","properties":{"name":{"type":"string"},"addresses":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"family":{"type":"string","enum":["inet","inet6"]}},"required":["address"]}}},"required":["name","addresses"]}},"diskHealth":{"type":"object","nullable":true,"properties":{"raidCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"smartCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"raids":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"level":{"type":"string"},"state":{"type":"string"},"devices":{"type":"array","items":{"type":"string"}},"degraded":{"type":"boolean"},"failedDevices":{"type":"array","items":{"type":"string"}}},"required":["name"]}},"disks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"model":{"type":"string","nullable":true},"health":{"type":"string"},"temperatureC":{"type":"number","nullable":true}},"required":["name"]}},"raidDegradedCount":{"type":"number"},"diskUnhealthyCount":{"type":"number"}},"required":["raids","disks","raidDegradedCount","diskUnhealthyCount"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","nullable":true}},"required":["id","name","color"]}},"latestMetric":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"serverId":{"type":"string"},"timestamp":{"type":"string"},"cpuUsagePercent":{"type":"number"},"cpuCores":{"type":"number"},"loadAvg1":{"type":"number"},"loadAvg5":{"type":"number"},"loadAvg15":{"type":"number"},"memTotalMb":{"type":"number"},"memUsedMb":{"type":"number"},"memUsagePercent":{"type":"number"},"swapTotalMb":{"type":"number"},"swapUsedMb":{"type":"number"},"diskUsages":{"type":"array","items":{"type":"object","properties":{"mountpoint":{"type":"string"},"totalGb":{"type":"number"},"usedGb":{"type":"number"},"usagePercent":{"type":"number"},"filesystem":{"type":"string"}},"required":["mountpoint","totalGb","usedGb","usagePercent"]}},"networkInterfaces":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"rxBytes":{"type":"number"},"txBytes":{"type":"number"},"rxPackets":{"type":"number"},"txPackets":{"type":"number"},"addresses":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"family":{"type":"string","enum":["inet","inet6"]}},"required":["address"]}}},"required":["name","rxBytes","txBytes"]}},"diskHealth":{"type":"object","nullable":true,"properties":{"raidCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"smartCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"raids":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"level":{"type":"string"},"state":{"type":"string"},"devices":{"type":"array","items":{"type":"string"}},"degraded":{"type":"boolean"},"failedDevices":{"type":"array","items":{"type":"string"}}},"required":["name"]}},"disks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"model":{"type":"string","nullable":true},"health":{"type":"string"},"temperatureC":{"type":"number","nullable":true}},"required":["name"]}},"raidDegradedCount":{"type":"number"},"diskUnhealthyCount":{"type":"number"}},"required":["raids","disks","raidDegradedCount","diskUnhealthyCount"]},"processCount":{"type":"number"},"openFiles":{"type":"number","nullable":true},"ioReadKbps":{"type":"number","nullable":true},"ioWriteKbps":{"type":"number","nullable":true},"topProcesses":{"type":"array","nullable":true,"items":{"type":"object","properties":{"pid":{"type":"number"},"name":{"type":"string"},"cpuPercent":{"type":"number"},"memMb":{"type":"number"},"user":{"type":"string"}},"required":["pid","name","cpuPercent","memMb"]}},"pendingUpdates":{"type":"number","nullable":true},"pendingSecurityUpdates":{"type":"number","nullable":true},"pendingPackages":{"type":"array","nullable":true,"items":{"type":"object","properties":{"name":{"type":"string"},"currentVersion":{"type":"string"},"newVersion":{"type":"string"},"security":{"type":"boolean"}},"required":["name","currentVersion","newVersion","security"]}}},"required":["id","serverId","timestamp","cpuUsagePercent","cpuCores","loadAvg1","loadAvg5","loadAvg15","memTotalMb","memUsedMb","memUsagePercent","swapTotalMb","swapUsedMb","diskUsages","networkInterfaces","processCount","openFiles","ioReadKbps","ioWriteKbps","topProcesses","pendingUpdates","pendingSecurityUpdates","pendingPackages"]},"staleData":{"type":"boolean"}},"required":["id","orgId","name","hostname","ipAddress","country","countryCode","city","apiKeyPrefix","status","lastSeenAt","offlineSince","os","kernelVersion","uptimeSeconds","agentVersion","cpuModel","cpuMhz","cpuThreads","environment","tags","maintenanceMode","createdAt","updatedAt","latestMetric","staleData"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}},"patch":{"operationId":"updateServer","tags":["Servers"],"summary":"Update a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"hostname":{"type":"string","minLength":1,"maxLength":255},"ipAddress":{"anyOf":[{"type":"string","format":"ip"},{"type":"string","format":"ip"},{"nullable":true}]},"environment":{"type":"string","nullable":true,"maxLength":50},"tags":{"type":"array","nullable":true,"items":{"type":"string","minLength":1,"maxLength":30},"maxItems":4},"maintenanceMode":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Updated server","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"hostname":{"type":"string"},"ipAddress":{"type":"string","nullable":true},"country":{"type":"string","nullable":true},"countryCode":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"apiKeyPrefix":{"type":"string"},"status":{"type":"string","enum":["PENDING","ONLINE","OFFLINE","WARNING","CRITICAL"]},"lastSeenAt":{"type":"string","nullable":true},"offlineSince":{"type":"string","nullable":true},"os":{"type":"string","nullable":true},"kernelVersion":{"type":"string","nullable":true},"uptimeSeconds":{"type":"number","nullable":true},"agentVersion":{"type":"string","nullable":true},"cpuModel":{"type":"string","nullable":true},"cpuMhz":{"type":"number","nullable":true},"cpuThreads":{"type":"number","nullable":true},"environment":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"maintenanceMode":{"type":"boolean"},"discoveredInterfaces":{"type":"array","nullable":true,"items":{"type":"object","properties":{"name":{"type":"string"},"addresses":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"family":{"type":"string","enum":["inet","inet6"]}},"required":["address"]}}},"required":["name","addresses"]}},"diskHealth":{"type":"object","nullable":true,"properties":{"raidCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"smartCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"raids":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"level":{"type":"string"},"state":{"type":"string"},"devices":{"type":"array","items":{"type":"string"}},"degraded":{"type":"boolean"},"failedDevices":{"type":"array","items":{"type":"string"}}},"required":["name"]}},"disks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"model":{"type":"string","nullable":true},"health":{"type":"string"},"temperatureC":{"type":"number","nullable":true}},"required":["name"]}},"raidDegradedCount":{"type":"number"},"diskUnhealthyCount":{"type":"number"}},"required":["raids","disks","raidDegradedCount","diskUnhealthyCount"]},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"projects":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"color":{"type":"string","nullable":true}},"required":["id","name","color"]}}},"required":["id","orgId","name","hostname","ipAddress","country","countryCode","city","apiKeyPrefix","status","lastSeenAt","offlineSince","os","kernelVersion","uptimeSeconds","agentVersion","cpuModel","cpuMhz","cpuThreads","environment","tags","maintenanceMode","createdAt","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Validation error"},"404":{"description":"Server not found"}}},"delete":{"operationId":"deleteServer","tags":["Servers"],"summary":"Delete a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted (idempotent if already gone)","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"nullable":true}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"500":{"description":"Delete failed"}}}},"/api/v1/servers/{id}/regenerate-key":{"post":{"operationId":"regenerateServerKey","tags":["Servers"],"summary":"Rotate API key","description":"Invalidates the old key and returns a new plain-text key -- shown once only.","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"New API key","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"apiKey":{"type":"string"},"message":{"type":"string"}},"required":["apiKey","message"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/metrics":{"get":{"operationId":"getServerMetrics","tags":["Metrics"],"summary":"Get metrics for a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string","format":"date-time"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","enum":["raw","5m","1h","1d"],"default":"raw"},"required":false,"name":"interval","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":1000,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Paginated metric list","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"serverId":{"type":"string"},"timestamp":{"type":"string"},"cpuUsagePercent":{"type":"number"},"cpuCores":{"type":"number"},"loadAvg1":{"type":"number"},"loadAvg5":{"type":"number"},"loadAvg15":{"type":"number"},"memTotalMb":{"type":"number"},"memUsedMb":{"type":"number"},"memUsagePercent":{"type":"number"},"swapTotalMb":{"type":"number"},"swapUsedMb":{"type":"number"},"diskUsages":{"type":"array","items":{"type":"object","properties":{"mountpoint":{"type":"string"},"totalGb":{"type":"number"},"usedGb":{"type":"number"},"usagePercent":{"type":"number"},"filesystem":{"type":"string"}},"required":["mountpoint","totalGb","usedGb","usagePercent"]}},"networkInterfaces":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"rxBytes":{"type":"number"},"txBytes":{"type":"number"},"rxPackets":{"type":"number"},"txPackets":{"type":"number"},"addresses":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"family":{"type":"string","enum":["inet","inet6"]}},"required":["address"]}}},"required":["name","rxBytes","txBytes"]}},"diskHealth":{"type":"object","nullable":true,"properties":{"raidCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"smartCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"raids":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"level":{"type":"string"},"state":{"type":"string"},"devices":{"type":"array","items":{"type":"string"}},"degraded":{"type":"boolean"},"failedDevices":{"type":"array","items":{"type":"string"}}},"required":["name"]}},"disks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"model":{"type":"string","nullable":true},"health":{"type":"string"},"temperatureC":{"type":"number","nullable":true}},"required":["name"]}},"raidDegradedCount":{"type":"number"},"diskUnhealthyCount":{"type":"number"}},"required":["raids","disks","raidDegradedCount","diskUnhealthyCount"]},"processCount":{"type":"number"},"openFiles":{"type":"number","nullable":true},"ioReadKbps":{"type":"number","nullable":true},"ioWriteKbps":{"type":"number","nullable":true},"topProcesses":{"type":"array","nullable":true,"items":{"type":"object","properties":{"pid":{"type":"number"},"name":{"type":"string"},"cpuPercent":{"type":"number"},"memMb":{"type":"number"},"user":{"type":"string"}},"required":["pid","name","cpuPercent","memMb"]}},"pendingUpdates":{"type":"number","nullable":true},"pendingSecurityUpdates":{"type":"number","nullable":true},"pendingPackages":{"type":"array","nullable":true,"items":{"type":"object","properties":{"name":{"type":"string"},"currentVersion":{"type":"string"},"newVersion":{"type":"string"},"security":{"type":"boolean"}},"required":["name","currentVersion","newVersion","security"]}}},"required":["id","serverId","timestamp","cpuUsagePercent","cpuCores","loadAvg1","loadAvg5","loadAvg15","memTotalMb","memUsedMb","memUsagePercent","swapTotalMb","swapUsedMb","diskUsages","networkInterfaces","processCount","openFiles","ioReadKbps","ioWriteKbps","topProcesses","pendingUpdates","pendingSecurityUpdates","pendingPackages"]}},"nextCursor":{"type":"string"}},"required":["items"]}}}},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/metrics/latest":{"get":{"operationId":"getLatestServerMetric","tags":["Metrics"],"summary":"Get the latest metric for a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Latest metric","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"serverId":{"type":"string"},"timestamp":{"type":"string"},"cpuUsagePercent":{"type":"number"},"cpuCores":{"type":"number"},"loadAvg1":{"type":"number"},"loadAvg5":{"type":"number"},"loadAvg15":{"type":"number"},"memTotalMb":{"type":"number"},"memUsedMb":{"type":"number"},"memUsagePercent":{"type":"number"},"swapTotalMb":{"type":"number"},"swapUsedMb":{"type":"number"},"diskUsages":{"type":"array","items":{"type":"object","properties":{"mountpoint":{"type":"string"},"totalGb":{"type":"number"},"usedGb":{"type":"number"},"usagePercent":{"type":"number"},"filesystem":{"type":"string"}},"required":["mountpoint","totalGb","usedGb","usagePercent"]}},"networkInterfaces":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"rxBytes":{"type":"number"},"txBytes":{"type":"number"},"rxPackets":{"type":"number"},"txPackets":{"type":"number"},"addresses":{"type":"array","items":{"type":"object","properties":{"address":{"type":"string"},"family":{"type":"string","enum":["inet","inet6"]}},"required":["address"]}}},"required":["name","rxBytes","txBytes"]}},"diskHealth":{"type":"object","nullable":true,"properties":{"raidCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"smartCheckStatus":{"type":"string","enum":["collected","unavailable","error"]},"raids":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"level":{"type":"string"},"state":{"type":"string"},"devices":{"type":"array","items":{"type":"string"}},"degraded":{"type":"boolean"},"failedDevices":{"type":"array","items":{"type":"string"}}},"required":["name"]}},"disks":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"model":{"type":"string","nullable":true},"health":{"type":"string"},"temperatureC":{"type":"number","nullable":true}},"required":["name"]}},"raidDegradedCount":{"type":"number"},"diskUnhealthyCount":{"type":"number"}},"required":["raids","disks","raidDegradedCount","diskUnhealthyCount"]},"processCount":{"type":"number"},"openFiles":{"type":"number","nullable":true},"ioReadKbps":{"type":"number","nullable":true},"ioWriteKbps":{"type":"number","nullable":true},"topProcesses":{"type":"array","nullable":true,"items":{"type":"object","properties":{"pid":{"type":"number"},"name":{"type":"string"},"cpuPercent":{"type":"number"},"memMb":{"type":"number"},"user":{"type":"string"}},"required":["pid","name","cpuPercent","memMb"]}},"pendingUpdates":{"type":"number","nullable":true},"pendingSecurityUpdates":{"type":"number","nullable":true},"pendingPackages":{"type":"array","nullable":true,"items":{"type":"object","properties":{"name":{"type":"string"},"currentVersion":{"type":"string"},"newVersion":{"type":"string"},"security":{"type":"boolean"}},"required":["name","currentVersion","newVersion","security"]}}},"required":["id","serverId","timestamp","cpuUsagePercent","cpuCores","loadAvg1","loadAvg5","loadAvg15","memTotalMb","memUsedMb","memUsagePercent","swapTotalMb","swapUsedMb","diskUsages","networkInterfaces","processCount","openFiles","ioReadKbps","ioWriteKbps","topProcesses","pendingUpdates","pendingSecurityUpdates","pendingPackages"]}}}},"404":{"description":"Server or metric not found"}}}},"/api/v1/servers/{id}/metrics/uptime":{"get":{"operationId":"getServerUptime","tags":["Metrics"],"summary":"Get uptime stats for a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["24h","7d","30d","90d"]},"required":false,"name":"period","in":"query"}],"responses":{"200":{"description":"Uptime statistics","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"period":{"type":"string","enum":["24h","7d","30d","90d"]},"uptimePercent":{"type":"number"},"downtimeMs":{"type":"number"},"totalMs":{"type":"number"},"incidents":{"type":"array","items":{"type":"object","properties":{"alertId":{"type":"string"},"startedAt":{"type":"string"},"resolvedAt":{"type":"string","nullable":true},"durationMs":{"type":"number"}},"required":["alertId","startedAt","resolvedAt","durationMs"]}}},"required":["period","uptimePercent","downtimeMs","totalMs","incidents"]},{"type":"object","properties":{"24h":{"type":"object","properties":{"period":{"type":"string","enum":["24h","7d","30d","90d"]},"uptimePercent":{"type":"number"},"downtimeMs":{"type":"number"},"totalMs":{"type":"number"},"incidents":{"type":"array","items":{"type":"object","properties":{"alertId":{"type":"string"},"startedAt":{"type":"string"},"resolvedAt":{"type":"string","nullable":true},"durationMs":{"type":"number"}},"required":["alertId","startedAt","resolvedAt","durationMs"]}}},"required":["period","uptimePercent","downtimeMs","totalMs","incidents"]},"7d":{"type":"object","properties":{"period":{"type":"string","enum":["24h","7d","30d","90d"]},"uptimePercent":{"type":"number"},"downtimeMs":{"type":"number"},"totalMs":{"type":"number"},"incidents":{"type":"array","items":{"type":"object","properties":{"alertId":{"type":"string"},"startedAt":{"type":"string"},"resolvedAt":{"type":"string","nullable":true},"durationMs":{"type":"number"}},"required":["alertId","startedAt","resolvedAt","durationMs"]}}},"required":["period","uptimePercent","downtimeMs","totalMs","incidents"]},"30d":{"type":"object","properties":{"period":{"type":"string","enum":["24h","7d","30d","90d"]},"uptimePercent":{"type":"number"},"downtimeMs":{"type":"number"},"totalMs":{"type":"number"},"incidents":{"type":"array","items":{"type":"object","properties":{"alertId":{"type":"string"},"startedAt":{"type":"string"},"resolvedAt":{"type":"string","nullable":true},"durationMs":{"type":"number"}},"required":["alertId","startedAt","resolvedAt","durationMs"]}}},"required":["period","uptimePercent","downtimeMs","totalMs","incidents"]},"90d":{"type":"object","properties":{"period":{"type":"string","enum":["24h","7d","30d","90d"]},"uptimePercent":{"type":"number"},"downtimeMs":{"type":"number"},"totalMs":{"type":"number"},"incidents":{"type":"array","items":{"type":"object","properties":{"alertId":{"type":"string"},"startedAt":{"type":"string"},"resolvedAt":{"type":"string","nullable":true},"durationMs":{"type":"number"}},"required":["alertId","startedAt","resolvedAt","durationMs"]}}},"required":["period","uptimePercent","downtimeMs","totalMs","incidents"]}}}]}}}},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/config":{"get":{"operationId":"getServerConfig","tags":["Server Config"],"summary":"Get server configuration","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Server config","content":{"application/json":{"schema":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"serverId":{"type":"string"},"timezone":{"type":"string","nullable":true},"reportIntervalSeconds":{"type":"number"},"enableAutoUpdates":{"type":"boolean"},"locale":{"type":"string","nullable":true},"updatedAt":{"type":"string"}},"required":["id","serverId","timezone","reportIntervalSeconds","enableAutoUpdates","locale","updatedAt"]}}}},"404":{"description":"Server not found"}}},"put":{"operationId":"updateServerConfig","tags":["Server Config"],"summary":"Update server configuration","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"timezone":{"type":"string","nullable":true},"reportIntervalSeconds":{"type":"integer","minimum":10,"maximum":3600},"enableAutoUpdates":{"type":"boolean"},"locale":{"type":"string","nullable":true}}}}}},"responses":{"200":{"description":"Updated config","content":{"application/json":{"schema":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"serverId":{"type":"string"},"timezone":{"type":"string","nullable":true},"reportIntervalSeconds":{"type":"number"},"enableAutoUpdates":{"type":"boolean"},"locale":{"type":"string","nullable":true},"updatedAt":{"type":"string"}},"required":["id","serverId","timezone","reportIntervalSeconds","enableAutoUpdates","locale","updatedAt"]}}}},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/alerts":{"get":{"operationId":"listServerAlerts","tags":["Alerts"],"summary":"List alerts for a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["true","false","all"],"default":"false"},"required":false,"name":"resolved","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Paginated alert list","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"serverId":{"type":"string"},"ruleId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"type":{"type":"string","enum":["CPU_HIGH","MEMORY_HIGH","DISK_HIGH","OFFLINE","SWAP_HIGH","LOAD_HIGH","IO_HIGH","PROCESS_HIGH","CUSTOM","SERVICE_DOWN","RAID_DEGRADED","DISK_FAILING"]},"severity":{"type":"string","enum":["WARNING","CRITICAL"]},"message":{"type":"string"},"resolved":{"type":"boolean"},"resolvedAt":{"type":"string","nullable":true},"escalatedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","serverId","ruleId","serviceId","type","severity","message","resolved","resolvedAt","createdAt"]}},"nextCursor":{"type":"string"}},"required":["items"]}}}},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/alerts/{alertId}":{"patch":{"operationId":"resolveAlert","tags":["Alerts"],"summary":"Resolve an alert","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"alertId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"resolved":{"type":"boolean"}},"required":["resolved"]}}}},"responses":{"200":{"description":"Alert resolved","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"serverId":{"type":"string"},"ruleId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"type":{"type":"string","enum":["CPU_HIGH","MEMORY_HIGH","DISK_HIGH","OFFLINE","SWAP_HIGH","LOAD_HIGH","IO_HIGH","PROCESS_HIGH","CUSTOM","SERVICE_DOWN","RAID_DEGRADED","DISK_FAILING"]},"severity":{"type":"string","enum":["WARNING","CRITICAL"]},"message":{"type":"string"},"resolved":{"type":"boolean"},"resolvedAt":{"type":"string","nullable":true},"escalatedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","serverId","ruleId","serviceId","type","severity","message","resolved","resolvedAt","createdAt"]}}}},"400":{"description":"Invalid request"},"404":{"description":"Alert not found"}}}},"/api/v1/servers/{id}/alerts/resolve-all":{"post":{"operationId":"resolveAllServerAlerts","tags":["Alerts"],"summary":"Resolve all active alerts for a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Alerts resolved","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/timeline":{"get":{"operationId":"getServerTimeline","tags":["Servers"],"summary":"Get server incident timeline","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Chronological timeline of alerts and maintenance events","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["alert_fired","alert_resolved","alert_escalated","maintenance_scheduled"]},"timestamp":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"severity":{"type":"string"},"meta":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","type","timestamp","title"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/maintenance":{"get":{"operationId":"listServerMaintenanceWindows","tags":["Server Maintenance"],"summary":"List maintenance windows for a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"active","in":"query"}],"responses":{"200":{"description":"Paginated windows","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"targetType":{"type":"string","enum":["SERVER","WEBSITE"]},"monitorId":{"type":"string","nullable":true},"id":{"type":"string"},"orgId":{"type":"string"},"serverId":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"startAt":{"type":"string","nullable":true},"endAt":{"type":"string","nullable":true},"isRecurring":{"type":"boolean"},"recurrenceDays":{"type":"array","items":{"type":"number"}},"recurrenceStart":{"type":"string","nullable":true},"recurrenceEnd":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"recurrenceEndsAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["targetType","monitorId","id","orgId","serverId","name","description","startAt","endAt","isRecurring","recurrenceDays","recurrenceStart","recurrenceEnd","timezone","recurrenceEndsAt","createdAt"]}},"nextCursor":{"type":"string"}},"required":["items"]}}}},"404":{"description":"Server not found"}}},"post":{"operationId":"createServerMaintenanceWindow","tags":["Server Maintenance"],"summary":"Create a maintenance window for a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"targetType":{"type":"string","enum":["SERVER","WEBSITE"],"default":"SERVER"},"monitorId":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500},"serverId":{"type":"string","nullable":true,"format":"uuid"},"isRecurring":{"type":"boolean"},"startAt":{"type":"string","format":"date-time"},"endAt":{"type":"string","format":"date-time"},"recurrenceDays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"recurrenceStart":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"recurrenceEnd":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string"},"recurrenceEndsAt":{"type":"string","format":"date-time"}},"required":["name"]}}}},"responses":{"201":{"description":"Window created","content":{"application/json":{"schema":{"type":"object","properties":{"targetType":{"type":"string","enum":["SERVER","WEBSITE"]},"monitorId":{"type":"string","nullable":true},"id":{"type":"string"},"orgId":{"type":"string"},"serverId":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"startAt":{"type":"string","nullable":true},"endAt":{"type":"string","nullable":true},"isRecurring":{"type":"boolean"},"recurrenceDays":{"type":"array","items":{"type":"number"}},"recurrenceStart":{"type":"string","nullable":true},"recurrenceEnd":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"recurrenceEndsAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["targetType","monitorId","id","orgId","serverId","name","description","startAt","endAt","isRecurring","recurrenceDays","recurrenceStart","recurrenceEnd","timezone","recurrenceEndsAt","createdAt"]}}}},"400":{"description":"Validation error"},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/maintenance/{windowId}":{"patch":{"operationId":"updateServerMaintenanceWindow","tags":["Server Maintenance"],"summary":"Update a server maintenance window","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"windowId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"targetType":{"type":"string","enum":["SERVER","WEBSITE"]},"monitorId":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","nullable":true,"maxLength":500},"serverId":{"type":"string","nullable":true,"format":"uuid"},"isRecurring":{"type":"boolean"},"startAt":{"type":"string","nullable":true,"format":"date-time"},"endAt":{"type":"string","nullable":true,"format":"date-time"},"recurrenceDays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"recurrenceStart":{"type":"string","nullable":true,"pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"recurrenceEnd":{"type":"string","nullable":true,"pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string","nullable":true},"recurrenceEndsAt":{"type":"string","nullable":true,"format":"date-time"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"targetType":{"type":"string","enum":["SERVER","WEBSITE"]},"monitorId":{"type":"string","nullable":true},"id":{"type":"string"},"orgId":{"type":"string"},"serverId":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"startAt":{"type":"string","nullable":true},"endAt":{"type":"string","nullable":true},"isRecurring":{"type":"boolean"},"recurrenceDays":{"type":"array","items":{"type":"number"}},"recurrenceStart":{"type":"string","nullable":true},"recurrenceEnd":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"recurrenceEndsAt":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["targetType","monitorId","id","orgId","serverId","name","description","startAt","endAt","isRecurring","recurrenceDays","recurrenceStart","recurrenceEnd","timezone","recurrenceEndsAt","createdAt"]}}}},"400":{"description":"Validation error"},"404":{"description":"Maintenance window not found"}}},"delete":{"operationId":"deleteServerMaintenanceWindow","tags":["Server Maintenance"],"summary":"Delete a server maintenance window","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"windowId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"nullable":true}}}},"404":{"description":"Maintenance window not found"}}}},"/api/v1/alerts":{"get":{"operationId":"listAlerts","tags":["Alerts"],"summary":"List all alerts for the organisation","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["true","false","all"],"default":"false"},"required":false,"name":"resolved","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Paginated alert list","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"serverId":{"type":"string"},"ruleId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"type":{"type":"string","enum":["CPU_HIGH","MEMORY_HIGH","DISK_HIGH","OFFLINE","SWAP_HIGH","LOAD_HIGH","IO_HIGH","PROCESS_HIGH","CUSTOM","SERVICE_DOWN","RAID_DEGRADED","DISK_FAILING"]},"severity":{"type":"string","enum":["WARNING","CRITICAL"]},"message":{"type":"string"},"resolved":{"type":"boolean"},"resolvedAt":{"type":"string","nullable":true},"escalatedAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"server":{"type":"object","nullable":true,"properties":{"name":{"type":"string"}},"required":["name"]},"rule":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"metricField":{"type":"string"}},"required":["id","name","metricField"]}},"required":["id","serverId","ruleId","serviceId","type","severity","message","resolved","resolvedAt","createdAt","server","rule"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/alert-rules":{"get":{"operationId":"listAlertRules","tags":["Alert Rules"],"summary":"List alert rules","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Paginated alert rules","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"serverId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"metricField":{"type":"string"},"operator":{"type":"string","enum":["GT","LT","GTE","LTE","EQ"]},"threshold":{"type":"number"},"severity":{"type":"string","enum":["WARNING","CRITICAL"]},"evaluationWindowMinutes":{"type":"number"},"repeatEveryMinutes":{"type":"number"},"escalationChannelId":{"type":"string","nullable":true},"escalationAfterMinutes":{"type":"number"},"escalationChannel":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"required":["id","name","type"]},"enabled":{"type":"boolean"},"lastTriggeredAt":{"type":"string","nullable":true},"lastNotifiedAt":{"type":"string","nullable":true},"breachStartedAt":{"type":"string","nullable":true},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"channel":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]}},"required":["channelId","channel"]}},"serverAssignments":{"type":"array","items":{"type":"object","properties":{"serverId":{"type":"string"},"server":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["serverId","server"]}}},"required":["id","orgId","serverId","name","metricField","operator","threshold","severity","evaluationWindowMinutes","repeatEveryMinutes","enabled","lastTriggeredAt","lastNotifiedAt","breachStartedAt","channels","serverAssignments"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"operationId":"createAlertRule","tags":["Alert Rules"],"summary":"Create an alert rule","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"serverId":{"type":"string","format":"uuid"},"serverIds":{"type":"array","items":{"type":"string","format":"uuid"}},"name":{"type":"string","minLength":1,"maxLength":100},"metricField":{"type":"string","minLength":1},"operator":{"type":"string","enum":["GT","LT","GTE","LTE","EQ"]},"threshold":{"type":"number"},"severity":{"type":"string","enum":["WARNING","CRITICAL"]},"evaluationWindowMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":5},"repeatEveryMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid"},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["name","metricField","operator","threshold","severity"]}}}},"responses":{"201":{"description":"Alert rule created","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"serverId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"metricField":{"type":"string"},"operator":{"type":"string","enum":["GT","LT","GTE","LTE","EQ"]},"threshold":{"type":"number"},"severity":{"type":"string","enum":["WARNING","CRITICAL"]},"evaluationWindowMinutes":{"type":"number"},"repeatEveryMinutes":{"type":"number"},"escalationChannelId":{"type":"string","nullable":true},"escalationAfterMinutes":{"type":"number"},"escalationChannel":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"required":["id","name","type"]},"enabled":{"type":"boolean"},"lastTriggeredAt":{"type":"string","nullable":true},"lastNotifiedAt":{"type":"string","nullable":true},"breachStartedAt":{"type":"string","nullable":true},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"channel":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]}},"required":["channelId","channel"]}},"serverAssignments":{"type":"array","items":{"type":"object","properties":{"serverId":{"type":"string"},"server":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["serverId","server"]}}},"required":["id","orgId","serverId","name","metricField","operator","threshold","severity","evaluationWindowMinutes","repeatEveryMinutes","enabled","lastTriggeredAt","lastNotifiedAt","breachStartedAt","channels","serverAssignments"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"403":{"description":"Plan limit reached"}}}},"/api/v1/alert-rules/{id}":{"get":{"operationId":"getAlertRule","tags":["Alert Rules"],"summary":"Get an alert rule","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Alert rule","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"serverId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"metricField":{"type":"string"},"operator":{"type":"string","enum":["GT","LT","GTE","LTE","EQ"]},"threshold":{"type":"number"},"severity":{"type":"string","enum":["WARNING","CRITICAL"]},"evaluationWindowMinutes":{"type":"number"},"repeatEveryMinutes":{"type":"number"},"escalationChannelId":{"type":"string","nullable":true},"escalationAfterMinutes":{"type":"number"},"escalationChannel":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"required":["id","name","type"]},"enabled":{"type":"boolean"},"lastTriggeredAt":{"type":"string","nullable":true},"lastNotifiedAt":{"type":"string","nullable":true},"breachStartedAt":{"type":"string","nullable":true},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"channel":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]}},"required":["channelId","channel"]}},"serverAssignments":{"type":"array","items":{"type":"object","properties":{"serverId":{"type":"string"},"server":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["serverId","server"]}}},"required":["id","orgId","serverId","name","metricField","operator","threshold","severity","evaluationWindowMinutes","repeatEveryMinutes","enabled","lastTriggeredAt","lastNotifiedAt","breachStartedAt","channels","serverAssignments"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Alert rule not found"}}},"patch":{"operationId":"updateAlertRule","tags":["Alert Rules"],"summary":"Update an alert rule","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"serverId":{"type":"string","format":"uuid"},"serverIds":{"type":"array","items":{"type":"string","format":"uuid"}},"name":{"type":"string","minLength":1,"maxLength":100},"metricField":{"type":"string","minLength":1},"operator":{"type":"string","enum":["GT","LT","GTE","LTE","EQ"]},"threshold":{"type":"number"},"severity":{"type":"string","enum":["WARNING","CRITICAL"]},"evaluationWindowMinutes":{"type":"integer","minimum":0,"maximum":1440},"repeatEveryMinutes":{"type":"integer","minimum":0,"maximum":1440},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid"},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440},"enabled":{"type":"boolean"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"}}}}}}},"responses":{"200":{"description":"Updated rule","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"serverId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"metricField":{"type":"string"},"operator":{"type":"string","enum":["GT","LT","GTE","LTE","EQ"]},"threshold":{"type":"number"},"severity":{"type":"string","enum":["WARNING","CRITICAL"]},"evaluationWindowMinutes":{"type":"number"},"repeatEveryMinutes":{"type":"number"},"escalationChannelId":{"type":"string","nullable":true},"escalationAfterMinutes":{"type":"number"},"escalationChannel":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"required":["id","name","type"]},"enabled":{"type":"boolean"},"lastTriggeredAt":{"type":"string","nullable":true},"lastNotifiedAt":{"type":"string","nullable":true},"breachStartedAt":{"type":"string","nullable":true},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"channel":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]}},"required":["channelId","channel"]}},"serverAssignments":{"type":"array","items":{"type":"object","properties":{"serverId":{"type":"string"},"server":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["serverId","server"]}}},"required":["id","orgId","serverId","name","metricField","operator","threshold","severity","evaluationWindowMinutes","repeatEveryMinutes","enabled","lastTriggeredAt","lastNotifiedAt","breachStartedAt","channels","serverAssignments"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Alert rule not found"}}},"delete":{"operationId":"deleteAlertRule","tags":["Alert Rules"],"summary":"Delete an alert rule","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"nullable":true}}}},"404":{"description":"Alert rule not found"}}}},"/api/v1/notification-channels":{"get":{"operationId":"listNotificationChannels","tags":["Notification Channels"],"summary":"List notification channels","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Paginated channels","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["EMAIL","WEBHOOK","TELEGRAM","SLACK","DISCORD","NTFY","TEAMS","PAGERDUTY","OPSGENIE","SEVEN_VOICE"]},"config":{"nullable":true},"enabled":{"type":"boolean"},"maxAlertsPerHour":{"type":"number"},"voiceVerified":{"type":"boolean"},"_count":{"type":"object","properties":{"ruleAssignments":{"type":"number"}},"required":["ruleAssignments"]}},"required":["id","orgId","name","type","enabled","maxAlertsPerHour","_count"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"operationId":"createNotificationChannel","tags":["Notification Channels"],"summary":"Create a notification channel","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["EMAIL","WEBHOOK","TELEGRAM","SLACK","DISCORD","NTFY","TEAMS","PAGERDUTY","OPSGENIE","SEVEN_VOICE"]},"config":{"type":"object","additionalProperties":{"nullable":true}},"enabled":{"type":"boolean","default":true},"maxAlertsPerHour":{"type":"integer","minimum":0,"maximum":3600,"default":60}},"required":["name","type","config"]}}}},"responses":{"201":{"description":"Channel created","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["EMAIL","WEBHOOK","TELEGRAM","SLACK","DISCORD","NTFY","TEAMS","PAGERDUTY","OPSGENIE","SEVEN_VOICE"]},"config":{"nullable":true},"enabled":{"type":"boolean"},"maxAlertsPerHour":{"type":"number"},"voiceVerified":{"type":"boolean"}},"required":["id","orgId","name","type","enabled","maxAlertsPerHour"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid notification configuration"},"403":{"description":"Plan limit reached"}}}},"/api/v1/notification-channels/{id}":{"get":{"operationId":"getNotificationChannel","tags":["Notification Channels"],"summary":"Get a notification channel","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Channel","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["EMAIL","WEBHOOK","TELEGRAM","SLACK","DISCORD","NTFY","TEAMS","PAGERDUTY","OPSGENIE","SEVEN_VOICE"]},"config":{"nullable":true},"enabled":{"type":"boolean"},"maxAlertsPerHour":{"type":"number"},"voiceVerified":{"type":"boolean"},"ruleAssignments":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"rule":{"type":"object","properties":{"name":{"type":"string","nullable":true},"metricField":{"type":"string"}},"required":["name","metricField"]}},"required":["ruleId","rule"]}}},"required":["id","orgId","name","type","enabled","maxAlertsPerHour","ruleAssignments"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Channel not found"}}},"patch":{"operationId":"updateNotificationChannel","tags":["Notification Channels"],"summary":"Update a notification channel","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","enum":["EMAIL","WEBHOOK","TELEGRAM","SLACK","DISCORD","NTFY","TEAMS","PAGERDUTY","OPSGENIE","SEVEN_VOICE"]},"config":{"type":"object","additionalProperties":{"nullable":true}},"enabled":{"type":"boolean"},"maxAlertsPerHour":{"type":"integer","minimum":0,"maximum":3600}}}}}},"responses":{"200":{"description":"Updated channel","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["EMAIL","WEBHOOK","TELEGRAM","SLACK","DISCORD","NTFY","TEAMS","PAGERDUTY","OPSGENIE","SEVEN_VOICE"]},"config":{"nullable":true},"enabled":{"type":"boolean"},"maxAlertsPerHour":{"type":"number"},"voiceVerified":{"type":"boolean"},"ruleAssignments":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"rule":{"type":"object","properties":{"name":{"type":"string","nullable":true},"metricField":{"type":"string"}},"required":["name","metricField"]}},"required":["ruleId","rule"]}}},"required":["id","orgId","name","type","enabled","maxAlertsPerHour","ruleAssignments"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid notification configuration"},"403":{"description":"Telephone not included in plan"},"404":{"description":"Channel not found"}}},"delete":{"operationId":"deleteNotificationChannel","tags":["Notification Channels"],"summary":"Delete a notification channel","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"nullable":true}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Channel not found"}}}},"/api/v1/notification-channels/{id}/test":{"post":{"operationId":"testNotificationChannel","tags":["Notification Channels"],"summary":"Send a test message to a notification channel","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["true"]},"required":false,"name":"confirmVoiceCall","in":"query"}],"responses":{"200":{"description":"Test message sent successfully","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Channel is disabled"},"403":{"description":"Telephone not included in plan"},"404":{"description":"Channel not found"},"429":{"description":"Voice call safety limit reached"},"502":{"description":"Notification delivery failed"}}}},"/api/v1/notification-channels/{id}/voice-verification":{"post":{"operationId":"requestVoiceVerification","tags":["Notification Channels"],"summary":"Request a paid recipient verification call","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["true"]},"required":true,"name":"confirmVoiceCall","in":"query"}],"responses":{"200":{"description":"Provider accepted verification call","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid channel"},"403":{"description":"Telephone not included in plan"},"404":{"description":"Channel not found"},"429":{"description":"Verification already active or safety limit reached"},"502":{"description":"Provider rejected verification call"}}}},"/api/v1/notification-channels/{id}/voice-verification/confirm":{"post":{"operationId":"confirmVoiceVerification","tags":["Notification Channels"],"summary":"Confirm a recipient using the spoken code","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","pattern":"^\\d{6}$"}},"required":["code"]}}}},"responses":{"200":{"description":"Recipient verified","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"verified":{"type":"boolean"}},"required":["verified"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid or expired code"},"403":{"description":"Telephone not included in plan"},"404":{"description":"Channel not found"}}}},"/api/v1/notification-channels/{id}/logs":{"get":{"operationId":"listNotificationLogs","tags":["Notification Channels"],"summary":"List delivery log for a notification channel","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Paginated notification logs","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"channelId":{"type":"string"},"alertId":{"type":"string","nullable":true},"orgId":{"type":"string"},"event":{"type":"string"},"status":{"type":"string","enum":["SENT","THROTTLED","FAILED"]},"error":{"type":"string","nullable":true},"sentAt":{"type":"string"}},"required":["id","channelId","alertId","orgId","event","status","error","sentAt"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Channel not found"}}}},"/api/v1/dashboard/overview":{"get":{"operationId":"getDashboardOverview","tags":["Dashboard"],"summary":"Overview stats","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Aggregated stats","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"latestAgentVersion":{"type":"string"},"servers":{"type":"object","properties":{"total":{"type":"number"},"byStatus":{"type":"object","additionalProperties":{"type":"number"}}},"required":["total","byStatus"]},"alerts":{"type":"object","properties":{"total":{"type":"number"},"unresolved":{"type":"number"},"unresolvedWarning":{"type":"number"},"unresolvedCritical":{"type":"number"},"recent":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"severity":{"type":"string"},"message":{"type":"string"},"createdAt":{"type":"string"},"server":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"rule":{"type":"string","nullable":true}},"required":["id","type","severity","message","createdAt","server","rule"]}}},"required":["total","unresolved","unresolvedWarning","unresolvedCritical","recent"]},"topCpu":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"cpuUsagePercent":{"type":"number"}},"required":["id","name","cpuUsagePercent"]}},"topMemory":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"memUsagePercent":{"type":"number"}},"required":["id","name","memUsagePercent"]}}},"required":["latestAgentVersion","servers","alerts","topCpu","topMemory"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/maintenance":{"get":{"operationId":"listMaintenanceWindows","tags":["Maintenance"],"summary":"List maintenance windows","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["true","false"]},"required":false,"name":"active","in":"query"}],"responses":{"200":{"description":"Paginated windows","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"targetType":{"type":"string","enum":["SERVER","WEBSITE"]},"monitorId":{"type":"string","nullable":true},"id":{"type":"string"},"orgId":{"type":"string"},"serverId":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"startAt":{"type":"string","nullable":true},"endAt":{"type":"string","nullable":true},"isRecurring":{"type":"boolean"},"recurrenceDays":{"type":"array","items":{"type":"number"}},"recurrenceStart":{"type":"string","nullable":true},"recurrenceEnd":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"recurrenceEndsAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["targetType","monitorId","id","orgId","serverId","name","description","startAt","endAt","isRecurring","recurrenceDays","recurrenceStart","recurrenceEnd","timezone","recurrenceEndsAt","createdAt","server"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"operationId":"createMaintenanceWindow","tags":["Maintenance"],"summary":"Create a maintenance window","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"targetType":{"type":"string","enum":["SERVER","WEBSITE"],"default":"SERVER"},"monitorId":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500},"serverId":{"type":"string","nullable":true,"format":"uuid"},"isRecurring":{"type":"boolean"},"startAt":{"type":"string","format":"date-time"},"endAt":{"type":"string","format":"date-time"},"recurrenceDays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"recurrenceStart":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"recurrenceEnd":{"type":"string","pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string"},"recurrenceEndsAt":{"type":"string","format":"date-time"}},"required":["name"]}}}},"responses":{"201":{"description":"Window created","content":{"application/json":{"schema":{"type":"object","properties":{"targetType":{"type":"string","enum":["SERVER","WEBSITE"]},"monitorId":{"type":"string","nullable":true},"id":{"type":"string"},"orgId":{"type":"string"},"serverId":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"startAt":{"type":"string","nullable":true},"endAt":{"type":"string","nullable":true},"isRecurring":{"type":"boolean"},"recurrenceDays":{"type":"array","items":{"type":"number"}},"recurrenceStart":{"type":"string","nullable":true},"recurrenceEnd":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"recurrenceEndsAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["targetType","monitorId","id","orgId","serverId","name","description","startAt","endAt","isRecurring","recurrenceDays","recurrenceStart","recurrenceEnd","timezone","recurrenceEndsAt","createdAt","server"]}}}},"400":{"description":"Validation error"}}}},"/api/v1/maintenance/{id}":{"get":{"operationId":"getMaintenanceWindow","tags":["Maintenance"],"summary":"Get a maintenance window","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Window","content":{"application/json":{"schema":{"type":"object","properties":{"targetType":{"type":"string","enum":["SERVER","WEBSITE"]},"monitorId":{"type":"string","nullable":true},"id":{"type":"string"},"orgId":{"type":"string"},"serverId":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"startAt":{"type":"string","nullable":true},"endAt":{"type":"string","nullable":true},"isRecurring":{"type":"boolean"},"recurrenceDays":{"type":"array","items":{"type":"number"}},"recurrenceStart":{"type":"string","nullable":true},"recurrenceEnd":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"recurrenceEndsAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["targetType","monitorId","id","orgId","serverId","name","description","startAt","endAt","isRecurring","recurrenceDays","recurrenceStart","recurrenceEnd","timezone","recurrenceEndsAt","createdAt","server"]}}}},"404":{"description":"Maintenance window not found"}}},"patch":{"operationId":"updateMaintenanceWindow","tags":["Maintenance"],"summary":"Update a maintenance window","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"targetType":{"type":"string","enum":["SERVER","WEBSITE"]},"monitorId":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","nullable":true,"maxLength":500},"serverId":{"type":"string","nullable":true,"format":"uuid"},"isRecurring":{"type":"boolean"},"startAt":{"type":"string","nullable":true,"format":"date-time"},"endAt":{"type":"string","nullable":true,"format":"date-time"},"recurrenceDays":{"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"recurrenceStart":{"type":"string","nullable":true,"pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"recurrenceEnd":{"type":"string","nullable":true,"pattern":"^(?:[01]\\d|2[0-3]):[0-5]\\d$"},"timezone":{"type":"string","nullable":true},"recurrenceEndsAt":{"type":"string","nullable":true,"format":"date-time"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"targetType":{"type":"string","enum":["SERVER","WEBSITE"]},"monitorId":{"type":"string","nullable":true},"id":{"type":"string"},"orgId":{"type":"string"},"serverId":{"type":"string","nullable":true},"name":{"type":"string"},"description":{"type":"string","nullable":true},"startAt":{"type":"string","nullable":true},"endAt":{"type":"string","nullable":true},"isRecurring":{"type":"boolean"},"recurrenceDays":{"type":"array","items":{"type":"number"}},"recurrenceStart":{"type":"string","nullable":true},"recurrenceEnd":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"recurrenceEndsAt":{"type":"string","nullable":true},"createdAt":{"type":"string"},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"required":["targetType","monitorId","id","orgId","serverId","name","description","startAt","endAt","isRecurring","recurrenceDays","recurrenceStart","recurrenceEnd","timezone","recurrenceEndsAt","createdAt","server"]}}}},"400":{"description":"Validation error"},"404":{"description":"Maintenance window not found"}}},"delete":{"operationId":"deleteMaintenanceWindow","tags":["Maintenance"],"summary":"Delete a maintenance window","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"nullable":true}}}},"404":{"description":"Maintenance window not found"}}}},"/api/v1/templates":{"get":{"operationId":"listTemplates","tags":["Templates"],"summary":"List templates","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"List of templates","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["ALERT_RULES","SCRIPT"]},"scriptContent":{"type":"string","nullable":true},"environment":{"type":"string","nullable":true},"config":{"nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"_count":{"type":"object","properties":{"assignedAlertRules":{"type":"number"}},"required":["assignedAlertRules"]}},"required":["id","orgId","name","description","type","scriptContent","environment","createdAt","updatedAt"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"operationId":"createTemplate","tags":["Templates"],"summary":"Create template","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500},"type":{"type":"string","enum":["ALERT_RULES","SCRIPT"],"default":"ALERT_RULES"},"scriptContent":{"type":"string","maxLength":50000},"config":{"type":"object","properties":{"timezone":{"type":"string","nullable":true},"reportIntervalSeconds":{"type":"integer","minimum":10,"maximum":3600},"enableAutoUpdates":{"type":"boolean"},"locale":{"type":"string","nullable":true}}}},"required":["name"]}}}},"responses":{"201":{"description":"Template created","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["ALERT_RULES","SCRIPT"]},"scriptContent":{"type":"string","nullable":true},"environment":{"type":"string","nullable":true},"config":{"nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"_count":{"type":"object","properties":{"assignedAlertRules":{"type":"number"}},"required":["assignedAlertRules"]}},"required":["id","orgId","name","description","type","scriptContent","environment","createdAt","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Validation error"}}}},"/api/v1/templates/{id}":{"get":{"operationId":"getTemplate","tags":["Templates"],"summary":"Get template by ID","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Template details","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["ALERT_RULES","SCRIPT"]},"scriptContent":{"type":"string","nullable":true},"environment":{"type":"string","nullable":true},"config":{"nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"_count":{"type":"object","properties":{"assignedAlertRules":{"type":"number"}},"required":["assignedAlertRules"]}},"required":["id","orgId","name","description","type","scriptContent","environment","createdAt","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Template not found"}}},"patch":{"operationId":"updateTemplate","tags":["Templates"],"summary":"Update template","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500},"type":{"type":"string","enum":["ALERT_RULES","SCRIPT"]},"scriptContent":{"type":"string","maxLength":50000},"config":{"type":"object","properties":{"timezone":{"type":"string","nullable":true},"reportIntervalSeconds":{"type":"integer","minimum":10,"maximum":3600},"enableAutoUpdates":{"type":"boolean"},"locale":{"type":"string","nullable":true}}}}}}}},"responses":{"200":{"description":"Template updated","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string","enum":["ALERT_RULES","SCRIPT"]},"scriptContent":{"type":"string","nullable":true},"environment":{"type":"string","nullable":true},"config":{"nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"_count":{"type":"object","properties":{"assignedAlertRules":{"type":"number"}},"required":["assignedAlertRules"]}},"required":["id","orgId","name","description","type","scriptContent","environment","createdAt","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Validation error"},"404":{"description":"Template not found"}}},"delete":{"operationId":"deleteTemplate","tags":["Templates"],"summary":"Delete template","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Template deleted","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"nullable":true}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Template not found"}}}},"/api/v1/templates/{id}/apply/{serverId}":{"post":{"operationId":"applyTemplate","tags":["Templates"],"summary":"Apply template to server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"serverId","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"replace":{"type":"boolean","default":false}}}}}},"responses":{"200":{"description":"Template applied","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"alertRulesAssigned":{"type":"number"}},"required":["alertRulesAssigned"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Validation error"},"404":{"description":"Template or server not found"},"500":{"description":"Internal server error"}}}},"/api/v1/templates/{id}/alert-rules":{"get":{"operationId":"getTemplateAlertRules","tags":["Templates"],"summary":"Get template assigned alert rules","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"List of assigned alert rules","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"serverId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"metricField":{"type":"string"},"operator":{"type":"string","enum":["GT","LT","GTE","LTE","EQ"]},"threshold":{"type":"number"},"severity":{"type":"string","enum":["WARNING","CRITICAL"]},"evaluationWindowMinutes":{"type":"number"},"repeatEveryMinutes":{"type":"number"},"escalationChannelId":{"type":"string","nullable":true},"escalationAfterMinutes":{"type":"number"},"escalationChannel":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"required":["id","name","type"]},"enabled":{"type":"boolean"},"lastTriggeredAt":{"type":"string","nullable":true},"lastNotifiedAt":{"type":"string","nullable":true},"breachStartedAt":{"type":"string","nullable":true},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"channel":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]}},"required":["channelId","channel"]}},"serverAssignments":{"type":"array","items":{"type":"object","properties":{"serverId":{"type":"string"},"server":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["serverId","server"]}}},"required":["id","orgId","serverId","name","metricField","operator","threshold","severity","evaluationWindowMinutes","repeatEveryMinutes","enabled","lastTriggeredAt","lastNotifiedAt","breachStartedAt","channels","serverAssignments"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Template not found"},"500":{"description":"Internal server error"}}},"post":{"operationId":"assignTemplateAlertRules","tags":["Templates"],"summary":"Assign alert rules to template","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"alertRuleIds":{"type":"array","items":{"type":"string","format":"uuid"},"minItems":1}},"required":["alertRuleIds"]}}}},"responses":{"201":{"description":"Alert rules assigned","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"serverId":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"metricField":{"type":"string"},"operator":{"type":"string","enum":["GT","LT","GTE","LTE","EQ"]},"threshold":{"type":"number"},"severity":{"type":"string","enum":["WARNING","CRITICAL"]},"evaluationWindowMinutes":{"type":"number"},"repeatEveryMinutes":{"type":"number"},"escalationChannelId":{"type":"string","nullable":true},"escalationAfterMinutes":{"type":"number"},"escalationChannel":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"}},"required":["id","name","type"]},"enabled":{"type":"boolean"},"lastTriggeredAt":{"type":"string","nullable":true},"lastNotifiedAt":{"type":"string","nullable":true},"breachStartedAt":{"type":"string","nullable":true},"channels":{"type":"array","items":{"type":"object","properties":{"channelId":{"type":"string"},"channel":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"}},"required":["name","type"]}},"required":["channelId","channel"]}},"serverAssignments":{"type":"array","items":{"type":"object","properties":{"serverId":{"type":"string"},"server":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}},"required":["serverId","server"]}}},"required":["id","orgId","serverId","name","metricField","operator","threshold","severity","evaluationWindowMinutes","repeatEveryMinutes","enabled","lastTriggeredAt","lastNotifiedAt","breachStartedAt","channels","serverAssignments"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Validation error"},"404":{"description":"Template not found"},"500":{"description":"Internal server error"}}},"put":{"operationId":"replaceTemplateAlertRules","tags":["Templates"],"summary":"Replace template assigned alert rules","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"alertRuleIds":{"type":"array","items":{"type":"string","format":"uuid"}}},"required":["alertRuleIds"]}}}},"responses":{"200":{"description":"Alert rules replaced","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"nullable":true}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Validation error"},"404":{"description":"Template not found"},"500":{"description":"Internal server error"}}}},"/api/v1/templates/{id}/alert-rules/{ruleId}":{"delete":{"operationId":"removeTemplateAlertRule","tags":["Templates"],"summary":"Remove alert rule from template","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"ruleId","in":"path"}],"responses":{"200":{"description":"Alert rule removed","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"nullable":true}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Template or alert rule not found"},"500":{"description":"Internal server error"}}}},"/api/v1/org":{"get":{"operationId":"getOrganization","tags":["Organization"],"summary":"Get current organization info","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Organization info with member list","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string","nullable":true},"logo":{"type":"string","nullable":true},"createdAt":{"type":"string"},"metadata":{"type":"string","nullable":true},"scheduledDeletionAt":{"type":"string","nullable":true},"alertDigestFrequency":{"type":"string","enum":["off","daily","weekly","monthly"]},"alertDigestLastSentAt":{"type":"string","nullable":true},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"userId":{"type":"string"},"role":{"type":"string"},"createdAt":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name","email"]}},"required":["id","organizationId","userId","role","createdAt","user"]}}},"required":["id","name","slug","logo","createdAt","metadata","scheduledDeletionAt","members"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Organization not found"}}},"patch":{"operationId":"updateOrganization","tags":["Organization"],"summary":"Update organization name/logo","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1},"logo":{"type":"string","nullable":true},"alertDigestFrequency":{"type":"string","enum":["off","daily","weekly","monthly"]}}}}}},"responses":{"200":{"description":"Organization updated","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string","nullable":true},"logo":{"type":"string","nullable":true},"createdAt":{"type":"string"},"metadata":{"type":"string","nullable":true},"scheduledDeletionAt":{"type":"string","nullable":true},"alertDigestFrequency":{"type":"string","enum":["off","daily","weekly","monthly"]},"alertDigestLastSentAt":{"type":"string","nullable":true}},"required":["id","name","slug","logo","createdAt","metadata","scheduledDeletionAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"delete":{"operationId":"scheduleOrganizationDeletion","tags":["Organization"],"summary":"Request organization deletion (sends confirmation email)","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Confirmation email sent","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"emailSent":{"type":"boolean"}},"required":["emailSent"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"403":{"description":"Only the owner can delete the organization"},"404":{"description":"Organization not found"},"409":{"description":"Organization already scheduled for deletion"}}}},"/api/v1/org/cancel-deletion":{"post":{"operationId":"cancelOrganizationDeletion","tags":["Organization"],"summary":"Cancel a scheduled organization deletion (owner, while org still active)","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Deletion cancelled","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"nullable":true}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"403":{"description":"Only the owner can cancel deletion"}}}},"/api/v1/org/members":{"get":{"operationId":"listMembers","tags":["Organization"],"summary":"List organization members","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"List of members","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"userId":{"type":"string"},"role":{"type":"string"},"createdAt":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name","email"]}},"required":["id","organizationId","userId","role","createdAt","user"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/org/members/{userId}":{"delete":{"operationId":"removeMember","tags":["Organization"],"summary":"Remove a member","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"Member removed","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"nullable":true}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Bad request"},"403":{"description":"Forbidden"},"404":{"description":"Member not found"}}}},"/api/v1/org/members/{userId}/role":{"patch":{"operationId":"changeMemberRole","tags":["Organization"],"summary":"Change member role","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"userId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["admin","member"]}},"required":["role"]}}}},"responses":{"200":{"description":"Role updated","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Bad request"},"403":{"description":"Forbidden"},"404":{"description":"Member not found"}}}},"/api/v1/org/invitations":{"post":{"operationId":"createInvitation","tags":["Organization"],"summary":"Invite member by email","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"role":{"type":"string","enum":["admin","member"],"default":"member"}},"required":["email"]}}}},"responses":{"200":{"description":"Invitation sent","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","additionalProperties":{"nullable":true}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Validation error"},"403":{"description":"Plan limit reached"}}},"get":{"operationId":"listInvitations","tags":["Organization"],"summary":"List pending invitations","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"List of pending invitations","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"organizationId":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","nullable":true},"status":{"type":"string"},"expiresAt":{"type":"string"},"createdAt":{"type":"string"},"inviterId":{"type":"string"}},"required":["id","organizationId","email","role","status","expiresAt","createdAt","inviterId"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/org/invitations/{id}":{"delete":{"operationId":"cancelInvitation","tags":["Organization"],"summary":"Cancel invitation","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Invitation canceled","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"nullable":true}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Invitation not found"}}}},"/api/v1/public/invitations/{id}":{"get":{"operationId":"getPublicInvitation","tags":["Public"],"summary":"Get invitation preview (no auth)","parameters":[{"schema":{"type":"string","description":"Invitation ID from the invite link"},"required":true,"description":"Invitation ID from the invite link","name":"id","in":"path"}],"responses":{"200":{"description":"Invitation preview","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"organizationName":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"inviterName":{"type":"string","nullable":true}},"required":["organizationName","email","status","inviterName"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Invitation not found or expired"}}}},"/api/v1/public/org-deletion/confirm":{"post":{"operationId":"confirmOrganizationDeletion","tags":["Public"],"summary":"Confirm organization deletion via email token","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1}},"required":["token"]}}}},"responses":{"200":{"description":"Deletion scheduled","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"scheduledDeletionAt":{"type":"string"},"organizationName":{"type":"string"}},"required":["scheduledDeletionAt","organizationName"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid or expired token"},"403":{"description":"Only the owner can confirm"},"404":{"description":"Organization not found"},"409":{"description":"Already scheduled"}}}},"/api/v1/public/org-deletion/cancel":{"post":{"operationId":"cancelOrganizationDeletionByToken","tags":["Public"],"summary":"Cancel scheduled organization deletion via email token","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string","minLength":1}},"required":["token"]}}}},"responses":{"200":{"description":"Deletion cancelled","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"organizationName":{"type":"string"}},"required":["organizationName"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid or expired token"}}}},"/api/v1/audit-log":{"get":{"operationId":"listAuditLogs","tags":["Audit Log"],"summary":"List audit logs","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"pageSize","in":"query"},{"schema":{"type":"string"},"required":false,"name":"action","in":"query"},{"schema":{"type":"string","maxLength":200},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["createdAt","action","entityType","userEmail","ip"],"default":"createdAt"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sortDirection","in":"query"}],"responses":{"200":{"description":"One page of audit log entries","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"userId":{"type":"string","nullable":true},"userEmail":{"type":"string","nullable":true},"action":{"type":"string"},"entityType":{"type":"string","nullable":true},"entityId":{"type":"string","nullable":true},"meta":{"nullable":true},"ip":{"type":"string","nullable":true},"createdAt":{"type":"string"}},"required":["id","orgId","userId","userEmail","action","entityType","entityId","ip","createdAt"]}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"}},"required":["items","total","page","pageSize"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/test-mode":{"get":{"operationId":"getTestMode","tags":["Test Mode"],"summary":"Get test mode status","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Test mode status","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"500":{"description":"Internal server error"}}},"post":{"operationId":"setTestMode","tags":["Test Mode"],"summary":"Set test mode","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"]}}}},"responses":{"200":{"description":"Test mode updated","content":{"application/json":{"schema":{"type":"object","properties":{"testMode":{"type":"boolean"}},"required":["testMode"]}}}},"400":{"description":"Validation error"},"500":{"description":"Internal server error"}}}},"/api/v1/servers/{id}/test-override":{"get":{"operationId":"getTestOverride","tags":["Test Override"],"summary":"Get current metric override for a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Current override status","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"active":{"type":"boolean"},"overrides":{"type":"object","additionalProperties":{"type":"number"}},"expiresAt":{"type":"string","nullable":true}},"required":["active","expiresAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}},"post":{"operationId":"setTestOverride","tags":["Test Override"],"summary":"Set metric overrides for a server","description":"Overrides specific metric values for the given server and immediately triggers alert evaluation with those values.","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"overrides":{"type":"object","additionalProperties":{"type":"number"}},"durationMinutes":{"type":"number","minimum":1,"maximum":60,"default":10}},"required":["overrides"]}}}},"responses":{"200":{"description":"Override activated","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"active":{"type":"boolean"},"overrides":{"type":"object","additionalProperties":{"type":"number"}},"expiresAt":{"type":"string","nullable":true}},"required":["active","expiresAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Validation error"},"404":{"description":"Server not found"}}},"delete":{"operationId":"deleteTestOverride","tags":["Test Override"],"summary":"Clear metric overrides for a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Override cleared","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"active":{"type":"boolean"},"overrides":{"type":"object","additionalProperties":{"type":"number"}},"expiresAt":{"type":"string","nullable":true}},"required":["active","expiresAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/test-override/preview":{"post":{"operationId":"previewTestOverride","tags":["Test Override"],"summary":"Preview which alert rules would fire for given metric values","description":"Dry-run: evaluates alert rules against the provided metric overrides without creating alerts or sending notifications.","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"overrides":{"type":"object","additionalProperties":{"type":"number"}}},"required":["overrides"]}}}},"responses":{"200":{"description":"Preview results","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"ruleId":{"type":"string"},"ruleName":{"type":"string","nullable":true},"metricField":{"type":"string"},"operator":{"type":"string"},"threshold":{"type":"number"},"severity":{"type":"string"},"currentValue":{"type":"number"},"wouldFire":{"type":"boolean"},"hasOpenAlert":{"type":"boolean"}},"required":["ruleId","ruleName","metricField","operator","threshold","severity","currentValue","wouldFire","hasOpenAlert"]}}},"required":["results"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/test-offline-sim":{"get":{"operationId":"getOfflineSimulation","tags":["Test Override"],"summary":"Get offline simulation status for a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Offline simulation status","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"active":{"type":"boolean"},"expiresAt":{"type":"string","nullable":true}},"required":["active","expiresAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}},"post":{"operationId":"startOfflineSimulation","tags":["Test Override"],"summary":"Simulate server offline state","description":"Marks the server as offline for testing OFFLINE alert rules and notifications. Fires an OFFLINE alert immediately and keeps the server offline until the simulation expires or is stopped.","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"durationMinutes":{"type":"number","minimum":1,"maximum":60,"default":5}}}}}},"responses":{"200":{"description":"Simulation started","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"active":{"type":"boolean"},"expiresAt":{"type":"string","nullable":true}},"required":["active","expiresAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}},"delete":{"operationId":"stopOfflineSimulation","tags":["Test Override"],"summary":"Stop offline simulation for a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Simulation stopped","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"active":{"type":"boolean"},"expiresAt":{"type":"string","nullable":true}},"required":["active","expiresAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/test-notification":{"post":{"operationId":"sendTestNotification","tags":["Test Override"],"summary":"Send a test notification for a server","description":"Sends a test notification through all configured global notification channels to verify they are working correctly. Does not create an alert in the database.","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Test notification dispatched","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"channelsTested":{"type":"number"},"results":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string"},"success":{"type":"boolean"},"error":{"type":"string"}},"required":["id","name","type","success"]}}},"required":["channelsTested","results"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}}},"/api/v1/backup-alert-rules":{"get":{"tags":["Backup Alert Rules"],"security":[{"cookieAuth":[]}],"operationId":"listBackupAlertRules","responses":{"200":{"description":"Backup rules","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"planIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"jobIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"kind":{"type":"string","enum":["FAILED","WARNING","OVERDUE","RUNNING_TOO_LONG"]},"thresholdMinutes":{"type":"integer","minimum":1,"maximum":10080,"default":60},"delayMinutes":{"type":"integer","minimum":0,"maximum":10080,"default":0},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true},"id":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"activeSince":{"type":"string","nullable":true,"format":"date-time"},"states":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"backupPlanId":{"type":"string"},"jobId":{"type":"string","nullable":true},"targetKey":{"type":"string"},"targetName":{"type":"string"},"pendingSince":{"type":"string","nullable":true,"format":"date-time"},"activeSince":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","backupPlanId","jobId","targetKey","targetName","pendingSince","activeSince"]}}},"required":["name","kind","id","updatedAt","activeSince","states"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"tags":["Backup Alert Rules"],"security":[{"cookieAuth":[]}],"operationId":"createBackupAlertRule","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"planIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"jobIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"kind":{"type":"string","enum":["FAILED","WARNING","OVERDUE","RUNNING_TOO_LONG"]},"thresholdMinutes":{"type":"integer","minimum":1,"maximum":10080,"default":60},"delayMinutes":{"type":"integer","minimum":0,"maximum":10080,"default":0},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true}},"required":["name","kind"]}}}},"responses":{"200":{"description":"Backup rule","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"planIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"jobIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"kind":{"type":"string","enum":["FAILED","WARNING","OVERDUE","RUNNING_TOO_LONG"]},"thresholdMinutes":{"type":"integer","minimum":1,"maximum":10080,"default":60},"delayMinutes":{"type":"integer","minimum":0,"maximum":10080,"default":0},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true},"id":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"activeSince":{"type":"string","nullable":true,"format":"date-time"},"states":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"backupPlanId":{"type":"string"},"jobId":{"type":"string","nullable":true},"targetKey":{"type":"string"},"targetName":{"type":"string"},"pendingSince":{"type":"string","nullable":true,"format":"date-time"},"activeSince":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","backupPlanId","jobId","targetKey","targetName","pendingSince","activeSince"]}}},"required":["name","kind","id","updatedAt","activeSince","states"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid rule"},"403":{"description":"Forbidden or plan limit"},"404":{"description":"Not found"}}}},"/api/v1/backup-alert-rules/{id}":{"get":{"tags":["Backup Alert Rules"],"security":[{"cookieAuth":[]}],"operationId":"getBackupAlertRule","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Backup rule","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"planIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"jobIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"kind":{"type":"string","enum":["FAILED","WARNING","OVERDUE","RUNNING_TOO_LONG"]},"thresholdMinutes":{"type":"integer","minimum":1,"maximum":10080,"default":60},"delayMinutes":{"type":"integer","minimum":0,"maximum":10080,"default":0},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true},"id":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"activeSince":{"type":"string","nullable":true,"format":"date-time"},"states":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"backupPlanId":{"type":"string"},"jobId":{"type":"string","nullable":true},"targetKey":{"type":"string"},"targetName":{"type":"string"},"pendingSince":{"type":"string","nullable":true,"format":"date-time"},"activeSince":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","backupPlanId","jobId","targetKey","targetName","pendingSince","activeSince"]}}},"required":["name","kind","id","updatedAt","activeSince","states"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}},"put":{"tags":["Backup Alert Rules"],"security":[{"cookieAuth":[]}],"operationId":"updateBackupAlertRule","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"planIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"jobIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"kind":{"type":"string","enum":["FAILED","WARNING","OVERDUE","RUNNING_TOO_LONG"]},"thresholdMinutes":{"type":"integer","minimum":1,"maximum":10080,"default":60},"delayMinutes":{"type":"integer","minimum":0,"maximum":10080,"default":0},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true}},"required":["name","kind"]}}}},"responses":{"200":{"description":"Backup rule","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"planIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"jobIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"kind":{"type":"string","enum":["FAILED","WARNING","OVERDUE","RUNNING_TOO_LONG"]},"thresholdMinutes":{"type":"integer","minimum":1,"maximum":10080,"default":60},"delayMinutes":{"type":"integer","minimum":0,"maximum":10080,"default":0},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true},"id":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"activeSince":{"type":"string","nullable":true,"format":"date-time"},"states":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"backupPlanId":{"type":"string"},"jobId":{"type":"string","nullable":true},"targetKey":{"type":"string"},"targetName":{"type":"string"},"pendingSince":{"type":"string","nullable":true,"format":"date-time"},"activeSince":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","backupPlanId","jobId","targetKey","targetName","pendingSince","activeSince"]}}},"required":["name","kind","id","updatedAt","activeSince","states"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid rule"},"403":{"description":"Forbidden or plan limit"},"404":{"description":"Not found"}}},"delete":{"tags":["Backup Alert Rules"],"security":[{"cookieAuth":[]}],"operationId":"deleteBackupAlertRule","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"nullable":true}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}}},"/api/v1/backup-alert-rules/{id}/enabled":{"patch":{"tags":["Backup Alert Rules"],"security":[{"cookieAuth":[]}],"operationId":"setBackupAlertRuleEnabled","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"Backup rule","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"planIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"jobIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"kind":{"type":"string","enum":["FAILED","WARNING","OVERDUE","RUNNING_TOO_LONG"]},"thresholdMinutes":{"type":"integer","minimum":1,"maximum":10080,"default":60},"delayMinutes":{"type":"integer","minimum":0,"maximum":10080,"default":0},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true},"id":{"type":"string"},"updatedAt":{"type":"string","format":"date-time"},"activeSince":{"type":"string","nullable":true,"format":"date-time"},"states":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"backupPlanId":{"type":"string"},"jobId":{"type":"string","nullable":true},"targetKey":{"type":"string"},"targetName":{"type":"string"},"pendingSince":{"type":"string","nullable":true,"format":"date-time"},"activeSince":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","backupPlanId","jobId","targetKey","targetName","pendingSince","activeSince"]}}},"required":["name","kind","id","updatedAt","activeSince","states"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid rule"},"403":{"description":"Forbidden or plan limit"},"404":{"description":"Not found"}}}},"/api/v1/backup-plans/{id}/jobs":{"get":{"operationId":"listBackupJobs","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Jobs","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"backupPlanId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"cronExpression":{"type":"string","nullable":true},"timezone":{"type":"string"},"graceMinutes":{"type":"number"},"monitoringEnabled":{"type":"boolean"},"websiteId":{"type":"string","nullable":true},"website":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"]},"monitoringStartedAt":{"type":"string","nullable":true},"serverId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"token":{"type":"string"},"lastPingAt":{"type":"string","nullable":true},"lastSuccessfulAt":{"type":"string","nullable":true},"lastPingStatus":{"type":"string","nullable":true},"lastPingMessage":{"type":"string","nullable":true},"lastSizeBytes":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"activeRunCount":{"type":"number"},"oldestRunningAt":{"type":"string","nullable":true},"state":{"type":"string","enum":["DOCUMENTED","PENDING","HEALTHY","WARNING","FAILED","OVERDUE","RUNNING","RUNNING_TOO_LONG"]},"nextScheduledAt":{"type":"string","nullable":true},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"service":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}},"required":["id","backupPlanId","name","description","cronExpression","timezone","graceMinutes","monitoringEnabled","websiteId","website","monitoringStartedAt","serverId","serviceId","token","lastPingAt","lastSuccessfulAt","lastPingStatus","lastPingMessage","lastSizeBytes","createdAt","updatedAt","activeRunCount","oldestRunningAt","state","nextScheduledAt","server","service"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Plan not found"}}},"post":{"operationId":"createBackupJob","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","nullable":true,"maxLength":500},"cronExpression":{"type":"string","nullable":true,"maxLength":100},"timezone":{"type":"string","maxLength":100,"default":"UTC"},"graceMinutes":{"type":"integer","minimum":0,"maximum":10080,"default":30},"monitoringEnabled":{"type":"boolean","default":false},"serverId":{"type":"string","nullable":true,"format":"uuid"},"serviceId":{"type":"string","nullable":true,"format":"uuid"},"websiteId":{"type":"string","nullable":true,"format":"uuid"}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"backupPlanId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"cronExpression":{"type":"string","nullable":true},"timezone":{"type":"string"},"graceMinutes":{"type":"number"},"monitoringEnabled":{"type":"boolean"},"websiteId":{"type":"string","nullable":true},"website":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"]},"monitoringStartedAt":{"type":"string","nullable":true},"serverId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"token":{"type":"string"},"lastPingAt":{"type":"string","nullable":true},"lastSuccessfulAt":{"type":"string","nullable":true},"lastPingStatus":{"type":"string","nullable":true},"lastPingMessage":{"type":"string","nullable":true},"lastSizeBytes":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"activeRunCount":{"type":"number"},"oldestRunningAt":{"type":"string","nullable":true},"state":{"type":"string","enum":["DOCUMENTED","PENDING","HEALTHY","WARNING","FAILED","OVERDUE","RUNNING","RUNNING_TOO_LONG"]},"nextScheduledAt":{"type":"string","nullable":true},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"service":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}},"required":["id","backupPlanId","name","description","cronExpression","timezone","graceMinutes","monitoringEnabled","websiteId","website","monitoringStartedAt","serverId","serviceId","token","lastPingAt","lastSuccessfulAt","lastPingStatus","lastPingMessage","lastSizeBytes","createdAt","updatedAt","activeRunCount","oldestRunningAt","state","nextScheduledAt","server","service"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid schedule"},"404":{"description":"Not found"}}}},"/api/v1/backup-plans/{id}/jobs/{jobId}/schedule-suggestion":{"get":{"operationId":"getBackupJobScheduleSuggestion","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"summary":"Suggest an observed or reported schedule; never changes monitoring","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"Schedule evidence and optional suggestion","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"source":{"type":"string","enum":["reported","history","none"]},"reason":{"type":"string","enum":["reported","stable_history","insufficient_history","irregular_history","mixed_schedules","manual_schedule","unsupported_interval","stale_report","stale_history"]},"cronExpression":{"type":"string","nullable":true},"timezone":{"type":"string","enum":["UTC"]},"graceMinutes":{"type":"integer"},"sampleCount":{"type":"integer"},"intervalSeconds":{"type":"number","nullable":true},"reportedAt":{"type":"string","nullable":true}},"required":["source","reason","cronExpression","timezone","graceMinutes","sampleCount","intervalSeconds","reportedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Job not found"}}}},"/api/v1/backup-plans/{id}/jobs/{jobId}":{"patch":{"operationId":"updateBackupJob","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"jobId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","nullable":true,"maxLength":500},"cronExpression":{"type":"string","nullable":true,"maxLength":100},"timezone":{"type":"string","maxLength":100},"graceMinutes":{"type":"integer","minimum":0,"maximum":10080},"monitoringEnabled":{"type":"boolean"},"serverId":{"type":"string","nullable":true,"format":"uuid"},"serviceId":{"type":"string","nullable":true,"format":"uuid"},"websiteId":{"type":"string","nullable":true,"format":"uuid"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"backupPlanId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"cronExpression":{"type":"string","nullable":true},"timezone":{"type":"string"},"graceMinutes":{"type":"number"},"monitoringEnabled":{"type":"boolean"},"websiteId":{"type":"string","nullable":true},"website":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"]},"monitoringStartedAt":{"type":"string","nullable":true},"serverId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"token":{"type":"string"},"lastPingAt":{"type":"string","nullable":true},"lastSuccessfulAt":{"type":"string","nullable":true},"lastPingStatus":{"type":"string","nullable":true},"lastPingMessage":{"type":"string","nullable":true},"lastSizeBytes":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"activeRunCount":{"type":"number"},"oldestRunningAt":{"type":"string","nullable":true},"state":{"type":"string","enum":["DOCUMENTED","PENDING","HEALTHY","WARNING","FAILED","OVERDUE","RUNNING","RUNNING_TOO_LONG"]},"nextScheduledAt":{"type":"string","nullable":true},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"service":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}},"required":["id","backupPlanId","name","description","cronExpression","timezone","graceMinutes","monitoringEnabled","websiteId","website","monitoringStartedAt","serverId","serviceId","token","lastPingAt","lastSuccessfulAt","lastPingStatus","lastPingMessage","lastSizeBytes","createdAt","updatedAt","activeRunCount","oldestRunningAt","state","nextScheduledAt","server","service"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid schedule"},"404":{"description":"Not found"}}},"delete":{"operationId":"deleteBackupJob","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"nullable":true}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}}},"/api/v1/backup-plans/{id}/jobs/{jobId}/regenerate-token":{"post":{"operationId":"regenerateBackupJobToken","tags":["Backup Plans"],"summary":"Regenerate the backup job ping URL (invalidates the previous URL)","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"New token","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Job not found"}}}},"/api/v1/backup-plans/{id}/runs":{"get":{"operationId":"listBackupRuns","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","enum":["sequence","startedAt","finishedAt","status"],"default":"sequence"},"required":false,"name":"sortBy","in":"query"},{"schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"required":false,"name":"sortDirection","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"jobId","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":25},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Backup run history","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"backupPlanId":{"type":"string"},"jobId":{"type":"string","nullable":true},"runId":{"type":"string"},"status":{"type":"string","enum":["RUNNING","SUCCESS","WARNING","FAILURE"]},"startedAt":{"type":"string","nullable":true,"format":"date-time"},"finishedAt":{"type":"string","nullable":true,"format":"date-time"},"message":{"type":"string","nullable":true},"sizeBytes":{"type":"number","nullable":true},"createdAt":{"type":"string","format":"date-time"}},"required":["id","backupPlanId","jobId","runId","status","startedAt","finishedAt","message","sizeBytes","createdAt"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}}},"/api/v1/backup-plans":{"get":{"operationId":"listBackupPlans","tags":["Backup Plans"],"summary":"List backup plans","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","format":"uuid"},"required":false,"name":"serverId","in":"query"}],"responses":{"200":{"description":"Paginated backup plans","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"expectedEveryHours":{"type":"number","nullable":true},"token":{"type":"string"},"lastPingAt":{"type":"string","nullable":true},"lastPingStatus":{"type":"string","nullable":true},"lastPingMessage":{"type":"string","nullable":true},"lastSizeBytes":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"websites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"]}},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"backupPlanId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"cronExpression":{"type":"string","nullable":true},"timezone":{"type":"string"},"graceMinutes":{"type":"number"},"monitoringEnabled":{"type":"boolean"},"websiteId":{"type":"string","nullable":true},"website":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"]},"monitoringStartedAt":{"type":"string","nullable":true},"serverId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"token":{"type":"string"},"lastPingAt":{"type":"string","nullable":true},"lastSuccessfulAt":{"type":"string","nullable":true},"lastPingStatus":{"type":"string","nullable":true},"lastPingMessage":{"type":"string","nullable":true},"lastSizeBytes":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"activeRunCount":{"type":"number"},"oldestRunningAt":{"type":"string","nullable":true},"state":{"type":"string","enum":["DOCUMENTED","PENDING","HEALTHY","WARNING","FAILED","OVERDUE","RUNNING","RUNNING_TOO_LONG"]},"nextScheduledAt":{"type":"string","nullable":true},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"service":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}},"required":["id","backupPlanId","name","description","cronExpression","timezone","graceMinutes","monitoringEnabled","websiteId","website","monitoringStartedAt","serverId","serviceId","token","lastPingAt","lastSuccessfulAt","lastPingStatus","lastPingMessage","lastSizeBytes","createdAt","updatedAt","activeRunCount","oldestRunningAt","state","nextScheduledAt","server","service"]}},"activeRunCount":{"type":"number"},"oldestRunningAt":{"type":"string","nullable":true},"state":{"type":"string","enum":["DOCUMENTED","PENDING","HEALTHY","WARNING","FAILED","OVERDUE","RUNNING","RUNNING_TOO_LONG"]},"servers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}}},"required":["id","orgId","name","description","expectedEveryHours","token","lastPingAt","lastPingStatus","lastPingMessage","lastSizeBytes","createdAt","updatedAt","websites","jobs","activeRunCount","oldestRunningAt","state","servers","services"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"operationId":"createBackupPlan","tags":["Backup Plans"],"summary":"Create a backup plan","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500},"serverIds":{"type":"array","items":{"type":"string","format":"uuid"}},"serviceIds":{"type":"array","items":{"type":"string","format":"uuid"}},"websiteIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":500},"expectedEveryHours":{"type":"integer","nullable":true,"minimum":1,"maximum":8760}},"required":["name"]}}}},"responses":{"201":{"description":"Backup plan created","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"expectedEveryHours":{"type":"number","nullable":true},"token":{"type":"string"},"lastPingAt":{"type":"string","nullable":true},"lastPingStatus":{"type":"string","nullable":true},"lastPingMessage":{"type":"string","nullable":true},"lastSizeBytes":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"websites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"]}},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"backupPlanId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"cronExpression":{"type":"string","nullable":true},"timezone":{"type":"string"},"graceMinutes":{"type":"number"},"monitoringEnabled":{"type":"boolean"},"websiteId":{"type":"string","nullable":true},"website":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"]},"monitoringStartedAt":{"type":"string","nullable":true},"serverId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"token":{"type":"string"},"lastPingAt":{"type":"string","nullable":true},"lastSuccessfulAt":{"type":"string","nullable":true},"lastPingStatus":{"type":"string","nullable":true},"lastPingMessage":{"type":"string","nullable":true},"lastSizeBytes":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"activeRunCount":{"type":"number"},"oldestRunningAt":{"type":"string","nullable":true},"state":{"type":"string","enum":["DOCUMENTED","PENDING","HEALTHY","WARNING","FAILED","OVERDUE","RUNNING","RUNNING_TOO_LONG"]},"nextScheduledAt":{"type":"string","nullable":true},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"service":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}},"required":["id","backupPlanId","name","description","cronExpression","timezone","graceMinutes","monitoringEnabled","websiteId","website","monitoringStartedAt","serverId","serviceId","token","lastPingAt","lastSuccessfulAt","lastPingStatus","lastPingMessage","lastSizeBytes","createdAt","updatedAt","activeRunCount","oldestRunningAt","state","nextScheduledAt","server","service"]}},"activeRunCount":{"type":"number"},"oldestRunningAt":{"type":"string","nullable":true},"state":{"type":"string","enum":["DOCUMENTED","PENDING","HEALTHY","WARNING","FAILED","OVERDUE","RUNNING","RUNNING_TOO_LONG"]},"servers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}}},"required":["id","orgId","name","description","expectedEveryHours","token","lastPingAt","lastPingStatus","lastPingMessage","lastSizeBytes","createdAt","updatedAt","websites","jobs","activeRunCount","oldestRunningAt","state","servers","services"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Validation error"}}}},"/api/v1/backup-plans/{id}":{"get":{"operationId":"getBackupPlan","tags":["Backup Plans"],"summary":"Get a backup plan","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Backup plan","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"expectedEveryHours":{"type":"number","nullable":true},"token":{"type":"string"},"lastPingAt":{"type":"string","nullable":true},"lastPingStatus":{"type":"string","nullable":true},"lastPingMessage":{"type":"string","nullable":true},"lastSizeBytes":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"websites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"]}},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"backupPlanId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"cronExpression":{"type":"string","nullable":true},"timezone":{"type":"string"},"graceMinutes":{"type":"number"},"monitoringEnabled":{"type":"boolean"},"websiteId":{"type":"string","nullable":true},"website":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"]},"monitoringStartedAt":{"type":"string","nullable":true},"serverId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"token":{"type":"string"},"lastPingAt":{"type":"string","nullable":true},"lastSuccessfulAt":{"type":"string","nullable":true},"lastPingStatus":{"type":"string","nullable":true},"lastPingMessage":{"type":"string","nullable":true},"lastSizeBytes":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"activeRunCount":{"type":"number"},"oldestRunningAt":{"type":"string","nullable":true},"state":{"type":"string","enum":["DOCUMENTED","PENDING","HEALTHY","WARNING","FAILED","OVERDUE","RUNNING","RUNNING_TOO_LONG"]},"nextScheduledAt":{"type":"string","nullable":true},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"service":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}},"required":["id","backupPlanId","name","description","cronExpression","timezone","graceMinutes","monitoringEnabled","websiteId","website","monitoringStartedAt","serverId","serviceId","token","lastPingAt","lastSuccessfulAt","lastPingStatus","lastPingMessage","lastSizeBytes","createdAt","updatedAt","activeRunCount","oldestRunningAt","state","nextScheduledAt","server","service"]}},"activeRunCount":{"type":"number"},"oldestRunningAt":{"type":"string","nullable":true},"state":{"type":"string","enum":["DOCUMENTED","PENDING","HEALTHY","WARNING","FAILED","OVERDUE","RUNNING","RUNNING_TOO_LONG"]},"servers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}}},"required":["id","orgId","name","description","expectedEveryHours","token","lastPingAt","lastPingStatus","lastPingMessage","lastSizeBytes","createdAt","updatedAt","websites","jobs","activeRunCount","oldestRunningAt","state","servers","services"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}},"patch":{"operationId":"updateBackupPlan","tags":["Backup Plans"],"summary":"Update a backup plan","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","nullable":true,"maxLength":500},"serverIds":{"type":"array","items":{"type":"string","format":"uuid"}},"serviceIds":{"type":"array","items":{"type":"string","format":"uuid"}},"websiteIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":500},"expectedEveryHours":{"type":"integer","nullable":true,"minimum":1,"maximum":8760}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"expectedEveryHours":{"type":"number","nullable":true},"token":{"type":"string"},"lastPingAt":{"type":"string","nullable":true},"lastPingStatus":{"type":"string","nullable":true},"lastPingMessage":{"type":"string","nullable":true},"lastSizeBytes":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"websites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"]}},"jobs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"backupPlanId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"cronExpression":{"type":"string","nullable":true},"timezone":{"type":"string"},"graceMinutes":{"type":"number"},"monitoringEnabled":{"type":"boolean"},"websiteId":{"type":"string","nullable":true},"website":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"}},"required":["id","name","url"]},"monitoringStartedAt":{"type":"string","nullable":true},"serverId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"token":{"type":"string"},"lastPingAt":{"type":"string","nullable":true},"lastSuccessfulAt":{"type":"string","nullable":true},"lastPingStatus":{"type":"string","nullable":true},"lastPingMessage":{"type":"string","nullable":true},"lastSizeBytes":{"type":"number","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"activeRunCount":{"type":"number"},"oldestRunningAt":{"type":"string","nullable":true},"state":{"type":"string","enum":["DOCUMENTED","PENDING","HEALTHY","WARNING","FAILED","OVERDUE","RUNNING","RUNNING_TOO_LONG"]},"nextScheduledAt":{"type":"string","nullable":true},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"service":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}},"required":["id","backupPlanId","name","description","cronExpression","timezone","graceMinutes","monitoringEnabled","websiteId","website","monitoringStartedAt","serverId","serviceId","token","lastPingAt","lastSuccessfulAt","lastPingStatus","lastPingMessage","lastSizeBytes","createdAt","updatedAt","activeRunCount","oldestRunningAt","state","nextScheduledAt","server","service"]}},"activeRunCount":{"type":"number"},"oldestRunningAt":{"type":"string","nullable":true},"state":{"type":"string","enum":["DOCUMENTED","PENDING","HEALTHY","WARNING","FAILED","OVERDUE","RUNNING","RUNNING_TOO_LONG"]},"servers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]}},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}}},"required":["id","orgId","name","description","expectedEveryHours","token","lastPingAt","lastPingStatus","lastPingMessage","lastSizeBytes","createdAt","updatedAt","websites","jobs","activeRunCount","oldestRunningAt","state","servers","services"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}},"delete":{"operationId":"deleteBackupPlan","tags":["Backup Plans"],"summary":"Delete a backup plan","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"nullable":true}}}},"404":{"description":"Not found"}}}},"/api/v1/backup-plans/{id}/regenerate-token":{"post":{"operationId":"regenerateBackupPlanToken","tags":["Backup Plans"],"summary":"Regenerate the backup plan ping URL (invalidates the previous URL)","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"New token","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Plan not found"}}}},"/api/v1/backup/ping/{token}":{"post":{"operationId":"pingBackupPlan","tags":["Backup Plans"],"summary":"Report a backup start or result (public, token-authenticated)","parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"type":"object","properties":{"source":{"type":"string","enum":["updraftplus","client"]},"entries":{"type":"array","items":{"type":"object","properties":{"component":{"type":"string","enum":["files","database","backup"]},"intervalSeconds":{"type":"integer","nullable":true,"minimum":60,"maximum":31622400},"nextRunAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["component","intervalSeconds","nextRunAt"]},"minItems":1,"maxItems":2}},"required":["source","entries"]},"status":{"type":"string","enum":["start","success","warning","failure"],"default":"success"},"runId":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_.:-]+$"},"message":{"type":"string","maxLength":500},"sizeBytes":{"type":"number","minimum":0}}}}}},"responses":{"200":{"description":"Ping recorded","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Invalid ping"},"404":{"description":"Invalid token"},"429":{"description":"Too many open runs"}}},"get":{"operationId":"pingBackupPlanGet","tags":["Backup Plans"],"summary":"Report a backup start or result via GET (healthchecks.io compatible)","parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"path"},{"schema":{"type":"string","enum":["start","success","warning","failure","fail"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_.:-]+$"},"required":false,"name":"runId","in":"query"},{"schema":{"type":"string","maxLength":500},"required":false,"name":"message","in":"query"},{"schema":{"type":"number","nullable":true,"minimum":0},"required":false,"name":"sizeBytes","in":"query"}],"responses":{"200":{"description":"Ping recorded","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Invalid ping"},"404":{"description":"Invalid token"},"429":{"description":"Too many open runs"}}}},"/api/v1/backup/ping/{token}/{event}":{"get":{"operationId":"pingBackupEventGet","tags":["Backup Plans"],"summary":"Report a backup start or result via URL suffix","parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"path"},{"schema":{"type":"string","description":"start, success, fail, warning or an exit code 0–255"},"required":true,"description":"start, success, fail, warning or an exit code 0–255","name":"event","in":"path"},{"schema":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_.:-]+$"},"required":false,"name":"runId","in":"query"},{"schema":{"type":"string","maxLength":500},"required":false,"name":"message","in":"query"},{"schema":{"type":"number","nullable":true,"minimum":0},"required":false,"name":"sizeBytes","in":"query"}],"responses":{"200":{"description":"Ping recorded","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Invalid ping"},"404":{"description":"Invalid token"},"429":{"description":"Too many open runs"}}},"post":{"operationId":"pingBackupEvent","tags":["Backup Plans"],"summary":"Report a backup start or result via URL suffix with an optional JSON body","parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"path"},{"schema":{"type":"string","description":"start, success, fail, warning or an exit code 0–255"},"required":true,"description":"start, success, fail, warning or an exit code 0–255","name":"event","in":"path"}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"schedule":{"type":"object","properties":{"source":{"type":"string","enum":["updraftplus","client"]},"entries":{"type":"array","items":{"type":"object","properties":{"component":{"type":"string","enum":["files","database","backup"]},"intervalSeconds":{"type":"integer","nullable":true,"minimum":60,"maximum":31622400},"nextRunAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["component","intervalSeconds","nextRunAt"]},"minItems":1,"maxItems":2}},"required":["source","entries"]},"runId":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_.:-]+$"},"message":{"type":"string","maxLength":500},"sizeBytes":{"type":"number","minimum":0}}}}}},"responses":{"200":{"description":"Ping recorded","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Invalid ping"},"404":{"description":"Invalid token"},"429":{"description":"Too many open runs"}}}},"/api/v1/backup/coolify/{token}":{"post":{"operationId":"receiveCoolifyBackupWebhook","tags":["Backup Plans"],"summary":"Receive native Coolify backup events (secret URL; no start or duration)","parameters":[{"schema":{"type":"string"},"required":true,"name":"token","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","minLength":1,"maxLength":100},"database_uuid":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"message":{"type":"string","maxLength":10000},"success":{"type":"boolean"}},"required":["event"]}}}},"responses":{"200":{"description":"Accepted or ignored","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"result":{"type":"string"}},"required":["result"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Missing database UUID"},"404":{"description":"Invalid receiver or unmapped database"},"413":{"description":"Payload too large"}}}},"/api/v1/backup/proxmox/{token}":{"post":{"operationId":"receiveProxmoxBackupWebhook","tags":["Backup Plans"],"summary":"Receive Proxmox scheduled backup completion notifications","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"token","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"severity":{"type":"string","minLength":1,"maxLength":32},"timestamp":{"type":"integer","minimum":0,"maximum":253402300799},"title":{"type":"string","maxLength":1024},"fields":{"type":"object","properties":{"type":{"type":"string","minLength":1,"maxLength":100},"job-id":{"type":"string","minLength":1,"maxLength":128},"hostname":{"type":"string","minLength":1,"maxLength":255}},"required":["type"]}},"required":["severity","timestamp","title","fields"]}}}},"responses":{"200":{"description":"Accepted or ignored","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"result":{"type":"string"}},"required":["result"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Missing required metadata or unsupported severity"},"404":{"description":"Unknown receiver or mapping"},"409":{"description":"Ambiguous mapping"},"413":{"description":"Payload too large"}}}},"/api/v1/proxmox-backup-integration/{planId}":{"get":{"operationId":"getProxmoxBackupIntegration","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"planId","in":"path"}],"responses":{"200":{"description":"Proxmox integration","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","nullable":true,"properties":{"token":{"type":"string"},"mappings":{"type":"array","items":{"type":"object","properties":{"jobId":{"type":"string"},"externalJobId":{"type":"string"},"hostname":{"type":"string"}},"required":["jobId","externalJobId","hostname"]}}},"required":["token","mappings"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"operationId":"createProxmoxBackupIntegration","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"planId","in":"path"}],"responses":{"200":{"description":"Proxmox integration","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","nullable":true,"properties":{"token":{"type":"string"},"mappings":{"type":"array","items":{"type":"object","properties":{"jobId":{"type":"string"},"externalJobId":{"type":"string"},"hostname":{"type":"string"}},"required":["jobId","externalJobId","hostname"]}}},"required":["token","mappings"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Plan not found"}}}},"/api/v1/proxmox-backup-integration/{planId}/regenerate-token":{"post":{"operationId":"regenerateProxmoxBackupToken","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"planId","in":"path"}],"responses":{"200":{"description":"Proxmox integration","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","nullable":true,"properties":{"token":{"type":"string"},"mappings":{"type":"array","items":{"type":"object","properties":{"jobId":{"type":"string"},"externalJobId":{"type":"string"},"hostname":{"type":"string"}},"required":["jobId","externalJobId","hostname"]}}},"required":["token","mappings"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Integration not found"}}}},"/api/v1/proxmox-backup-integration/{planId}/mappings/{jobId}":{"put":{"operationId":"setProxmoxBackupMapping","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"planId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"jobId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"externalJobId":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[^\\s\\x00-\\x1f\\x7f]+$"},"hostname":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[a-zA-Z0-9._-]+$"}},"required":["externalJobId","hostname"]}}}},"responses":{"200":{"description":"Proxmox integration","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","nullable":true,"properties":{"token":{"type":"string"},"mappings":{"type":"array","items":{"type":"object","properties":{"jobId":{"type":"string"},"externalJobId":{"type":"string"},"hostname":{"type":"string"}},"required":["jobId","externalJobId","hostname"]}}},"required":["token","mappings"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Job or integration not found"},"409":{"description":"Job and node already mapped"}}},"delete":{"operationId":"deleteProxmoxBackupMapping","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"planId","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"Proxmox integration","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","nullable":true,"properties":{"token":{"type":"string"},"mappings":{"type":"array","items":{"type":"object","properties":{"jobId":{"type":"string"},"externalJobId":{"type":"string"},"hostname":{"type":"string"}},"required":["jobId","externalJobId","hostname"]}}},"required":["token","mappings"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/coolify-backup-integration":{"get":{"operationId":"getCoolifyBackupIntegration","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Coolify integration","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","nullable":true,"properties":{"token":{"type":"string"},"mappings":{"type":"array","items":{"type":"object","properties":{"jobId":{"type":"string"},"databaseUuid":{"type":"string"},"backupPlanId":{"type":"string"},"lastReceivedAt":{"type":"string","nullable":true}},"required":["jobId","databaseUuid","backupPlanId","lastReceivedAt"]}}},"required":["token","mappings"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"operationId":"createCoolifyBackupIntegration","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Coolify integration","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","nullable":true,"properties":{"token":{"type":"string"},"mappings":{"type":"array","items":{"type":"object","properties":{"jobId":{"type":"string"},"databaseUuid":{"type":"string"},"backupPlanId":{"type":"string"},"lastReceivedAt":{"type":"string","nullable":true}},"required":["jobId","databaseUuid","backupPlanId","lastReceivedAt"]}}},"required":["token","mappings"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/coolify-backup-integration/regenerate-token":{"post":{"operationId":"regenerateCoolifyBackupToken","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Coolify integration","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","nullable":true,"properties":{"token":{"type":"string"},"mappings":{"type":"array","items":{"type":"object","properties":{"jobId":{"type":"string"},"databaseUuid":{"type":"string"},"backupPlanId":{"type":"string"},"lastReceivedAt":{"type":"string","nullable":true}},"required":["jobId","databaseUuid","backupPlanId","lastReceivedAt"]}}},"required":["token","mappings"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Integration not enabled"}}}},"/api/v1/coolify-backup-integration/mappings/{jobId}":{"put":{"operationId":"setCoolifyBackupMapping","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"jobId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"databaseUuid":{"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"}},"required":["databaseUuid"]}}}},"responses":{"200":{"description":"Coolify integration","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","nullable":true,"properties":{"token":{"type":"string"},"mappings":{"type":"array","items":{"type":"object","properties":{"jobId":{"type":"string"},"databaseUuid":{"type":"string"},"backupPlanId":{"type":"string"},"lastReceivedAt":{"type":"string","nullable":true}},"required":["jobId","databaseUuid","backupPlanId","lastReceivedAt"]}}},"required":["token","mappings"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Job or integration not found"},"409":{"description":"Database already mapped to another job"}}},"delete":{"operationId":"deleteCoolifyBackupMapping","tags":["Backup Plans"],"security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"jobId","in":"path"}],"responses":{"200":{"description":"Coolify integration","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","nullable":true,"properties":{"token":{"type":"string"},"mappings":{"type":"array","items":{"type":"object","properties":{"jobId":{"type":"string"},"databaseUuid":{"type":"string"},"backupPlanId":{"type":"string"},"lastReceivedAt":{"type":"string","nullable":true}},"required":["jobId","databaseUuid","backupPlanId","lastReceivedAt"]}}},"required":["token","mappings"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/servers/{id}/services/discovered":{"get":{"operationId":"getDiscoveredPorts","tags":["Server Services"],"summary":"Get discovered open ports (from last agent scan)","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Discovered ports","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"scannedAt":{"type":"string","nullable":true},"ports":{"type":"array","items":{"type":"object","properties":{"port":{"type":"number"},"protocol":{"type":"string"}},"required":["port","protocol"]}}},"required":["scannedAt","ports"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/services":{"get":{"operationId":"listServerServices","tags":["Server Services"],"summary":"List services for a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Services list","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"serverId":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"port":{"type":"number","nullable":true},"protocol":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"serviceUrl":{"type":"string","nullable":true},"lastStatus":{"type":"string","nullable":true},"lastCheckedAt":{"type":"string","nullable":true},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","serverId","orgId","name","type","port","protocol","description","serviceUrl","lastStatus","lastCheckedAt","lastError","createdAt","updatedAt"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}},"post":{"operationId":"createServerService","tags":["Server Services"],"summary":"Create a service for a server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","nullable":true,"maxLength":50},"port":{"type":"integer","nullable":true,"minimum":1,"maximum":65535},"protocol":{"type":"string","nullable":true,"maxLength":10},"description":{"type":"string","nullable":true,"maxLength":500},"serviceUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri"}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"serverId":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"port":{"type":"number","nullable":true},"protocol":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"serviceUrl":{"type":"string","nullable":true},"lastStatus":{"type":"string","nullable":true},"lastCheckedAt":{"type":"string","nullable":true},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","serverId","orgId","name","type","port","protocol","description","serviceUrl","lastStatus","lastCheckedAt","lastError","createdAt","updatedAt"]}}}},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/services/{serviceId}":{"get":{"operationId":"getServerService","tags":["Server Services"],"summary":"Get a service with its server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"serviceId","in":"path"}],"responses":{"200":{"description":"Service","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"serverId":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"port":{"type":"number","nullable":true},"protocol":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"serviceUrl":{"type":"string","nullable":true},"lastStatus":{"type":"string","nullable":true},"lastCheckedAt":{"type":"string","nullable":true},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"server":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hostname":{"type":"string"}},"required":["id","name","hostname"]}},"required":["id","serverId","orgId","name","type","port","protocol","description","serviceUrl","lastStatus","lastCheckedAt","lastError","createdAt","updatedAt","server"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}},"patch":{"operationId":"updateServerService","tags":["Server Services"],"summary":"Update a service","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"serviceId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"type":{"type":"string","nullable":true,"maxLength":50},"port":{"type":"integer","nullable":true,"minimum":1,"maximum":65535},"protocol":{"type":"string","nullable":true,"maxLength":10},"description":{"type":"string","nullable":true,"maxLength":500},"serviceUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri"},"serverId":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"serverId":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"port":{"type":"number","nullable":true},"protocol":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"serviceUrl":{"type":"string","nullable":true},"lastStatus":{"type":"string","nullable":true},"lastCheckedAt":{"type":"string","nullable":true},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","serverId","orgId","name","type","port","protocol","description","serviceUrl","lastStatus","lastCheckedAt","lastError","createdAt","updatedAt"]}}}},"404":{"description":"Not found"}}},"delete":{"operationId":"deleteServerService","tags":["Server Services"],"summary":"Delete a service","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"serviceId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"nullable":true}}}},"404":{"description":"Not found"}}}},"/api/v1/services":{"get":{"operationId":"listAllServices","tags":["Server Services"],"summary":"List all services across all servers","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"All services","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"serverId":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"port":{"type":"number","nullable":true},"protocol":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"serviceUrl":{"type":"string","nullable":true},"lastStatus":{"type":"string","nullable":true},"lastCheckedAt":{"type":"string","nullable":true},"lastError":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"server":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hostname":{"type":"string"}},"required":["id","name","hostname"]}},"required":["id","serverId","orgId","name","type","port","protocol","description","serviceUrl","lastStatus","lastCheckedAt","lastError","createdAt","updatedAt","server"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/ip-networks":{"get":{"operationId":"listIpNetworks","tags":["IP Management"],"summary":"List IP networks","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Networks list","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"cidr":{"type":"string"},"description":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","orgId","name","cidr","description","createdAt","updatedAt"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"operationId":"createIpNetwork","tags":["IP Management"],"summary":"Create an IP network","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"cidr":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","nullable":true,"maxLength":500}},"required":["name","cidr"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"cidr":{"type":"string"},"description":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","orgId","name","cidr","description","createdAt","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/ip-networks/{networkId}":{"get":{"operationId":"getIpNetwork","tags":["IP Management"],"summary":"Get an IP network","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"networkId","in":"path"}],"responses":{"200":{"description":"Network","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"cidr":{"type":"string"},"description":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","orgId","name","cidr","description","createdAt","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}},"patch":{"operationId":"updateIpNetwork","tags":["IP Management"],"summary":"Update an IP network","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"networkId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"cidr":{"type":"string","minLength":1,"maxLength":50},"description":{"type":"string","nullable":true,"maxLength":500}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"cidr":{"type":"string"},"description":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","orgId","name","cidr","description","createdAt","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}},"delete":{"operationId":"deleteIpNetwork","tags":["IP Management"],"summary":"Delete an IP network","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"networkId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"nullable":true}}}},"404":{"description":"Not found"}}}},"/api/v1/ip-assignments":{"get":{"operationId":"listIpAssignments","tags":["IP Management"],"summary":"List IP assignments (filterable by network or server)","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"networkId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"serverId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Assignments list","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"networkId":{"type":"string"},"network":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"cidr":{"type":"string"}},"required":["id","name","cidr"]},"serverId":{"type":"string","nullable":true},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"serviceId":{"type":"string","nullable":true},"service":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]},"ipAddress":{"type":"string"},"port":{"type":"number","nullable":true},"label":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","orgId","networkId","serverId","serviceId","ipAddress","port","label","description","createdAt","updatedAt"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"operationId":"createIpAssignment","tags":["IP Management"],"summary":"Create an IP assignment","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"networkId":{"type":"string"},"serverId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"ipAddress":{"type":"string","minLength":1,"maxLength":45},"port":{"type":"integer","nullable":true,"minimum":1,"maximum":65535},"label":{"type":"string","nullable":true,"maxLength":100},"description":{"type":"string","nullable":true,"maxLength":500}},"required":["networkId","ipAddress"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"networkId":{"type":"string"},"network":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"cidr":{"type":"string"}},"required":["id","name","cidr"]},"serverId":{"type":"string","nullable":true},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"serviceId":{"type":"string","nullable":true},"service":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]},"ipAddress":{"type":"string"},"port":{"type":"number","nullable":true},"label":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","orgId","networkId","serverId","serviceId","ipAddress","port","label","description","createdAt","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Network or server not found"}}}},"/api/v1/ip-assignments/suggestions":{"get":{"operationId":"listIpSuggestions","tags":["IP Management"],"summary":"Suggest IPs discovered on servers that match org networks and are not yet assigned","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Suggested IP assignments","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"ipAddress":{"type":"string"},"family":{"type":"string","enum":["inet","inet6"]},"interfaceName":{"type":"string"},"serverId":{"type":"string"},"serverName":{"type":"string"},"networkId":{"type":"string"},"networkName":{"type":"string"},"networkCidr":{"type":"string"}},"required":["ipAddress","interfaceName","serverId","serverName","networkId","networkName","networkCidr"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/ip-assignments/{assignmentId}":{"get":{"operationId":"getIpAssignment","tags":["IP Management"],"summary":"Get an IP assignment","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"assignmentId","in":"path"}],"responses":{"200":{"description":"Assignment","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"networkId":{"type":"string"},"network":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"cidr":{"type":"string"}},"required":["id","name","cidr"]},"serverId":{"type":"string","nullable":true},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"serviceId":{"type":"string","nullable":true},"service":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]},"ipAddress":{"type":"string"},"port":{"type":"number","nullable":true},"label":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","orgId","networkId","serverId","serviceId","ipAddress","port","label","description","createdAt","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}},"patch":{"operationId":"updateIpAssignment","tags":["IP Management"],"summary":"Update an IP assignment","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"assignmentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"networkId":{"type":"string"},"serverId":{"type":"string","nullable":true},"serviceId":{"type":"string","nullable":true},"ipAddress":{"type":"string","minLength":1,"maxLength":45},"port":{"type":"integer","nullable":true,"minimum":1,"maximum":65535},"label":{"type":"string","nullable":true,"maxLength":100},"description":{"type":"string","nullable":true,"maxLength":500}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"orgId":{"type":"string"},"networkId":{"type":"string"},"network":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"cidr":{"type":"string"}},"required":["id","name","cidr"]},"serverId":{"type":"string","nullable":true},"server":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"}},"required":["id","name"]},"serviceId":{"type":"string","nullable":true},"service":{"type":"object","nullable":true,"properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]},"ipAddress":{"type":"string"},"port":{"type":"number","nullable":true},"label":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}},"required":["id","orgId","networkId","serverId","serviceId","ipAddress","port","label","description","createdAt","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}},"delete":{"operationId":"deleteIpAssignment","tags":["IP Management"],"summary":"Delete an IP assignment","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"assignmentId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"nullable":true}}}},"404":{"description":"Not found"}}}},"/api/v1/projects":{"get":{"operationId":"listProjects","tags":["Projects"],"summary":"List all projects","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":500,"default":20},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Projects list","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"websites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","name","url","tags"]},"default":[]},"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"servers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hostname":{"type":"string"}},"required":["id","name","hostname"]}},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}},"ipAssignments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ipAddress":{"type":"string"},"label":{"type":"string","nullable":true},"network":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"cidr":{"type":"string"}},"required":["id","name","cidr"]}},"required":["id","ipAddress","label"]}}},"required":["id","orgId","name","description","color","createdAt","updatedAt","servers","services","ipAssignments"]}},"nextCursor":{"type":"string"}},"required":["items"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"operationId":"createProject","tags":["Projects"],"summary":"Create a project","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","nullable":true,"maxLength":500},"color":{"type":"string","nullable":true,"maxLength":20},"serverIds":{"type":"array","items":{"type":"string"}},"serviceIds":{"type":"array","items":{"type":"string"}},"ipAssignmentIds":{"type":"array","items":{"type":"string"}}},"required":["name"]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"websites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","name","url","tags"]},"default":[]},"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"servers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hostname":{"type":"string"}},"required":["id","name","hostname"]}},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}},"ipAssignments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ipAddress":{"type":"string"},"label":{"type":"string","nullable":true},"network":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"cidr":{"type":"string"}},"required":["id","name","cidr"]}},"required":["id","ipAddress","label"]}}},"required":["id","orgId","name","description","color","createdAt","updatedAt","servers","services","ipAssignments"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/projects/{id}":{"get":{"operationId":"getProject","tags":["Projects"],"summary":"Get a single project with all assignments","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Project","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"websites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","name","url","tags"]},"default":[]},"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"servers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hostname":{"type":"string"}},"required":["id","name","hostname"]}},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}},"ipAssignments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ipAddress":{"type":"string"},"label":{"type":"string","nullable":true},"network":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"cidr":{"type":"string"}},"required":["id","name","cidr"]}},"required":["id","ipAddress","label"]}}},"required":["id","orgId","name","description","color","createdAt","updatedAt","servers","services","ipAssignments"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}},"patch":{"operationId":"updateProject","tags":["Projects"],"summary":"Update a project and replace its assignments","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","nullable":true,"maxLength":500},"color":{"type":"string","nullable":true,"maxLength":20},"serverIds":{"type":"array","items":{"type":"string"}},"serviceIds":{"type":"array","items":{"type":"string"}},"ipAssignmentIds":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"websites":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}}},"required":["id","name","url","tags"]},"default":[]},"id":{"type":"string"},"orgId":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"color":{"type":"string","nullable":true},"createdAt":{"type":"string"},"updatedAt":{"type":"string"},"servers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"hostname":{"type":"string"}},"required":["id","name","hostname"]}},"services":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","nullable":true},"serverId":{"type":"string"}},"required":["id","name","type","serverId"]}},"ipAssignments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"ipAddress":{"type":"string"},"label":{"type":"string","nullable":true},"network":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"cidr":{"type":"string"}},"required":["id","name","cidr"]}},"required":["id","ipAddress","label"]}}},"required":["id","orgId","name","description","color","createdAt","updatedAt","servers","services","ipAssignments"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}},"delete":{"operationId":"deleteProject","tags":["Projects"],"summary":"Delete a project","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"nullable":true}}}},"404":{"description":"Not found"}}}},"/api/v1/website-alert-rules":{"get":{"tags":["Website Alert Rules"],"security":[{"cookieAuth":[]}],"operationId":"listWebsiteAlertRules","parameters":[{"schema":{"type":"string","format":"uuid"},"required":false,"name":"monitorId","in":"query"}],"responses":{"200":{"description":"Website alert rules","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"monitorId":{"type":"string","nullable":true,"format":"uuid","default":null},"monitorIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"statusCodes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"maxItems":500,"default":[]},"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["DOWN","RESPONSE_TIME","TLS_EXPIRY","HTTP_STATUS_IN","HTTP_STATUS_NOT_IN"]},"threshold":{"type":"number","minimum":0,"maximum":86400000},"consecutiveChecks":{"type":"integer","minimum":1,"maximum":100,"default":1},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true},"states":{"type":"array","items":{"type":"object","properties":{"monitorId":{"type":"string"},"breachCount":{"type":"number"},"activeSince":{"type":"string","nullable":true,"format":"date-time"}},"required":["monitorId","breachCount","activeSince"]},"default":[]},"id":{"type":"string"},"breachCount":{"type":"number"},"activeSince":{"type":"string","nullable":true,"format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","kind","threshold","id","breachCount","activeSince","updatedAt"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"tags":["Website Alert Rules"],"security":[{"cookieAuth":[]}],"operationId":"createWebsiteAlertRule","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"monitorId":{"type":"string","nullable":true,"format":"uuid","default":null},"monitorIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"statusCodes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"maxItems":500,"default":[]},"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["DOWN","RESPONSE_TIME","TLS_EXPIRY","HTTP_STATUS_IN","HTTP_STATUS_NOT_IN"]},"threshold":{"type":"number","minimum":0,"maximum":86400000},"consecutiveChecks":{"type":"integer","minimum":1,"maximum":100,"default":1},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true}},"required":["name","kind","threshold"]}}}},"responses":{"200":{"description":"Website alert rule","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"monitorId":{"type":"string","nullable":true,"format":"uuid","default":null},"monitorIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"statusCodes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"maxItems":500,"default":[]},"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["DOWN","RESPONSE_TIME","TLS_EXPIRY","HTTP_STATUS_IN","HTTP_STATUS_NOT_IN"]},"threshold":{"type":"number","minimum":0,"maximum":86400000},"consecutiveChecks":{"type":"integer","minimum":1,"maximum":100,"default":1},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true},"states":{"type":"array","items":{"type":"object","properties":{"monitorId":{"type":"string"},"breachCount":{"type":"number"},"activeSince":{"type":"string","nullable":true,"format":"date-time"}},"required":["monitorId","breachCount","activeSince"]},"default":[]},"id":{"type":"string"},"breachCount":{"type":"number"},"activeSince":{"type":"string","nullable":true,"format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","kind","threshold","id","breachCount","activeSince","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid rule"},"403":{"description":"Forbidden or plan limit reached"},"404":{"description":"Not found"}}}},"/api/v1/website-alert-rules/{id}":{"get":{"tags":["Website Alert Rules"],"security":[{"cookieAuth":[]}],"operationId":"getWebsiteAlertRule","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Website alert rule","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"monitorId":{"type":"string","nullable":true,"format":"uuid","default":null},"monitorIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"statusCodes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"maxItems":500,"default":[]},"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["DOWN","RESPONSE_TIME","TLS_EXPIRY","HTTP_STATUS_IN","HTTP_STATUS_NOT_IN"]},"threshold":{"type":"number","minimum":0,"maximum":86400000},"consecutiveChecks":{"type":"integer","minimum":1,"maximum":100,"default":1},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true},"states":{"type":"array","items":{"type":"object","properties":{"monitorId":{"type":"string"},"breachCount":{"type":"number"},"activeSince":{"type":"string","nullable":true,"format":"date-time"}},"required":["monitorId","breachCount","activeSince"]},"default":[]},"id":{"type":"string"},"breachCount":{"type":"number"},"activeSince":{"type":"string","nullable":true,"format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","kind","threshold","id","breachCount","activeSince","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}},"put":{"tags":["Website Alert Rules"],"security":[{"cookieAuth":[]}],"operationId":"updateWebsiteAlertRule","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"monitorId":{"type":"string","nullable":true,"format":"uuid","default":null},"monitorIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"statusCodes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"maxItems":500,"default":[]},"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["DOWN","RESPONSE_TIME","TLS_EXPIRY","HTTP_STATUS_IN","HTTP_STATUS_NOT_IN"]},"threshold":{"type":"number","minimum":0,"maximum":86400000},"consecutiveChecks":{"type":"integer","minimum":1,"maximum":100,"default":1},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true}},"required":["name","kind","threshold"]}}}},"responses":{"200":{"description":"Website alert rule","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"monitorId":{"type":"string","nullable":true,"format":"uuid","default":null},"monitorIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"statusCodes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"maxItems":500,"default":[]},"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["DOWN","RESPONSE_TIME","TLS_EXPIRY","HTTP_STATUS_IN","HTTP_STATUS_NOT_IN"]},"threshold":{"type":"number","minimum":0,"maximum":86400000},"consecutiveChecks":{"type":"integer","minimum":1,"maximum":100,"default":1},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true},"states":{"type":"array","items":{"type":"object","properties":{"monitorId":{"type":"string"},"breachCount":{"type":"number"},"activeSince":{"type":"string","nullable":true,"format":"date-time"}},"required":["monitorId","breachCount","activeSince"]},"default":[]},"id":{"type":"string"},"breachCount":{"type":"number"},"activeSince":{"type":"string","nullable":true,"format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","kind","threshold","id","breachCount","activeSince","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid rule"},"403":{"description":"Forbidden or plan limit reached"},"404":{"description":"Not found"}}},"delete":{"tags":["Website Alert Rules"],"security":[{"cookieAuth":[]}],"operationId":"deleteWebsiteAlertRule","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"nullable":true}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}}},"/api/v1/website-alert-rules/{id}/enabled":{"patch":{"tags":["Website Alert Rules"],"security":[{"cookieAuth":[]}],"operationId":"setWebsiteAlertRuleEnabled","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}}},"responses":{"200":{"description":"Website alert rule","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"monitorId":{"type":"string","nullable":true,"format":"uuid","default":null},"monitorIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":100,"default":[]},"statusCodes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"maxItems":500,"default":[]},"name":{"type":"string","minLength":1,"maxLength":100},"kind":{"type":"string","enum":["DOWN","RESPONSE_TIME","TLS_EXPIRY","HTTP_STATUS_IN","HTTP_STATUS_NOT_IN"]},"threshold":{"type":"number","minimum":0,"maximum":86400000},"consecutiveChecks":{"type":"integer","minimum":1,"maximum":100,"default":1},"severity":{"type":"string","enum":["WARNING","CRITICAL"],"default":"WARNING"},"channelIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":20,"default":[]},"escalationChannelId":{"type":"string","nullable":true,"format":"uuid","default":null},"escalationAfterMinutes":{"type":"integer","minimum":0,"maximum":1440,"default":0},"enabled":{"type":"boolean","default":true},"states":{"type":"array","items":{"type":"object","properties":{"monitorId":{"type":"string"},"breachCount":{"type":"number"},"activeSince":{"type":"string","nullable":true,"format":"date-time"}},"required":["monitorId","breachCount","activeSince"]},"default":[]},"id":{"type":"string"},"breachCount":{"type":"number"},"activeSince":{"type":"string","nullable":true,"format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","kind","threshold","id","breachCount","activeSince","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid rule"},"403":{"description":"Forbidden or plan limit reached"},"404":{"description":"Not found"}}}},"/api/v1/websites":{"get":{"tags":["Websites"],"security":[{"cookieAuth":[]}],"operationId":"listWebsiteMonitors","responses":{"200":{"description":"Monitors (maximum 100 per organization)","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^,\\r\\n]+$"},"maxItems":20,"default":[]},"projectId":{"type":"string","nullable":true,"format":"uuid","default":null},"name":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","maxLength":2048,"format":"uri"},"intervalSeconds":{"type":"integer","minimum":60,"maximum":86400,"default":60},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":30,"default":15},"expectedStatus":{"type":"integer","minimum":100,"maximum":599,"default":200},"statusPolicy":{"type":"object","nullable":true,"properties":{"mode":{"type":"string","enum":["ALLOW","DENY"]},"codes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"minItems":1,"maxItems":500}},"default":null,"required":["mode","codes"]},"keyword":{"type":"string","nullable":true,"maxLength":500,"default":null},"failureThreshold":{"type":"integer","minimum":1,"maximum":10,"default":3},"enabled":{"type":"boolean","default":true},"autoIncident":{"type":"boolean","default":true},"scanIntervalSeconds":{"type":"integer","nullable":true,"minimum":3600,"maximum":2592000,"default":null},"maintenanceUntil":{"type":"string","nullable":true,"format":"date-time","default":null},"maintenanceActive":{"type":"boolean","default":false},"id":{"type":"string"},"status":{"type":"string","enum":["PENDING","UP","DOWN"]},"consecutiveFailures":{"type":"number"},"nextScanAt":{"type":"string","nullable":true,"format":"date-time","default":null},"lastScanAt":{"type":"string","nullable":true,"format":"date-time","default":null},"lastScanError":{"type":"string","nullable":true,"default":null},"lastCheckedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","url","id","status","consecutiveFailures","lastCheckedAt","createdAt","updatedAt"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"tags":["Websites"],"security":[{"cookieAuth":[]}],"operationId":"createWebsiteMonitor","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^,\\r\\n]+$"},"maxItems":20,"default":[]},"projectId":{"type":"string","nullable":true,"format":"uuid","default":null},"name":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","maxLength":2048,"format":"uri"},"intervalSeconds":{"type":"integer","minimum":60,"maximum":86400,"default":60},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":30,"default":15},"expectedStatus":{"type":"integer","minimum":100,"maximum":599,"default":200},"statusPolicy":{"type":"object","nullable":true,"properties":{"mode":{"type":"string","enum":["ALLOW","DENY"]},"codes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"minItems":1,"maxItems":500}},"default":null,"required":["mode","codes"]},"keyword":{"type":"string","nullable":true,"maxLength":500,"default":null},"failureThreshold":{"type":"integer","minimum":1,"maximum":10,"default":3},"enabled":{"type":"boolean","default":true},"autoIncident":{"type":"boolean","default":true},"scanIntervalSeconds":{"type":"integer","nullable":true,"minimum":3600,"maximum":2592000,"default":null},"maintenanceUntil":{"type":"string","nullable":true,"format":"date-time","default":null}},"required":["name","url"]}}}},"responses":{"200":{"description":"Monitor","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^,\\r\\n]+$"},"maxItems":20,"default":[]},"projectId":{"type":"string","nullable":true,"format":"uuid","default":null},"name":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","maxLength":2048,"format":"uri"},"intervalSeconds":{"type":"integer","minimum":60,"maximum":86400,"default":60},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":30,"default":15},"expectedStatus":{"type":"integer","minimum":100,"maximum":599,"default":200},"statusPolicy":{"type":"object","nullable":true,"properties":{"mode":{"type":"string","enum":["ALLOW","DENY"]},"codes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"minItems":1,"maxItems":500}},"default":null,"required":["mode","codes"]},"keyword":{"type":"string","nullable":true,"maxLength":500,"default":null},"failureThreshold":{"type":"integer","minimum":1,"maximum":10,"default":3},"enabled":{"type":"boolean","default":true},"autoIncident":{"type":"boolean","default":true},"scanIntervalSeconds":{"type":"integer","nullable":true,"minimum":3600,"maximum":2592000,"default":null},"maintenanceUntil":{"type":"string","nullable":true,"format":"date-time","default":null},"maintenanceActive":{"type":"boolean","default":false},"id":{"type":"string"},"status":{"type":"string","enum":["PENDING","UP","DOWN"]},"consecutiveFailures":{"type":"number"},"nextScanAt":{"type":"string","nullable":true,"format":"date-time","default":null},"lastScanAt":{"type":"string","nullable":true,"format":"date-time","default":null},"lastScanError":{"type":"string","nullable":true,"default":null},"lastCheckedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","url","id","status","consecutiveFailures","lastCheckedAt","createdAt","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request"},"403":{"description":"Admin role required"},"404":{"description":"Monitor not found"},"429":{"description":"Resource or request limit reached"}}}},"/api/v1/websites/checks/recent":{"get":{"tags":["Websites"],"security":[{"cookieAuth":[]}],"operationId":"listRecentWebsiteChecks","summary":"Latest checks of several websites in one request","parameters":[{"schema":{"type":"string"},"required":true,"name":"ids","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":40},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Latest checks per website","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"monitorId":{"type":"string"},"checks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"up":{"type":"boolean"},"statusCode":{"type":"number","nullable":true},"responseMs":{"type":"number"},"error":{"type":"string","nullable":true},"checkedAt":{"type":"string","format":"date-time"}},"required":["id","up","statusCode","responseMs","error","checkedAt"]}}},"required":["monitorId","checks"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request"},"403":{"description":"Admin role required"},"404":{"description":"Monitor not found"},"429":{"description":"Resource or request limit reached"}}}},"/api/v1/websites/{id}":{"get":{"tags":["Websites"],"security":[{"cookieAuth":[]}],"operationId":"getWebsiteMonitor","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Monitor","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^,\\r\\n]+$"},"maxItems":20,"default":[]},"projectId":{"type":"string","nullable":true,"format":"uuid","default":null},"name":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","maxLength":2048,"format":"uri"},"intervalSeconds":{"type":"integer","minimum":60,"maximum":86400,"default":60},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":30,"default":15},"expectedStatus":{"type":"integer","minimum":100,"maximum":599,"default":200},"statusPolicy":{"type":"object","nullable":true,"properties":{"mode":{"type":"string","enum":["ALLOW","DENY"]},"codes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"minItems":1,"maxItems":500}},"default":null,"required":["mode","codes"]},"keyword":{"type":"string","nullable":true,"maxLength":500,"default":null},"failureThreshold":{"type":"integer","minimum":1,"maximum":10,"default":3},"enabled":{"type":"boolean","default":true},"autoIncident":{"type":"boolean","default":true},"scanIntervalSeconds":{"type":"integer","nullable":true,"minimum":3600,"maximum":2592000,"default":null},"maintenanceUntil":{"type":"string","nullable":true,"format":"date-time","default":null},"maintenanceActive":{"type":"boolean","default":false},"id":{"type":"string"},"status":{"type":"string","enum":["PENDING","UP","DOWN"]},"consecutiveFailures":{"type":"number"},"nextScanAt":{"type":"string","nullable":true,"format":"date-time","default":null},"lastScanAt":{"type":"string","nullable":true,"format":"date-time","default":null},"lastScanError":{"type":"string","nullable":true,"default":null},"lastCheckedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","url","id","status","consecutiveFailures","lastCheckedAt","createdAt","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request"},"403":{"description":"Admin role required"},"404":{"description":"Monitor not found"},"429":{"description":"Resource or request limit reached"}}},"patch":{"tags":["Websites"],"security":[{"cookieAuth":[]}],"operationId":"updateWebsiteMonitor","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^,\\r\\n]+$"},"maxItems":20},"projectId":{"type":"string","nullable":true,"format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","maxLength":2048,"format":"uri"},"intervalSeconds":{"type":"integer","minimum":60,"maximum":86400},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":30},"expectedStatus":{"type":"integer","minimum":100,"maximum":599},"statusPolicy":{"type":"object","nullable":true,"properties":{"mode":{"type":"string","enum":["ALLOW","DENY"]},"codes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"minItems":1,"maxItems":500}},"required":["mode","codes"]},"keyword":{"type":"string","nullable":true,"maxLength":500},"failureThreshold":{"type":"integer","minimum":1,"maximum":10},"enabled":{"type":"boolean"},"autoIncident":{"type":"boolean"},"scanIntervalSeconds":{"type":"integer","nullable":true,"minimum":3600,"maximum":2592000},"maintenanceUntil":{"type":"string","nullable":true,"format":"date-time"}}}}}},"responses":{"200":{"description":"Monitor","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[^,\\r\\n]+$"},"maxItems":20,"default":[]},"projectId":{"type":"string","nullable":true,"format":"uuid","default":null},"name":{"type":"string","minLength":1,"maxLength":120},"url":{"type":"string","maxLength":2048,"format":"uri"},"intervalSeconds":{"type":"integer","minimum":60,"maximum":86400,"default":60},"timeoutSeconds":{"type":"integer","minimum":1,"maximum":30,"default":15},"expectedStatus":{"type":"integer","minimum":100,"maximum":599,"default":200},"statusPolicy":{"type":"object","nullable":true,"properties":{"mode":{"type":"string","enum":["ALLOW","DENY"]},"codes":{"type":"array","items":{"type":"integer","minimum":100,"maximum":599},"minItems":1,"maxItems":500}},"default":null,"required":["mode","codes"]},"keyword":{"type":"string","nullable":true,"maxLength":500,"default":null},"failureThreshold":{"type":"integer","minimum":1,"maximum":10,"default":3},"enabled":{"type":"boolean","default":true},"autoIncident":{"type":"boolean","default":true},"scanIntervalSeconds":{"type":"integer","nullable":true,"minimum":3600,"maximum":2592000,"default":null},"maintenanceUntil":{"type":"string","nullable":true,"format":"date-time","default":null},"maintenanceActive":{"type":"boolean","default":false},"id":{"type":"string"},"status":{"type":"string","enum":["PENDING","UP","DOWN"]},"consecutiveFailures":{"type":"number"},"nextScanAt":{"type":"string","nullable":true,"format":"date-time","default":null},"lastScanAt":{"type":"string","nullable":true,"format":"date-time","default":null},"lastScanError":{"type":"string","nullable":true,"default":null},"lastCheckedAt":{"type":"string","nullable":true,"format":"date-time"},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}},"required":["name","url","id","status","consecutiveFailures","lastCheckedAt","createdAt","updatedAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request"},"403":{"description":"Admin role required"},"404":{"description":"Monitor not found"},"429":{"description":"Resource or request limit reached"}}},"delete":{"tags":["Websites"],"security":[{"cookieAuth":[]}],"operationId":"deleteWebsiteMonitor","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request"},"403":{"description":"Admin role required"},"404":{"description":"Monitor not found"},"429":{"description":"Resource or request limit reached"}}}},"/api/v1/websites/{id}/checks":{"get":{"tags":["Websites"],"security":[{"cookieAuth":[]}],"operationId":"listWebsiteChecks","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":200,"default":100},"required":false,"name":"limit","in":"query"}],"responses":{"200":{"description":"Latest checks","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"up":{"type":"boolean"},"statusCode":{"type":"number","nullable":true},"responseMs":{"type":"number"},"error":{"type":"string","nullable":true},"checkedAt":{"type":"string","format":"date-time"}},"required":["id","up","statusCode","responseMs","error","checkedAt"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request"},"403":{"description":"Admin role required"},"404":{"description":"Monitor not found"},"429":{"description":"Resource or request limit reached"}}}},"/api/v1/websites/{id}/scan":{"post":{"tags":["Websites"],"security":[{"cookieAuth":[]}],"operationId":"scanWebsiteMonitor","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Stored HTTP security scan (not a browser scan)","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"report":{"type":"object","properties":{"finalUrl":{"type":"string"},"statusCode":{"type":"number"},"responseMs":{"type":"number"},"redirects":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"number"},"location":{"type":"string"}},"required":["url","status","location"]}},"tls":{"type":"object","nullable":true,"properties":{"protocol":{"type":"string","nullable":true},"issuer":{"type":"string","nullable":true},"validTo":{"type":"string","nullable":true},"daysRemaining":{"type":"number","nullable":true}},"required":["protocol","issuer","validTo","daysRemaining"]},"findings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pass","warning","fail","not_tested"]},"title":{"type":"string"},"detail":{"type":"string"},"recommendation":{"type":"string"}},"required":["id","status","title","detail","recommendation"]}},"cookies":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"secure":{"type":"boolean"},"httpOnly":{"type":"boolean"},"sameSite":{"type":"string","nullable":true}},"required":["name","secure","httpOnly","sameSite"]}},"headers":{"type":"object","additionalProperties":{"type":"string"}},"limitations":{"type":"array","items":{"type":"string"}}},"required":["finalUrl","statusCode","responseMs","redirects","tls","findings","cookies","headers","limitations"]}},"required":["id","createdAt","report"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request"},"403":{"description":"Admin role required"},"404":{"description":"Monitor not found"},"429":{"description":"Resource or request limit reached"},"502":{"description":"Scan target request failed"}}}},"/api/v1/websites/{id}/scans":{"get":{"tags":["Websites"],"security":[{"cookieAuth":[]}],"operationId":"listWebsiteScans","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Latest 20 scans","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"report":{"type":"object","properties":{"finalUrl":{"type":"string"},"statusCode":{"type":"number"},"responseMs":{"type":"number"},"redirects":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string"},"status":{"type":"number"},"location":{"type":"string"}},"required":["url","status","location"]}},"tls":{"type":"object","nullable":true,"properties":{"protocol":{"type":"string","nullable":true},"issuer":{"type":"string","nullable":true},"validTo":{"type":"string","nullable":true},"daysRemaining":{"type":"number","nullable":true}},"required":["protocol","issuer","validTo","daysRemaining"]},"findings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["pass","warning","fail","not_tested"]},"title":{"type":"string"},"detail":{"type":"string"},"recommendation":{"type":"string"}},"required":["id","status","title","detail","recommendation"]}},"cookies":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"secure":{"type":"boolean"},"httpOnly":{"type":"boolean"},"sameSite":{"type":"string","nullable":true}},"required":["name","secure","httpOnly","sameSite"]}},"headers":{"type":"object","additionalProperties":{"type":"string"}},"limitations":{"type":"array","items":{"type":"string"}}},"required":["finalUrl","statusCode","responseMs","redirects","tls","findings","cookies","headers","limitations"]}},"required":["id","createdAt","report"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request"},"403":{"description":"Admin role required"},"404":{"description":"Monitor not found"},"429":{"description":"Resource or request limit reached"}}}},"/api/v1/status-pages/{id}/maintenances":{"get":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"listStatusPageMaintenances","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"monitorIds":{"type":"array","items":{"type":"string"},"default":[]},"suppressAlerts":{"type":"boolean","default":false},"notifyBeforeMinutes":{"type":"number","default":30},"id":{"type":"string"},"title":{"type":"string"},"message":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"cancelledAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","title","message","startsAt","endsAt","cancelledAt"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Admin required"},"404":{"description":"Not found"},"409":{"description":"Conflict"},"429":{"description":"Limit reached"},"502":{"description":"Cloudflare failure"},"503":{"description":"Custom domains not configured"}}},"post":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"createStatusPageMaintenance","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"monitorIds":{"type":"array","items":{"type":"string","format":"uuid"},"maxItems":50,"default":[]},"suppressAlerts":{"type":"boolean","default":false},"notifyBeforeMinutes":{"type":"integer","minimum":0,"maximum":10080,"default":30},"title":{"type":"string","minLength":1,"maxLength":200},"message":{"type":"string","minLength":1,"maxLength":10000},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"}},"required":["title","message","startsAt","endsAt"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"monitorIds":{"type":"array","items":{"type":"string"},"default":[]},"suppressAlerts":{"type":"boolean","default":false},"notifyBeforeMinutes":{"type":"number","default":30},"id":{"type":"string"},"title":{"type":"string"},"message":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"cancelledAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","title","message","startsAt","endsAt","cancelledAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Admin required"},"404":{"description":"Not found"},"409":{"description":"Conflict"},"429":{"description":"Limit reached"},"502":{"description":"Cloudflare failure"},"503":{"description":"Custom domains not configured"}}}},"/api/v1/status-pages/{id}/maintenances/{maintenanceId}":{"delete":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"cancelStatusPageMaintenance","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"maintenanceId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"cancelled":{"type":"boolean"}},"required":["cancelled"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Admin required"},"404":{"description":"Not found"},"409":{"description":"Conflict"},"429":{"description":"Limit reached"},"502":{"description":"Cloudflare failure"},"503":{"description":"Custom domains not configured"}}}},"/api/v1/status-pages/{id}/domains":{"get":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"listStatusPageDomains","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"status":{"type":"string"},"sslStatus":{"type":"string"},"verification":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"value":{"type":"string"}},"required":["type","name","value"]}},"cnameTarget":{"type":"string","nullable":true}},"required":["id","hostname","status","sslStatus","verification","cnameTarget"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Admin required"},"404":{"description":"Not found"},"409":{"description":"Conflict"},"429":{"description":"Limit reached"},"502":{"description":"Cloudflare failure"},"503":{"description":"Custom domains not configured"}}},"post":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"addStatusPageDomain","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"hostname":{"type":"string","maxLength":253,"pattern":"^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"}},"required":["hostname"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"status":{"type":"string"},"sslStatus":{"type":"string"},"verification":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"value":{"type":"string"}},"required":["type","name","value"]}},"cnameTarget":{"type":"string","nullable":true}},"required":["id","hostname","status","sslStatus","verification","cnameTarget"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Admin required"},"404":{"description":"Not found"},"409":{"description":"Conflict"},"429":{"description":"Limit reached"},"502":{"description":"Cloudflare failure"},"503":{"description":"Custom domains not configured"}}}},"/api/v1/status-pages/{id}/domains/{domainId}/refresh":{"post":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"refreshStatusPageDomain","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"domainId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"hostname":{"type":"string"},"status":{"type":"string"},"sslStatus":{"type":"string"},"verification":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"name":{"type":"string"},"value":{"type":"string"}},"required":["type","name","value"]}},"cnameTarget":{"type":"string","nullable":true}},"required":["id","hostname","status","sslStatus","verification","cnameTarget"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Admin required"},"404":{"description":"Not found"},"409":{"description":"Conflict"},"429":{"description":"Limit reached"},"502":{"description":"Cloudflare failure"},"503":{"description":"Custom domains not configured"}}}},"/api/v1/status-pages/{id}/domains/{domainId}":{"delete":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"removeStatusPageDomain","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"domainId","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Admin required"},"404":{"description":"Not found"},"409":{"description":"Conflict"},"429":{"description":"Limit reached"},"502":{"description":"Cloudflare failure"},"503":{"description":"Custom domains not configured"}}}},"/api/v1/status-pages/providers/{provider}/components":{"get":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"listStatusProviderComponents","parameters":[{"schema":{"type":"string","enum":["cloudflare","discord","hetzner","mittwald","google_cloud","google_workspace","aws","github","digitalocean","vercel"]},"required":true,"name":"provider","in":"path"}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"},"group_id":{"type":"string","nullable":true}},"required":["id","name","status"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Admin required"},"404":{"description":"Not found"},"409":{"description":"Conflict"},"429":{"description":"Limit reached"},"502":{"description":"Cloudflare failure"},"503":{"description":"Custom domains not configured"}}}},"/api/v1/status-pages/{id}/incidents/{incidentId}/postmortem":{"put":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"updateStatusPagePostmortem","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"incidentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"summary":{"type":"string","minLength":1,"maxLength":10000},"cause":{"type":"string","minLength":1,"maxLength":10000},"resolution":{"type":"string","minLength":1,"maxLength":10000},"prevention":{"type":"string","minLength":1,"maxLength":10000}},"required":["summary","cause","resolution","prevention"]}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"summary":{"type":"string","minLength":1,"maxLength":10000},"cause":{"type":"string","minLength":1,"maxLength":10000},"resolution":{"type":"string","minLength":1,"maxLength":10000},"prevention":{"type":"string","minLength":1,"maxLength":10000}},"required":["summary","cause","resolution","prevention"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid input"},"401":{"description":"Authentication required"},"403":{"description":"Admin required"},"404":{"description":"Not found"},"409":{"description":"Conflict"},"429":{"description":"Limit reached"},"502":{"description":"Cloudflare failure"},"503":{"description":"Custom domains not configured"}}}},"/api/v1/status-pages":{"get":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"listStatusPages","responses":{"200":{"description":"Status pages","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"providerComponents":{"type":"object","properties":{"cloudflare":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"discord":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"hetzner":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"mittwald":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_cloud":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_workspace":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"aws":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"github":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"digitalocean":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"vercel":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100}},"default":{}},"providerExcludedComponents":{"type":"object","properties":{"cloudflare":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"discord":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"hetzner":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"mittwald":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_cloud":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_workspace":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"aws":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"github":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"digitalocean":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"vercel":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100}},"default":{}},"customDomain":{"type":"string","nullable":true,"default":null},"branding":{"type":"object","properties":{"logoUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"faviconUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"socialImageUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"seoTitle":{"type":"string","nullable":true,"maxLength":120,"default":null},"seoDescription":{"type":"string","nullable":true,"maxLength":320,"default":null},"noIndex":{"type":"boolean","default":false},"accentColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","default":"#10b981"},"supportUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"hidePoweredBy":{"type":"boolean","default":false}},"default":{}},"incidentTemplates":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"title":{"type":"string","minLength":1,"maxLength":200},"message":{"type":"string","minLength":1,"maxLength":10000},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL"]}},"required":["name","title","message","severity"]},"default":[]},"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string"},"published":{"type":"boolean"},"passwordProtected":{"type":"boolean"},"externalServices":{"type":"array","items":{"type":"string","enum":["cloudflare","discord","hetzner","mittwald","google_cloud","google_workspace","aws","github","digitalocean","vercel"]},"default":[]},"components":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","maxLength":100,"default":""},"monitorId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":120},"id":{"type":"string"},"position":{"type":"number"}},"required":["monitorId","name","id","position"]}}},"required":["id","name","slug","description","published","passwordProtected","components"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"createStatusPage","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","minLength":3,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"description":{"type":"string","maxLength":2000,"default":""},"published":{"type":"boolean","default":false},"externalServices":{"type":"array","items":{"type":"string","enum":["cloudflare","discord","hetzner","mittwald","google_cloud","google_workspace","aws","github","digitalocean","vercel"]},"maxItems":10},"providerComponents":{"type":"object","properties":{"cloudflare":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"discord":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"hetzner":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"mittwald":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_cloud":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_workspace":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"aws":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"github":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"digitalocean":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"vercel":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100}}},"providerExcludedComponents":{"type":"object","properties":{"cloudflare":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"discord":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"hetzner":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"mittwald":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_cloud":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_workspace":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"aws":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"github":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"digitalocean":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"vercel":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100}}},"branding":{"type":"object","properties":{"logoUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"faviconUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"socialImageUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"seoTitle":{"type":"string","nullable":true,"maxLength":120,"default":null},"seoDescription":{"type":"string","nullable":true,"maxLength":320,"default":null},"noIndex":{"type":"boolean","default":false},"accentColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","default":"#10b981"},"supportUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"hidePoweredBy":{"type":"boolean","default":false}}},"incidentTemplates":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"title":{"type":"string","minLength":1,"maxLength":200},"message":{"type":"string","minLength":1,"maxLength":10000},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL"]}},"required":["name","title","message","severity"]},"maxItems":20},"components":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","maxLength":100,"default":""},"monitorId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["monitorId","name"]},"maxItems":50,"default":[]},"password":{"type":"string","minLength":8,"maxLength":128},"clearPassword":{"type":"boolean"}},"required":["name","slug"]}}}},"responses":{"200":{"description":"Status page","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"providerComponents":{"type":"object","properties":{"cloudflare":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"discord":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"hetzner":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"mittwald":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_cloud":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_workspace":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"aws":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"github":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"digitalocean":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"vercel":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100}},"default":{}},"providerExcludedComponents":{"type":"object","properties":{"cloudflare":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"discord":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"hetzner":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"mittwald":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_cloud":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_workspace":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"aws":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"github":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"digitalocean":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"vercel":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100}},"default":{}},"customDomain":{"type":"string","nullable":true,"default":null},"branding":{"type":"object","properties":{"logoUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"faviconUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"socialImageUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"seoTitle":{"type":"string","nullable":true,"maxLength":120,"default":null},"seoDescription":{"type":"string","nullable":true,"maxLength":320,"default":null},"noIndex":{"type":"boolean","default":false},"accentColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","default":"#10b981"},"supportUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"hidePoweredBy":{"type":"boolean","default":false}},"default":{}},"incidentTemplates":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"title":{"type":"string","minLength":1,"maxLength":200},"message":{"type":"string","minLength":1,"maxLength":10000},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL"]}},"required":["name","title","message","severity"]},"default":[]},"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string"},"published":{"type":"boolean"},"passwordProtected":{"type":"boolean"},"externalServices":{"type":"array","items":{"type":"string","enum":["cloudflare","discord","hetzner","mittwald","google_cloud","google_workspace","aws","github","digitalocean","vercel"]},"default":[]},"components":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","maxLength":100,"default":""},"monitorId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":120},"id":{"type":"string"},"position":{"type":"number"}},"required":["monitorId","name","id","position"]}}},"required":["id","name","slug","description","published","passwordProtected","components"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request or foreign component"},"403":{"description":"Admin role required"},"404":{"description":"Not found"},"409":{"description":"Slug already in use or incident resolved"},"429":{"description":"Resource limit reached"}}}},"/api/v1/status-pages/{id}":{"get":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"getStatusPage","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Status page","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"providerComponents":{"type":"object","properties":{"cloudflare":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"discord":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"hetzner":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"mittwald":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_cloud":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_workspace":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"aws":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"github":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"digitalocean":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"vercel":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100}},"default":{}},"providerExcludedComponents":{"type":"object","properties":{"cloudflare":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"discord":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"hetzner":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"mittwald":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_cloud":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_workspace":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"aws":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"github":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"digitalocean":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"vercel":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100}},"default":{}},"customDomain":{"type":"string","nullable":true,"default":null},"branding":{"type":"object","properties":{"logoUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"faviconUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"socialImageUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"seoTitle":{"type":"string","nullable":true,"maxLength":120,"default":null},"seoDescription":{"type":"string","nullable":true,"maxLength":320,"default":null},"noIndex":{"type":"boolean","default":false},"accentColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","default":"#10b981"},"supportUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"hidePoweredBy":{"type":"boolean","default":false}},"default":{}},"incidentTemplates":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"title":{"type":"string","minLength":1,"maxLength":200},"message":{"type":"string","minLength":1,"maxLength":10000},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL"]}},"required":["name","title","message","severity"]},"default":[]},"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string"},"published":{"type":"boolean"},"passwordProtected":{"type":"boolean"},"externalServices":{"type":"array","items":{"type":"string","enum":["cloudflare","discord","hetzner","mittwald","google_cloud","google_workspace","aws","github","digitalocean","vercel"]},"default":[]},"components":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","maxLength":100,"default":""},"monitorId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":120},"id":{"type":"string"},"position":{"type":"number"}},"required":["monitorId","name","id","position"]}}},"required":["id","name","slug","description","published","passwordProtected","components"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request or foreign component"},"403":{"description":"Admin role required"},"404":{"description":"Not found"},"409":{"description":"Slug already in use or incident resolved"},"429":{"description":"Resource limit reached"}}},"put":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"updateStatusPage","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"slug":{"type":"string","minLength":3,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"description":{"type":"string","maxLength":2000,"default":""},"published":{"type":"boolean","default":false},"externalServices":{"type":"array","items":{"type":"string","enum":["cloudflare","discord","hetzner","mittwald","google_cloud","google_workspace","aws","github","digitalocean","vercel"]},"maxItems":10},"providerComponents":{"type":"object","properties":{"cloudflare":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"discord":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"hetzner":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"mittwald":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_cloud":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_workspace":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"aws":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"github":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"digitalocean":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"vercel":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100}}},"providerExcludedComponents":{"type":"object","properties":{"cloudflare":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"discord":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"hetzner":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"mittwald":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_cloud":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_workspace":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"aws":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"github":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"digitalocean":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"vercel":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100}}},"branding":{"type":"object","properties":{"logoUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"faviconUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"socialImageUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"seoTitle":{"type":"string","nullable":true,"maxLength":120,"default":null},"seoDescription":{"type":"string","nullable":true,"maxLength":320,"default":null},"noIndex":{"type":"boolean","default":false},"accentColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","default":"#10b981"},"supportUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"hidePoweredBy":{"type":"boolean","default":false}}},"incidentTemplates":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"title":{"type":"string","minLength":1,"maxLength":200},"message":{"type":"string","minLength":1,"maxLength":10000},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL"]}},"required":["name","title","message","severity"]},"maxItems":20},"components":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","maxLength":100,"default":""},"monitorId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":120}},"required":["monitorId","name"]},"maxItems":50,"default":[]},"password":{"type":"string","minLength":8,"maxLength":128},"clearPassword":{"type":"boolean"}},"required":["name","slug"]}}}},"responses":{"200":{"description":"Status page","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"providerComponents":{"type":"object","properties":{"cloudflare":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"discord":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"hetzner":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"mittwald":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_cloud":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_workspace":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"aws":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"github":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"digitalocean":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"vercel":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100}},"default":{}},"providerExcludedComponents":{"type":"object","properties":{"cloudflare":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"discord":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"hetzner":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"mittwald":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_cloud":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"google_workspace":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"aws":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"github":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"digitalocean":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100},"vercel":{"type":"array","items":{"type":"string","maxLength":100,"pattern":"^[a-zA-Z0-9_-]+$"},"maxItems":100}},"default":{}},"customDomain":{"type":"string","nullable":true,"default":null},"branding":{"type":"object","properties":{"logoUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"faviconUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"socialImageUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"seoTitle":{"type":"string","nullable":true,"maxLength":120,"default":null},"seoDescription":{"type":"string","nullable":true,"maxLength":320,"default":null},"noIndex":{"type":"boolean","default":false},"accentColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","default":"#10b981"},"supportUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"hidePoweredBy":{"type":"boolean","default":false}},"default":{}},"incidentTemplates":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"title":{"type":"string","minLength":1,"maxLength":200},"message":{"type":"string","minLength":1,"maxLength":10000},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL"]}},"required":["name","title","message","severity"]},"default":[]},"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"description":{"type":"string"},"published":{"type":"boolean"},"passwordProtected":{"type":"boolean"},"externalServices":{"type":"array","items":{"type":"string","enum":["cloudflare","discord","hetzner","mittwald","google_cloud","google_workspace","aws","github","digitalocean","vercel"]},"default":[]},"components":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string","maxLength":100,"default":""},"monitorId":{"type":"string","format":"uuid"},"name":{"type":"string","minLength":1,"maxLength":120},"id":{"type":"string"},"position":{"type":"number"}},"required":["monitorId","name","id","position"]}}},"required":["id","name","slug","description","published","passwordProtected","components"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request or foreign component"},"403":{"description":"Admin role required"},"404":{"description":"Not found"},"409":{"description":"Slug already in use or incident resolved"},"429":{"description":"Resource limit reached"}}},"delete":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"deleteStatusPage","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"deleted":{"type":"boolean"}},"required":["deleted"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request or foreign component"},"403":{"description":"Admin role required"},"404":{"description":"Not found"},"409":{"description":"Slug already in use or incident resolved"},"429":{"description":"Resource limit reached"}}}},"/api/v1/status-pages/{id}/incidents":{"get":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"listStatusPageIncidents","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Up to 100 active and 100 recent resolved incidents","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"postmortem":{"type":"object","nullable":true,"properties":{"summary":{"type":"string","minLength":1,"maxLength":10000},"cause":{"type":"string","minLength":1,"maxLength":10000},"resolution":{"type":"string","minLength":1,"maxLength":10000},"prevention":{"type":"string","minLength":1,"maxLength":10000}},"default":null,"required":["summary","cause","resolution","prevention"]},"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["INVESTIGATING","IDENTIFIED","MONITORING","RESOLVED"]},"severity":{"type":"string"},"automatic":{"type":"boolean"},"monitorId":{"type":"string","nullable":true},"startedAt":{"type":"string","format":"date-time"},"resolvedAt":{"type":"string","nullable":true,"format":"date-time"},"updates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["INVESTIGATING","IDENTIFIED","MONITORING","RESOLVED"]},"message":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","status","message","createdAt"]}}},"required":["id","title","status","severity","automatic","monitorId","startedAt","resolvedAt","updates"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request or foreign component"},"403":{"description":"Admin role required"},"404":{"description":"Not found"},"409":{"description":"Slug already in use or incident resolved"},"429":{"description":"Resource limit reached"}}},"post":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"createStatusPageIncident","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"message":{"type":"string","minLength":1,"maxLength":10000},"severity":{"type":"string","enum":["MINOR","MAJOR","CRITICAL"],"default":"MAJOR"},"monitorId":{"type":"string","nullable":true,"format":"uuid","default":null}},"required":["title","message"]}}}},"responses":{"200":{"description":"Incident created","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"postmortem":{"type":"object","nullable":true,"properties":{"summary":{"type":"string","minLength":1,"maxLength":10000},"cause":{"type":"string","minLength":1,"maxLength":10000},"resolution":{"type":"string","minLength":1,"maxLength":10000},"prevention":{"type":"string","minLength":1,"maxLength":10000}},"default":null,"required":["summary","cause","resolution","prevention"]},"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["INVESTIGATING","IDENTIFIED","MONITORING","RESOLVED"]},"severity":{"type":"string"},"automatic":{"type":"boolean"},"monitorId":{"type":"string","nullable":true},"startedAt":{"type":"string","format":"date-time"},"resolvedAt":{"type":"string","nullable":true,"format":"date-time"},"updates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["INVESTIGATING","IDENTIFIED","MONITORING","RESOLVED"]},"message":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","status","message","createdAt"]}}},"required":["id","title","status","severity","automatic","monitorId","startedAt","resolvedAt","updates"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request or foreign component"},"403":{"description":"Admin role required"},"404":{"description":"Not found"},"409":{"description":"Slug already in use or incident resolved"},"429":{"description":"Resource limit reached"}}}},"/api/v1/status-pages/{id}/incidents/{incidentId}/updates":{"post":{"tags":["Status Pages"],"security":[{"cookieAuth":[]}],"operationId":"updateStatusPageIncident","parameters":[{"schema":{"type":"string","format":"uuid"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string","format":"uuid"},"required":true,"name":"incidentId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["INVESTIGATING","IDENTIFIED","MONITORING","RESOLVED"]},"message":{"type":"string","minLength":1,"maxLength":10000}},"required":["status","message"]}}}},"responses":{"200":{"description":"Incident updated (manual ownership, no further automatic resolution)","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"postmortem":{"type":"object","nullable":true,"properties":{"summary":{"type":"string","minLength":1,"maxLength":10000},"cause":{"type":"string","minLength":1,"maxLength":10000},"resolution":{"type":"string","minLength":1,"maxLength":10000},"prevention":{"type":"string","minLength":1,"maxLength":10000}},"default":null,"required":["summary","cause","resolution","prevention"]},"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["INVESTIGATING","IDENTIFIED","MONITORING","RESOLVED"]},"severity":{"type":"string"},"automatic":{"type":"boolean"},"monitorId":{"type":"string","nullable":true},"startedAt":{"type":"string","format":"date-time"},"resolvedAt":{"type":"string","nullable":true,"format":"date-time"},"updates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["INVESTIGATING","IDENTIFIED","MONITORING","RESOLVED"]},"message":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","status","message","createdAt"]}}},"required":["id","title","status","severity","automatic","monitorId","startedAt","resolvedAt","updates"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid request or foreign component"},"403":{"description":"Admin role required"},"404":{"description":"Not found"},"409":{"description":"Slug already in use or incident resolved"},"429":{"description":"Resource limit reached"}}}},"/api/v1/public/status/{slug}/presentation":{"get":{"operationId":"getPublicStatusPresentation","tags":["Status Pages"],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Public page presentation without monitoring data","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"branding":{"type":"object","properties":{"logoUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"faviconUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"socialImageUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"seoTitle":{"type":"string","nullable":true,"maxLength":120,"default":null},"seoDescription":{"type":"string","nullable":true,"maxLength":320,"default":null},"noIndex":{"type":"boolean","default":false},"accentColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","default":"#10b981"},"supportUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"hidePoweredBy":{"type":"boolean","default":false}}},"customDomain":{"type":"string","nullable":true}},"required":["name","description","branding","customDomain"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Missing, unpublished or protected page"}}}},"/api/v1/public/status/domains/{hostname}":{"get":{"operationId":"resolveStatusPageDomain","tags":["Status Pages"],"parameters":[{"schema":{"type":"string","maxLength":253,"pattern":"^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z]{2,63}$"},"required":true,"name":"hostname","in":"path"}],"responses":{"200":{"description":"Verified, published domain mapping","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"slug":{"type":"string"}},"required":["slug"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Domain not active or page not published"}}}},"/api/v1/public/status/{slug}/unlock":{"post":{"operationId":"unlockPublicStatusPage","tags":["Status Pages"],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string","minLength":1,"maxLength":128}},"required":["password"]}}}},"responses":{"200":{"description":"Unlock token; also set as httpOnly cookie","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"token":{"type":"string"}},"required":["token"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"401":{"description":"Invalid password"},"404":{"description":"Unpublished or missing page"},"429":{"description":"Too many unlock attempts"}}}},"/api/v1/public/status/{slug}/summary":{"get":{"operationId":"getPublicStatusSummary","tags":["Status Pages"],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Compact badge status; UNKNOWN must not be shown as healthy","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["OPERATIONAL","DEGRADED","OUTAGE","MAINTENANCE","UNKNOWN"]},"hasIssues":{"type":"boolean"},"hasMaintenance":{"type":"boolean"},"isOperational":{"type":"boolean"},"statusPageUrl":{"type":"string","format":"uri"},"updatedAt":{"type":"string","format":"date-time"},"activeIncidents":{"type":"array","items":{"type":"object","properties":{"postmortem":{"type":"object","nullable":true,"properties":{"summary":{"type":"string","minLength":1,"maxLength":10000},"cause":{"type":"string","minLength":1,"maxLength":10000},"resolution":{"type":"string","minLength":1,"maxLength":10000},"prevention":{"type":"string","minLength":1,"maxLength":10000}},"default":null,"required":["summary","cause","resolution","prevention"]},"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["INVESTIGATING","IDENTIFIED","MONITORING","RESOLVED"]},"severity":{"type":"string"},"automatic":{"type":"boolean"},"startedAt":{"type":"string","format":"date-time"},"resolvedAt":{"type":"string","nullable":true,"format":"date-time"},"updates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["INVESTIGATING","IDENTIFIED","MONITORING","RESOLVED"]},"message":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","status","message","createdAt"]}},"affectedComponents":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}},"required":["id","title","status","severity","automatic","startedAt","resolvedAt","updates","affectedComponents"]}},"maintenances":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"message":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"cancelledAt":{"type":"string","nullable":true,"format":"date-time"},"affectedComponents":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}},"required":["id","title","message","startsAt","endsAt","cancelledAt","affectedComponents"]}},"externalServices":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["cloudflare","discord","hetzner","mittwald","google_cloud","google_workspace","aws","github","digitalocean","vercel"]},"name":{"type":"string"},"url":{"type":"string","format":"uri"},"status":{"type":"string","enum":["OPERATIONAL","DEGRADED","OUTAGE","MAINTENANCE","UNKNOWN"]},"checkedAt":{"type":"string","format":"date-time"}},"required":["provider","name","url","status","checkedAt"]}}},"required":["name","slug","status","hasIssues","hasMaintenance","isOperational","statusPageUrl","updatedAt","activeIncidents","maintenances","externalServices"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"401":{"description":"Password required"},"404":{"description":"Unpublished or missing page"}}}},"/api/v1/public/status/{slug}":{"get":{"operationId":"getPublicWebsiteStatus","tags":["Status Pages"],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Published status (no private URLs or diagnostics)","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"branding":{"type":"object","properties":{"logoUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"faviconUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"socialImageUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"seoTitle":{"type":"string","nullable":true,"maxLength":120,"default":null},"seoDescription":{"type":"string","nullable":true,"maxLength":320,"default":null},"noIndex":{"type":"boolean","default":false},"accentColor":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","default":"#10b981"},"supportUrl":{"type":"string","nullable":true,"maxLength":2000,"format":"uri","default":null},"hidePoweredBy":{"type":"boolean","default":false}}},"externalServices":{"type":"array","items":{"type":"object","properties":{"provider":{"type":"string","enum":["cloudflare","discord","hetzner","mittwald","google_cloud","google_workspace","aws","github","digitalocean","vercel"]},"name":{"type":"string"},"url":{"type":"string","format":"uri"},"status":{"type":"string","enum":["OPERATIONAL","DEGRADED","OUTAGE","MAINTENANCE","UNKNOWN"]},"checkedAt":{"type":"string","format":"date-time"}},"required":["provider","name","url","status","checkedAt"]}},"maintenances":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"message":{"type":"string"},"startsAt":{"type":"string","format":"date-time"},"endsAt":{"type":"string","format":"date-time"},"cancelledAt":{"type":"string","nullable":true,"format":"date-time"},"affectedComponents":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}},"required":["id","title","message","startsAt","endsAt","cancelledAt","affectedComponents"]}},"name":{"type":"string"},"description":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["OPERATIONAL","DEGRADED","OUTAGE","MAINTENANCE","UNKNOWN"]},"components":{"type":"array","items":{"type":"object","properties":{"group":{"type":"string"},"name":{"type":"string"},"status":{"type":"string","enum":["UP","DOWN","PENDING","PAUSED","MAINTENANCE","UNKNOWN"]},"lastCheckedAt":{"type":"string","nullable":true,"format":"date-time"},"uptimePercent":{"type":"number","nullable":true},"daily":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"uptimePercent":{"type":"number","nullable":true},"checks":{"type":"number"}},"required":["date","uptimePercent","checks"]}}},"required":["group","name","status","lastCheckedAt","uptimePercent","daily"]}},"incidents":{"type":"array","items":{"type":"object","properties":{"postmortem":{"type":"object","nullable":true,"properties":{"summary":{"type":"string","minLength":1,"maxLength":10000},"cause":{"type":"string","minLength":1,"maxLength":10000},"resolution":{"type":"string","minLength":1,"maxLength":10000},"prevention":{"type":"string","minLength":1,"maxLength":10000}},"default":null,"required":["summary","cause","resolution","prevention"]},"id":{"type":"string"},"title":{"type":"string"},"status":{"type":"string","enum":["INVESTIGATING","IDENTIFIED","MONITORING","RESOLVED"]},"severity":{"type":"string"},"automatic":{"type":"boolean"},"startedAt":{"type":"string","format":"date-time"},"resolvedAt":{"type":"string","nullable":true,"format":"date-time"},"updates":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["INVESTIGATING","IDENTIFIED","MONITORING","RESOLVED"]},"message":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","status","message","createdAt"]}},"affectedComponents":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"}},"required":["name"]}}},"required":["id","title","status","severity","automatic","startedAt","resolvedAt","updates","affectedComponents"]}}},"required":["branding","externalServices","maintenances","name","description","slug","status","components","incidents"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"401":{"description":"Password required"},"404":{"description":"Unpublished or missing page"}}}},"/api/v1/public/status/{slug}/badge.svg":{"get":{"operationId":"getPublicStatusBadge","tags":["Status Pages"],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Compact SVG badge from overall status; locked pages must not be shown as healthy","content":{"image/svg+xml":{"schema":{"type":"string"}}}},"401":{"description":"Password required"},"404":{"description":"Unpublished or missing page"}}}},"/api/v1/public/status/{slug}/feed.rss":{"get":{"operationId":"getPublicStatusRss","tags":["Status Pages"],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Public incident feed","content":{"application/rss+xml":{"schema":{"type":"string"}}}},"401":{"description":"Password required"},"404":{"description":"Unpublished or missing page"}}}},"/api/v1/public/status/{slug}/feed.atom":{"get":{"operationId":"getPublicStatusAtom","tags":["Status Pages"],"parameters":[{"schema":{"type":"string","minLength":3,"maxLength":64,"pattern":"^[a-z0-9]+(?:-[a-z0-9]+)*$"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"Public incident feed","content":{"application/atom+xml":{"schema":{"type":"string"}}}},"401":{"description":"Password required"},"404":{"description":"Unpublished or missing page"}}}},"/api/v1/servers/{id}/request-port-scan":{"post":{"operationId":"requestPortScan","tags":["Servers"],"summary":"Request a port scan — delivered to the agent on its next check-in","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Scan requested","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"pending":{"type":"boolean"}},"required":["pending"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}}},"/api/v1/servers/{id}/port-scan-status":{"get":{"operationId":"getPortScanStatus","tags":["Servers"],"summary":"Check if a port scan request is pending for this server","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Scan status","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"pending":{"type":"boolean"}},"required":["pending"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Server not found"}}}},"/api/v1/billing/subscription":{"get":{"operationId":"getBillingSubscription","tags":["Billing"],"summary":"Get current plan and usage","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Subscription info","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"voice":{"type":"object","properties":{"enabled":{"type":"boolean"},"maxVoiceCallsPerMonth":{"type":"number"},"maxVoiceTestCallsPerMonth":{"type":"number"},"callsUsed":{"type":"number"},"testCallsUsed":{"type":"number"},"resetsAt":{"type":"string"}},"required":["enabled","maxVoiceCallsPerMonth","maxVoiceTestCallsPerMonth","callsUsed","testCallsUsed","resetsAt"]},"plan":{"type":"string"},"status":{"type":"string"},"limits":{"type":"object","properties":{"maxServers":{"type":"number"},"maxMembers":{"type":"number"},"maxAlertRules":{"type":"number"},"maxNotificationChannels":{"type":"number"}},"required":["maxServers","maxMembers","maxAlertRules","maxNotificationChannels"]},"usage":{"type":"object","properties":{"servers":{"type":"number"},"members":{"type":"number"},"alertRules":{"type":"number"},"notificationChannels":{"type":"number"}},"required":["servers","members","alertRules","notificationChannels"]},"stripeCustomerId":{"type":"string","nullable":true},"stripeSubscriptionId":{"type":"string","nullable":true},"currentPeriodEnd":{"type":"string","nullable":true},"cancelAtPeriodEnd":{"type":"boolean"},"stripeConfigured":{"type":"boolean"}},"required":["voice","plan","status","limits","usage","stripeCustomerId","stripeSubscriptionId","currentPeriodEnd","cancelAtPeriodEnd","stripeConfigured"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/billing/checkout":{"post":{"operationId":"createBillingCheckout","tags":["Billing"],"summary":"Create Stripe checkout session to upgrade plan","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["PRO","BUSINESS"]},"returnUrl":{"type":"string","format":"uri"},"annual":{"type":"boolean"}},"required":["plan"]}}}},"responses":{"200":{"description":"Checkout URL","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Validation error"},"503":{"description":"Stripe not configured"}}}},"/api/v1/billing/portal":{"post":{"operationId":"createBillingPortal","tags":["Billing"],"summary":"Create Stripe customer portal session","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"returnUrl":{"type":"string","format":"uri"}}}}}},"responses":{"200":{"description":"Portal URL","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"No Stripe customer found"},"503":{"description":"Stripe not configured"}}}},"/api/v1/billing/plans":{"get":{"operationId":"listBillingPlans","tags":["Billing"],"summary":"List available plans with limits","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"Available plans","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"string"},"name":{"type":"string"},"maxServers":{"type":"number"},"maxMembers":{"type":"number"},"maxAlertRules":{"type":"number"},"maxNotificationChannels":{"type":"number"},"maxVoiceCallsPerMonth":{"type":"number"},"maxVoiceTestCallsPerMonth":{"type":"number"},"stripePriceId":{"type":"string","nullable":true},"stripeAnnualPriceId":{"type":"string","nullable":true},"priceMonthly":{"type":"number","description":"EUR cents, monthly billing display price"},"priceAnnual":{"type":"number","description":"EUR cents, full-year billing display price (UI shows ÷12 as monthly)"},"isActive":{"type":"boolean"},"sortOrder":{"type":"number"}},"required":["id","tier","name","maxServers","maxMembers","maxAlertRules","maxNotificationChannels","maxVoiceCallsPerMonth","maxVoiceTestCallsPerMonth","stripePriceId","stripeAnnualPriceId","priceMonthly","priceAnnual","isActive","sortOrder"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/admin/plans":{"get":{"operationId":"listAdminPlans","tags":["Admin"],"summary":"List all plans including inactive","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"All plans","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"string"},"name":{"type":"string"},"maxServers":{"type":"number"},"maxMembers":{"type":"number"},"maxAlertRules":{"type":"number"},"maxNotificationChannels":{"type":"number"},"maxVoiceCallsPerMonth":{"type":"number"},"maxVoiceTestCallsPerMonth":{"type":"number"},"stripePriceId":{"type":"string","nullable":true},"stripeAnnualPriceId":{"type":"string","nullable":true},"priceMonthly":{"type":"number","description":"EUR cents, monthly billing display price"},"priceAnnual":{"type":"number","description":"EUR cents, full-year billing display price (UI shows ÷12 as monthly)"},"isActive":{"type":"boolean"},"sortOrder":{"type":"number"}},"required":["id","tier","name","maxServers","maxMembers","maxAlertRules","maxNotificationChannels","maxVoiceCallsPerMonth","maxVoiceTestCallsPerMonth","stripePriceId","stripeAnnualPriceId","priceMonthly","priceAnnual","isActive","sortOrder"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"operationId":"createAdminPlan","tags":["Admin"],"summary":"Create a new plan","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tier":{"type":"string","minLength":1,"maxLength":50,"pattern":"^[A-Z0-9_]+$"},"name":{"type":"string","minLength":1,"maxLength":100},"maxServers":{"type":"integer","minimum":-1},"maxMembers":{"type":"integer","minimum":-1},"maxAlertRules":{"type":"integer","minimum":-1},"maxNotificationChannels":{"type":"integer","minimum":-1},"maxVoiceCallsPerMonth":{"type":"integer","minimum":0,"maximum":1000,"default":0},"maxVoiceTestCallsPerMonth":{"type":"integer","minimum":0,"maximum":50,"default":0},"stripePriceId":{"type":"string","nullable":true},"stripeAnnualPriceId":{"type":"string","nullable":true},"priceMonthly":{"type":"integer","minimum":0,"default":0,"description":"Display price in EUR cents (monthly billing)"},"priceAnnual":{"type":"integer","minimum":0,"default":0,"description":"Display price in EUR cents for a full year (UI shows monthly as ÷12)"},"isActive":{"type":"boolean","default":true},"sortOrder":{"type":"integer","default":0}},"required":["tier","name","maxServers","maxMembers","maxAlertRules","maxNotificationChannels"]}}}},"responses":{"201":{"description":"Created plan","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"string"},"name":{"type":"string"},"maxServers":{"type":"number"},"maxMembers":{"type":"number"},"maxAlertRules":{"type":"number"},"maxNotificationChannels":{"type":"number"},"maxVoiceCallsPerMonth":{"type":"number"},"maxVoiceTestCallsPerMonth":{"type":"number"},"stripePriceId":{"type":"string","nullable":true},"stripeAnnualPriceId":{"type":"string","nullable":true},"priceMonthly":{"type":"number","description":"EUR cents, monthly billing display price"},"priceAnnual":{"type":"number","description":"EUR cents, full-year billing display price (UI shows ÷12 as monthly)"},"isActive":{"type":"boolean"},"sortOrder":{"type":"number"}},"required":["id","tier","name","maxServers","maxMembers","maxAlertRules","maxNotificationChannels","maxVoiceCallsPerMonth","maxVoiceTestCallsPerMonth","stripePriceId","stripeAnnualPriceId","priceMonthly","priceAnnual","isActive","sortOrder"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid voice limits"},"409":{"description":"Tier already exists"}}}},"/api/v1/admin/plans/{tier}":{"patch":{"operationId":"patchAdminPlan","tags":["Admin"],"summary":"Update a plan","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"tier","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"maxServers":{"type":"integer","minimum":-1},"maxMembers":{"type":"integer","minimum":-1},"maxAlertRules":{"type":"integer","minimum":-1},"maxNotificationChannels":{"type":"integer","minimum":-1},"maxVoiceCallsPerMonth":{"type":"integer","minimum":0,"maximum":1000},"maxVoiceTestCallsPerMonth":{"type":"integer","minimum":0,"maximum":50},"stripePriceId":{"type":"string","nullable":true},"stripeAnnualPriceId":{"type":"string","nullable":true},"priceMonthly":{"type":"integer","minimum":0},"priceAnnual":{"type":"integer","minimum":0},"isActive":{"type":"boolean"},"sortOrder":{"type":"integer"}}}}}},"responses":{"200":{"description":"Updated plan","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"string"},"name":{"type":"string"},"maxServers":{"type":"number"},"maxMembers":{"type":"number"},"maxAlertRules":{"type":"number"},"maxNotificationChannels":{"type":"number"},"maxVoiceCallsPerMonth":{"type":"number"},"maxVoiceTestCallsPerMonth":{"type":"number"},"stripePriceId":{"type":"string","nullable":true},"stripeAnnualPriceId":{"type":"string","nullable":true},"priceMonthly":{"type":"number","description":"EUR cents, monthly billing display price"},"priceAnnual":{"type":"number","description":"EUR cents, full-year billing display price (UI shows ÷12 as monthly)"},"isActive":{"type":"boolean"},"sortOrder":{"type":"number"}},"required":["id","tier","name","maxServers","maxMembers","maxAlertRules","maxNotificationChannels","maxVoiceCallsPerMonth","maxVoiceTestCallsPerMonth","stripePriceId","stripeAnnualPriceId","priceMonthly","priceAnnual","isActive","sortOrder"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Invalid voice limits"},"404":{"description":"Plan not found"}}},"delete":{"operationId":"deleteAdminPlan","tags":["Admin"],"summary":"Deactivate a plan (sets isActive=false)","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"tier","in":"path"}],"responses":{"200":{"description":"Deactivated","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"tier":{"type":"string"},"name":{"type":"string"},"maxServers":{"type":"number"},"maxMembers":{"type":"number"},"maxAlertRules":{"type":"number"},"maxNotificationChannels":{"type":"number"},"maxVoiceCallsPerMonth":{"type":"number"},"maxVoiceTestCallsPerMonth":{"type":"number"},"stripePriceId":{"type":"string","nullable":true},"stripeAnnualPriceId":{"type":"string","nullable":true},"priceMonthly":{"type":"number","description":"EUR cents, monthly billing display price"},"priceAnnual":{"type":"number","description":"EUR cents, full-year billing display price (UI shows ÷12 as monthly)"},"isActive":{"type":"boolean"},"sortOrder":{"type":"number"}},"required":["id","tier","name","maxServers","maxMembers","maxAlertRules","maxNotificationChannels","maxVoiceCallsPerMonth","maxVoiceTestCallsPerMonth","stripePriceId","stripeAnnualPriceId","priceMonthly","priceAnnual","isActive","sortOrder"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"400":{"description":"Cannot deactivate built-in plans"},"404":{"description":"Plan not found"}}}},"/api/v1/admin/stats":{"get":{"operationId":"adminGetStats","tags":["Admin"],"summary":"System-wide stats","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"System stats","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"orgs":{"type":"number"},"users":{"type":"number"},"servers":{"type":"number"},"activeAlerts":{"type":"number"},"plans":{"type":"object","properties":{"FREE":{"type":"number"},"PRO":{"type":"number"},"BUSINESS":{"type":"number"}},"required":["FREE","PRO","BUSINESS"]}},"required":["orgs","users","servers","activeAlerts","plans"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Forbidden — not a super admin"}}}},"/api/v1/admin/orgs":{"get":{"operationId":"adminListOrgs","tags":["Admin"],"summary":"List all organizations","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"All organizations","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string","nullable":true},"createdAt":{"type":"string"},"scheduledDeletionAt":{"type":"string","nullable":true},"memberCount":{"type":"number"},"serverCount":{"type":"number"},"plan":{"type":"string"}},"required":["id","name","slug","createdAt","scheduledDeletionAt","memberCount","serverCount","plan"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Forbidden"}}}},"/api/v1/admin/orgs/{orgId}":{"get":{"operationId":"adminGetOrg","tags":["Admin"],"summary":"Get organization details","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Organization detail","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string","nullable":true},"createdAt":{"type":"string"},"scheduledDeletionAt":{"type":"string","nullable":true},"memberCount":{"type":"number"},"serverCount":{"type":"number"},"plan":{"type":"string"},"members":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"role":{"type":"string"},"createdAt":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"}},"required":["id","name","email"]}},"required":["id","role","createdAt","user"]}},"servers":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"status":{"type":"string"}},"required":["id","name","status"]}},"subscription":{"type":"object","nullable":true,"properties":{"plan":{"type":"string"},"status":{"type":"string"},"currentPeriodEnd":{"type":"string","nullable":true},"cancelAtPeriodEnd":{"type":"boolean"},"stripeCustomerId":{"type":"string","nullable":true},"stripeSubscriptionId":{"type":"string","nullable":true}},"required":["plan","status","currentPeriodEnd","cancelAtPeriodEnd","stripeCustomerId","stripeSubscriptionId"]}},"required":["id","name","slug","createdAt","scheduledDeletionAt","memberCount","serverCount","plan","members","servers","subscription"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Forbidden"},"404":{"description":"Not found"}}}},"/api/v1/admin/orgs/{orgId}/plan":{"patch":{"operationId":"adminPatchOrgPlan","tags":["Admin"],"summary":"Override organization plan","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"orgId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","minLength":1}},"required":["plan"]}}}},"responses":{"200":{"description":"Plan updated","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"plan":{"type":"string"}},"required":["plan"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Forbidden"},"404":{"description":"Organization not found"}}}},"/api/v1/admin/orgs/{orgId}/schedule-deletion":{"post":{"operationId":"adminScheduleOrganizationDeletion","tags":["Admin"],"summary":"Schedule organization deletion without email confirmation (super admin)","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Deletion scheduled","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"scheduledDeletionAt":{"type":"string"}},"required":["scheduledDeletionAt"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Forbidden"},"404":{"description":"Organization not found"},"409":{"description":"Already scheduled"}}}},"/api/v1/admin/orgs/{orgId}/cancel-deletion":{"post":{"operationId":"adminCancelOrganizationDeletion","tags":["Admin"],"summary":"Cancel a scheduled organization deletion (super admin)","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"orgId","in":"path"}],"responses":{"200":{"description":"Deletion cancelled","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"nullable":true}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Forbidden"},"404":{"description":"Organization not found"},"409":{"description":"Not scheduled"}}}},"/api/v1/admin/users":{"get":{"operationId":"adminListUsers","tags":["Admin"],"summary":"List all users","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"All users","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"},"createdAt":{"type":"string"},"orgCount":{"type":"number"}},"required":["id","name","email","role","createdAt","orgCount"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Forbidden"}}}},"/api/v1/admin/users/{userId}/role":{"patch":{"operationId":"adminPatchUserRole","tags":["Admin"],"summary":"Set user role (user / admin)","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"userId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["user","admin"]}},"required":["role"]}}}},"responses":{"200":{"description":"Role updated","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"role":{"type":"string"}},"required":["role"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"401":{"description":"Not authenticated"},"403":{"description":"Forbidden"},"404":{"description":"User not found"}}}},"/api/v1/user/locale":{"patch":{"operationId":"updateUserLocale","tags":["User"],"summary":"Update the authenticated user's preferred locale","security":[{"cookieAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"locale":{"type":"string","enum":["en","de"]}},"required":["locale"]}}}},"responses":{"200":{"description":"Locale updated","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"locale":{"type":"string"}},"required":["locale"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"401":{"description":"Not authenticated"}}}},"/api/v1/mcp-keys":{"get":{"operationId":"listMcpApiKeys","tags":["MCP"],"summary":"List MCP API keys for the active organization","security":[{"cookieAuth":[]}],"responses":{"200":{"description":"MCP API keys","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"keyPrefix":{"type":"string"},"createdAt":{"type":"string"},"lastUsedAt":{"type":"string","nullable":true}},"required":["id","name","keyPrefix","createdAt","lastUsedAt"]}}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}},"post":{"operationId":"createMcpApiKey","tags":["MCP"],"summary":"Create a new MCP API key","security":[{"cookieAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"]}}}},"responses":{"201":{"description":"Created key (full key shown once)","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"keyPrefix":{"type":"string"},"createdAt":{"type":"string"},"lastUsedAt":{"type":"string","nullable":true},"key":{"type":"string","description":"Full API key — shown once, store it securely"}},"required":["id","name","keyPrefix","createdAt","lastUsedAt","key"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}}}}},"/api/v1/mcp-keys/{keyId}":{"delete":{"operationId":"deleteMcpApiKey","tags":["MCP"],"summary":"Delete an MCP API key","security":[{"cookieAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"keyId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","enum":[true]},"data":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["success","data"]},{"type":"object","properties":{"success":{"type":"boolean","enum":[false]},"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"required":["success","error"]}]}}}},"404":{"description":"Not found"}}}}}}