{
  "openapi": "3.1.1",
  "info": {
    "title": "Xakpc.McpCanary | v1",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.mcpcanary.com/"
    }
  ],
  "paths": {
    "/v1/inspect": {
      "post": {
        "tags": [
          "InspectEndpoints"
        ],
        "summary": "Inspect an MCP endpoint without calling any tool.",
        "description": "Connects to the endpoint (Streamable HTTP, then legacy SSE), lists tools, and classifies each tool's side effects from its MCP hints. Never invokes a tool. Returns 200 whenever the probe ran; a target problem is status=failed with a stable failure code. No workspace token is required.",
        "operationId": "Inspect",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InspectRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InspectResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/workspaces": {
      "post": {
        "tags": [
          "WorkspaceEndpoints"
        ],
        "summary": "Create an anonymous workspace and its token.",
        "description": "No signup. Returns a workspace token (ac_live_...) exactly once. Send it as 'Authorization: Bearer <token>' on every other /v1 call except /v1/inspect.",
        "operationId": "CreateWorkspace",
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateWorkspaceResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/pricing": {
      "get": {
        "tags": [
          "BillingEndpoints"
        ],
        "summary": "Plans, prices, and limits. No token needed.",
        "description": "Prices are per month in the smallest currency unit (cents). The trial needs no payment; it starts on the first monitor write of a workspace.",
        "operationId": "GetPricing",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricingResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/monitors/{name}": {
      "put": {
        "tags": [
          "MonitorEndpoints"
        ],
        "summary": "Create or update a monitor by name (idempotent).",
        "description": "The body is the full desired state; left-out fields go back to defaults, except 'headers' (null keeps the stored secret headers). Returns 201 when created, 200 otherwise, with 'changed' = false when nothing differed. Safe to retry. Runs one check right away, stores it, and returns it as 'first_check'. Tools not declared read-only need 'allow_side_effects': true. The first monitor write of a workspace starts its 72 h trial (one trial per workspace and per target host). Without an active trial or paid plan: 402 PAYMENT_REQUIRED. Over a plan limit (monitor count, minimum interval, on-demand checks per 24 h): 402 PLAN_LIMIT_REACHED. Both carry 'offers' with a checkout_url for a human.",
        "operationId": "SetMonitor",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MonitorSpec"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutMonitorResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutMonitorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/monitors": {
      "get": {
        "tags": [
          "MonitorEndpoints"
        ],
        "summary": "List all monitors of the workspace.",
        "operationId": "ListMonitors",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/monitors/{id}": {
      "get": {
        "tags": [
          "MonitorEndpoints"
        ],
        "summary": "Get one monitor by id (GUID) or name, with its last check.",
        "operationId": "GetMonitor",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonitorResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "MonitorEndpoints"
        ],
        "summary": "Delete one monitor by id (GUID) or name, with its checks.",
        "operationId": "DeleteMonitor",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/v1/monitors/{id}/test": {
      "post": {
        "tags": [
          "CheckEndpoints"
        ],
        "summary": "Run one check now and return it (CI gate).",
        "description": "Runs the monitor's check synchronously (up to its timeout), stores it with trigger 'manual', and returns 200 with status 'passed' or 'failed'. A failed target is data, not an HTTP error. Counts toward on-demand checks per 24 h. Without an active trial or paid plan: 402 PAYMENT_REQUIRED; a suspended monitor or a used-up limit: 402 PLAN_LIMIT_REACHED.",
        "operationId": "TestMonitor",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckResult"
                }
              }
            }
          }
        }
      }
    },
    "/v1/monitors/{id}/checks": {
      "get": {
        "tags": [
          "CheckEndpoints"
        ],
        "summary": "List stored checks of a monitor, newest first.",
        "description": "'limit' defaults to 50, at most 200. Checks older than the retention period are removed.",
        "operationId": "ListChecks",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/incidents": {
      "get": {
        "tags": [
          "IncidentEndpoints"
        ],
        "summary": "List incidents of the workspace, newest first.",
        "description": "Filters: 'status' = open | resolved, 'monitor' = monitor id or name. 'limit' defaults to 50, at most 200. An incident opens after 2 scheduled failures in a row (or on a contract change with alert_on_change) and resolves after 1 scheduled pass.",
        "operationId": "ListIncidents",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "monitor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/incidents/{id}": {
      "get": {
        "tags": [
          "IncidentEndpoints"
        ],
        "summary": "Get one incident with its failure evidence.",
        "operationId": "GetIncident",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IncidentResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{name}": {
      "put": {
        "tags": [
          "WebhookEndpoints"
        ],
        "summary": "Create or update a webhook by name (idempotent).",
        "description": "The body is the full desired state. Left-out 'events' = incident.opened, incident.resolved, contract.changed, entitlement.expiring, entitlement.expired; '*' = all events. Returns 201 with the signing secret (whsec_...) exactly once when created; 200 otherwise, without the secret. Deliveries are signed with 'X-McpCanary-Signature: t=<unix>,v1=<hex HMAC-SHA256(secret, t + \".\" + body)>' and retried after 10 s, 60 s, and 5 min. Over the plan's webhook limit: 402 PLAN_LIMIT_REACHED. A suspended webhook still gets entitlement.* events.",
        "operationId": "SetWebhook",
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookSpec"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutWebhookResponse"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PutWebhookResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks": {
      "get": {
        "tags": [
          "WebhookEndpoints"
        ],
        "summary": "List all webhooks of the workspace.",
        "operationId": "ListWebhooks",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/webhooks/{id}": {
      "get": {
        "tags": [
          "WebhookEndpoints"
        ],
        "summary": "Get one webhook by id (GUID) or name.",
        "operationId": "GetWebhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookResponse"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "WebhookEndpoints"
        ],
        "summary": "Delete one webhook by id (GUID) or name, with its delivery log.",
        "operationId": "DeleteWebhook",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        }
      }
    },
    "/v1/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "WebhookEndpoints"
        ],
        "summary": "List deliveries of a webhook, newest first.",
        "description": "'limit' defaults to 50, at most 200. Deliveries older than the retention period are removed.",
        "operationId": "ListWebhookDeliveries",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "pattern": "^-?(?:0|[1-9]\\d*)$",
              "type": [
                "integer",
                "string"
              ],
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeliveryListResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/entitlement": {
      "get": {
        "tags": [
          "BillingEndpoints"
        ],
        "summary": "The workspace's access: trial, paid plan, or none; with limits and usage.",
        "operationId": "GetEntitlement",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EntitlementResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/subscription/cancel": {
      "post": {
        "tags": [
          "BillingEndpoints"
        ],
        "summary": "Cancel the paid subscription at the end of its period.",
        "description": "Idempotent. The plan stays active until 'access_until', then checks and alerts stop. 409 when there is no active subscription.",
        "operationId": "CancelSubscription",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CancelSubscriptionResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/checkout": {
      "post": {
        "tags": [
          "BillingEndpoints"
        ],
        "summary": "Get a payment link for a human (plan 'solo' or 'pro').",
        "description": "Returns a signed link, valid 7 days. The human opens it and pays at Polar. The plan changes when Polar confirms the payment. Give the link to a human; it needs a person to pay.",
        "operationId": "CreateCheckoutLink",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckoutRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckoutResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/portal": {
      "post": {
        "tags": [
          "BillingEndpoints"
        ],
        "summary": "Get a short-lived Polar customer portal link for a human (card, invoices, plan change).",
        "description": "409 before the first payment: the workspace has no billing account yet.",
        "operationId": "CreatePortalLink",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PortalResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Assertion": {
        "type": "object",
        "properties": {
          "path": {
            "type": [
              "null",
              "string"
            ]
          },
          "equals": { },
          "not_equals": { },
          "exists": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "contains": {
            "type": [
              "null",
              "string"
            ]
          },
          "matches": {
            "type": [
              "null",
              "string"
            ]
          },
          "duration": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/DurationAssertion"
              }
            ]
          }
        }
      },
      "BillingUsage": {
        "required": [
          "monitors",
          "webhooks",
          "on_demand_checks"
        ],
        "type": "object",
        "properties": {
          "monitors": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "webhooks": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "on_demand_checks": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "CancelSubscriptionResponse": {
        "required": [
          "status",
          "access_until"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "access_until": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "CheckFailure": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "details": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonObject"
              }
            ]
          }
        }
      },
      "CheckListResponse": {
        "required": [
          "checks"
        ],
        "type": "object",
        "properties": {
          "checks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CheckResult"
            }
          }
        }
      },
      "CheckoutRequest": {
        "required": [
          "plan"
        ],
        "type": "object",
        "properties": {
          "plan": {
            "type": "string"
          }
        }
      },
      "CheckoutResponse": {
        "required": [
          "checkout_url"
        ],
        "type": "object",
        "properties": {
          "checkout_url": {
            "type": "string"
          }
        }
      },
      "CheckResult": {
        "required": [
          "id",
          "trigger",
          "started_at",
          "status",
          "duration_ms",
          "transport",
          "protocol",
          "contract_changed",
          "failure"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "trigger": {
            "type": "string"
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string"
          },
          "duration_ms": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "transport": {
            "type": [
              "null",
              "string"
            ]
          },
          "protocol": {
            "type": [
              "null",
              "string"
            ]
          },
          "contract_changed": {
            "type": "boolean"
          },
          "failure": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CheckFailure"
              }
            ]
          },
          "contract_changes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/ContractChange"
            }
          }
        }
      },
      "ContractChange": {
        "required": [
          "type",
          "tool"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "tool": {
            "type": "string"
          },
          "argument": {
            "type": [
              "null",
              "string"
            ]
          },
          "from": { },
          "to": { }
        }
      },
      "CreateWorkspaceResponse": {
        "required": [
          "workspace_id",
          "token"
        ],
        "type": "object",
        "properties": {
          "workspace_id": {
            "type": "string",
            "format": "uuid"
          },
          "token": {
            "type": "string"
          }
        }
      },
      "DeliveryListResponse": {
        "required": [
          "deliveries"
        ],
        "type": "object",
        "properties": {
          "deliveries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DeliveryResponse"
            }
          }
        }
      },
      "DeliveryResponse": {
        "required": [
          "id",
          "event_id",
          "event",
          "status",
          "attempts",
          "created_at",
          "last_attempt_at",
          "next_attempt_at",
          "last_http_status",
          "last_error"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "event_id": {
            "type": "string",
            "format": "uuid"
          },
          "event": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "attempts": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "last_attempt_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "next_attempt_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "last_http_status": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "last_error": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DurationAssertion": {
        "required": [
          "less_than_ms"
        ],
        "type": "object",
        "properties": {
          "less_than_ms": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "EntitlementResponse": {
        "required": [
          "type",
          "plan",
          "expires_at",
          "renews",
          "reason",
          "trial_available",
          "limits",
          "usage",
          "billing_account"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "plan": {
            "type": [
              "null",
              "string"
            ]
          },
          "expires_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "renews": {
            "type": "boolean"
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "trial_available": {
            "type": "boolean"
          },
          "limits": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PlanLimits"
              }
            ]
          },
          "usage": {
            "$ref": "#/components/schemas/BillingUsage"
          },
          "billing_account": {
            "type": "boolean"
          }
        }
      },
      "IncidentListResponse": {
        "required": [
          "incidents"
        ],
        "type": "object",
        "properties": {
          "incidents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IncidentResponse"
            }
          }
        }
      },
      "IncidentResponse": {
        "required": [
          "id",
          "monitor_id",
          "monitor_name",
          "status",
          "cause",
          "failure",
          "opened_at",
          "resolved_at",
          "opened_by_check_id",
          "resolved_by_check_id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "monitor_id": {
            "type": "string",
            "format": "uuid"
          },
          "monitor_name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "cause": {
            "type": "string"
          },
          "failure": {
            "$ref": "#/components/schemas/CheckFailure"
          },
          "opened_at": {
            "type": "string",
            "format": "date-time"
          },
          "resolved_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "opened_by_check_id": {
            "type": "string",
            "format": "uuid"
          },
          "resolved_by_check_id": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          }
        }
      },
      "InspectedTool": {
        "required": [
          "name",
          "description",
          "side_effects",
          "hints",
          "input_schema",
          "output_schema"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "description": {
            "type": [
              "null",
              "string"
            ]
          },
          "side_effects": {
            "type": "string"
          },
          "hints": {
            "$ref": "#/components/schemas/ToolHints"
          },
          "input_schema": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "output_schema": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        }
      },
      "InspectRequest": {
        "required": [
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "headers": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            }
          }
        }
      },
      "InspectResponse": {
        "required": [
          "endpoint",
          "status",
          "transport",
          "protocol",
          "server",
          "tools",
          "duration_ms",
          "failure"
        ],
        "type": "object",
        "properties": {
          "endpoint": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "transport": {
            "type": [
              "null",
              "string"
            ]
          },
          "protocol": {
            "type": [
              "null",
              "string"
            ]
          },
          "server": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ServerInfo"
              }
            ]
          },
          "tools": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InspectedTool"
            }
          },
          "duration_ms": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "failure": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CheckFailure"
              }
            ]
          }
        }
      },
      "JsonElement": { },
      "JsonObject": {
        "type": "object"
      },
      "MonitorListResponse": {
        "required": [
          "monitors"
        ],
        "type": "object",
        "properties": {
          "monitors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MonitorResponse"
            }
          }
        }
      },
      "MonitorResponse": {
        "required": [
          "id",
          "name",
          "url",
          "interval_seconds",
          "effective_interval_seconds",
          "timeout_seconds",
          "tool",
          "arguments",
          "assertions",
          "allow_side_effects",
          "alert_on_change",
          "headers",
          "created_at",
          "updated_at",
          "next_run_at",
          "status",
          "suspended_reason",
          "open_incident_id",
          "last_check"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "interval_seconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "effective_interval_seconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "timeout_seconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "tool": {
            "type": [
              "null",
              "string"
            ]
          },
          "arguments": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "assertions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Assertion"
            }
          },
          "allow_side_effects": {
            "type": "boolean"
          },
          "alert_on_change": {
            "type": "boolean"
          },
          "headers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "next_run_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string"
          },
          "suspended_reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "open_incident_id": {
            "type": [
              "null",
              "string"
            ],
            "format": "uuid"
          },
          "last_check": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/CheckResult"
              }
            ]
          }
        }
      },
      "MonitorSpec": {
        "required": [
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "interval_seconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "timeout_seconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "tool": {
            "type": [
              "null",
              "string"
            ]
          },
          "arguments": { },
          "assertions": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/Assertion"
            }
          },
          "allow_side_effects": {
            "type": "boolean",
            "default": false
          },
          "headers": {
            "type": [
              "null",
              "object"
            ],
            "additionalProperties": {
              "type": "string"
            }
          },
          "alert_on_change": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "PlanLimits": {
        "required": [
          "monitors",
          "min_interval_seconds",
          "history_days",
          "passed_check_days",
          "on_demand_checks_per_day",
          "webhooks"
        ],
        "type": "object",
        "properties": {
          "monitors": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "min_interval_seconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "history_days": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "passed_check_days": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "on_demand_checks_per_day": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "webhooks": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "PortalResponse": {
        "required": [
          "portal_url"
        ],
        "type": "object",
        "properties": {
          "portal_url": {
            "type": "string"
          }
        }
      },
      "PricingPlan": {
        "required": [
          "id",
          "price",
          "interval",
          "limits"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "price": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "interval": {
            "type": "string"
          },
          "limits": {
            "$ref": "#/components/schemas/PlanLimits"
          }
        }
      },
      "PricingResponse": {
        "required": [
          "currency",
          "trial",
          "plans"
        ],
        "type": "object",
        "properties": {
          "currency": {
            "type": "string"
          },
          "trial": {
            "$ref": "#/components/schemas/PricingTrial"
          },
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PricingPlan"
            }
          }
        }
      },
      "PricingTrial": {
        "required": [
          "hours",
          "limits"
        ],
        "type": "object",
        "properties": {
          "hours": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "limits": {
            "$ref": "#/components/schemas/PlanLimits"
          }
        }
      },
      "PutMonitorResponse": {
        "required": [
          "monitor",
          "created",
          "changed",
          "first_check"
        ],
        "type": "object",
        "properties": {
          "monitor": {
            "$ref": "#/components/schemas/MonitorResponse"
          },
          "created": {
            "type": "boolean"
          },
          "changed": {
            "type": "boolean"
          },
          "first_check": {
            "$ref": "#/components/schemas/CheckResult"
          }
        }
      },
      "PutWebhookResponse": {
        "required": [
          "webhook",
          "created",
          "changed",
          "secret"
        ],
        "type": "object",
        "properties": {
          "webhook": {
            "$ref": "#/components/schemas/WebhookResponse"
          },
          "created": {
            "type": "boolean"
          },
          "changed": {
            "type": "boolean"
          },
          "secret": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ServerInfo": {
        "required": [
          "name",
          "version"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "version": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ToolHints": {
        "required": [
          "read_only_hint",
          "destructive_hint",
          "idempotent_hint",
          "open_world_hint"
        ],
        "type": "object",
        "properties": {
          "read_only_hint": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "destructive_hint": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "idempotent_hint": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "open_world_hint": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "WebhookListResponse": {
        "required": [
          "webhooks"
        ],
        "type": "object",
        "properties": {
          "webhooks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookResponse"
            }
          }
        }
      },
      "WebhookResponse": {
        "required": [
          "id",
          "name",
          "url",
          "events",
          "created_at",
          "updated_at",
          "status",
          "suspended_reason"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string"
          },
          "suspended_reason": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WebhookSpec": {
        "required": [
          "url"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "events": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "InspectEndpoints"
    },
    {
      "name": "WorkspaceEndpoints"
    },
    {
      "name": "BillingEndpoints"
    },
    {
      "name": "MonitorEndpoints"
    },
    {
      "name": "CheckEndpoints"
    },
    {
      "name": "IncidentEndpoints"
    },
    {
      "name": "WebhookEndpoints"
    }
  ]
}