{
  "components": {
    "schemas": {
      "AgentSummary": {
        "additionalProperties": false,
        "properties": {
          "agent_id": {
            "type": "string"
          },
          "arch": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "connected_at": {
            "format": "date-time",
            "type": "string"
          },
          "connection_state": {
            "type": "string"
          },
          "disconnected_at": {
            "format": "date-time",
            "type": "string"
          },
          "enrolled_at": {
            "format": "date-time",
            "type": "string"
          },
          "hostname": {
            "type": "string"
          },
          "is_online": {
            "type": "boolean"
          },
          "last_heartbeat": {
            "format": "date-time",
            "type": "string"
          },
          "os": {
            "type": "string"
          },
          "update_ring": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        },
        "required": [
          "agent_id",
          "hostname",
          "os",
          "arch",
          "version",
          "is_online",
          "connection_state"
        ],
        "type": "object",
        "x-go-source-type": "agentSummary"
      },
      "DashboardEndpoint": {
        "additionalProperties": false,
        "properties": {
          "client_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "hostname": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "last_heartbeat": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "os": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "hostname",
          "os",
          "client_name",
          "last_heartbeat"
        ],
        "type": "object",
        "x-go-source-type": "dashboardEndpoint"
      },
      "DashboardFinding": {
        "additionalProperties": false,
        "properties": {
          "detail": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "scope",
          "label",
          "detail",
          "status"
        ],
        "type": "object",
        "x-go-source-type": "dashboardFinding"
      },
      "DashboardMetric": {
        "additionalProperties": false,
        "properties": {
          "detail": {
            "type": "string"
          },
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "value": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "key",
          "label",
          "value",
          "status",
          "detail"
        ],
        "type": "object",
        "x-go-source-type": "dashboardMetric"
      },
      "DashboardSample": {
        "additionalProperties": false,
        "properties": {
          "cpu": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "disk": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "memory": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ]
          },
          "observed_at": {
            "format": "date-time",
            "type": "string"
          }
        },
        "required": [
          "observed_at",
          "cpu",
          "memory",
          "disk"
        ],
        "type": "object",
        "x-go-source-type": "dashboardSample"
      },
      "EndpointDashboard": {
        "additionalProperties": false,
        "properties": {
          "endpoint": {
            "$ref": "#/components/schemas/DashboardEndpoint"
          },
          "evaluated_at": {
            "format": "date-time",
            "type": "string"
          },
          "expires_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "findings": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/DashboardFinding"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "history": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/DashboardSample"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "metrics": {
            "anyOf": [
              {
                "items": {
                  "$ref": "#/components/schemas/DashboardMetric"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "observed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "policy_description": {
            "type": "string"
          },
          "schema": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "window_minutes": {
            "type": "integer"
          }
        },
        "required": [
          "schema",
          "endpoint",
          "evaluated_at",
          "observed_at",
          "expires_at",
          "window_minutes",
          "status",
          "metrics",
          "history",
          "findings",
          "policy_description"
        ],
        "type": "object",
        "x-go-source-type": "endpointDashboard"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Generated from current Go backend wire types. Two read operations only; not full API coverage or a Rust migration.",
    "title": "StratifyIQ read contract pilot",
    "version": "1.0.0"
  },
  "openapi": "3.1.0",
  "paths": {
    "/api/agents": {
      "get": {
        "description": "Tenant-filtered durable and connected endpoint inventory; includes offline endpoints.",
        "operationId": "listEndpointInventory",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/AgentSummary"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Authorized read result"
          },
          "default": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Authorization, attribution, provider or transport failure. Never healthy empty data."
          }
        }
      }
    },
    "/api/mcp/endpoint": {
      "get": {
        "description": "Curated dashboard observations through the native MCP principal boundary. Broker audit and ticket policy remain authoritative.",
        "operationId": "getEndpointObservations",
        "parameters": [
          {
            "in": "query",
            "name": "agent_id",
            "required": true,
            "schema": {
              "maxLength": 128,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "minutes",
            "required": false,
            "schema": {
              "maximum": 10080,
              "minimum": 5,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "maximum": 500,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "header",
            "name": "X-StratifyIQ-Reason",
            "required": true,
            "schema": {
              "maxLength": 500,
              "minLength": 3,
              "type": "string"
            }
          },
          {
            "in": "header",
            "name": "X-StratifyIQ-Ticket-Number",
            "required": false,
            "schema": {
              "maxLength": 100,
              "minLength": 1,
              "pattern": "^[A-Za-z0-9][A-Za-z0-9._:/#-]{0,99}$",
              "type": "string"
            }
          },
          {
            "description": "Required together with ticket number when ticket attribution is supplied.",
            "in": "header",
            "name": "X-StratifyIQ-Ticket-System",
            "required": false,
            "schema": {
              "const": "connectwise",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EndpointDashboard"
                }
              }
            },
            "description": "Authorized read result"
          },
          "default": {
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "description": "Authorization, attribution, provider or transport failure. Never healthy empty data."
          }
        }
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ]
}
