{
  "openapi": "3.1.0",
  "info": {
    "title": "SnowBoss Commercial Snow & Ice Management API",
    "version": "1.0.0",
    "description": "Public AI-Agent-Ready API for SnowBoss (snowboss.us) — South Chicago commercial snow plowing, salting, heavy loader snow pushing, real-time NOAA weather telemetry (gridpoint LOT/79,67 at 3100 E 87th St), instant bid estimation, and commercial walkthrough intake.",
    "contact": {
      "name": "SnowBoss 24/7 Dispatch",
      "url": "https://snowboss.us",
      "email": "dispatch@snowboss.us"
    }
  },
  "servers": [
    {
      "url": "https://snowboss.us",
      "description": "Production Edge (Cloudflare Pages)"
    }
  ],
  "paths": {
    "/api/services": {
      "get": {
        "operationId": "getSnowbossServices",
        "summary": "Get commercial snow removal services, fleet, coverage corridors, and insurance specs",
        "responses": {
          "200": {
            "description": "Structured SnowBoss service catalog",
            "content": {
              "application/json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      }
    },
    "/api/noaa": {
      "get": {
        "operationId": "getLiveNoaaDispatchStatus",
        "summary": "Get live NOAA/NWS weather, snowfall forecast, active alerts, and SnowBoss dispatch level for 3100 E 87th St, Chicago (LOT/79,67)",
        "responses": {
          "200": {
            "description": "Real-time NOAA/NWS weather and dispatch readiness payload",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": { "type": "boolean" },
                    "location": { "type": "object" },
                    "dispatch": {
                      "type": "object",
                      "properties": {
                        "level": { "type": "integer", "minimum": 0, "maximum": 3 },
                        "code": { "type": "string" },
                        "label": { "type": "string" },
                        "summary": { "type": "string" }
                      }
                    },
                    "current": { "type": "object" },
                    "winterTotals": { "type": "object" },
                    "alerts": { "type": "array", "items": { "type": "object" } },
                    "forecast": { "type": "array", "items": { "type": "object" } },
                    "radar": { "type": "object" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/estimate": {
      "get": {
        "operationId": "calculateCommercialEstimate",
        "summary": "Calculate a deterministic commercial snow & ice removal estimate",
        "parameters": [
          {
            "name": "propertyType",
            "in": "query",
            "required": false,
            "description": "Facility type: logistics, industrial, retail, or medical",
            "schema": { "type": "string", "enum": ["logistics", "industrial", "retail", "medical"], "default": "logistics" }
          },
          {
            "name": "acres",
            "in": "query",
            "required": false,
            "description": "Commercial lot tier in acres: 1 (1-2), 3 (3-5), 8 (6-10), or 15 (10+)",
            "schema": { "type": "integer", "enum": [1, 3, 8, 15], "default": 3 }
          },
          {
            "name": "trigger",
            "in": "query",
            "required": false,
            "description": "Snow trigger threshold: zero (0.0 in zero-tolerance) or one (1.0 in standard)",
            "schema": { "type": "string", "enum": ["zero", "one"], "default": "zero" }
          }
        ],
        "responses": {
          "200": {
            "description": "Per-event and seasonal estimate breakdown",
            "content": {
              "application/json": {
                "schema": { "type": "object" }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "calculateCommercialEstimatePost",
        "summary": "Calculate a commercial snow & ice removal estimate via JSON body",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "propertyType": { "type": "string", "enum": ["logistics", "industrial", "retail", "medical"] },
                  "acres": { "type": "integer", "enum": [1, 3, 8, 15] },
                  "trigger": { "type": "string", "enum": ["zero", "one"] }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Per-event and seasonal estimate breakdown" }
        }
      }
    },
    "/api/bid": {
      "post": {
        "operationId": "submitSnowbossBidRequest",
        "summary": "Submit a commercial snow removal bid & on-site walkthrough request (human or AI agent)",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["propertyAddress", "contactName", "phone", "email"],
                "properties": {
                  "propertyAddress": { "type": "string", "minLength": 5, "maxLength": 250 },
                  "contactName": { "type": "string", "minLength": 2, "maxLength": 120 },
                  "companyName": { "type": "string", "maxLength": 160 },
                  "phone": { "type": "string", "minLength": 7, "maxLength": 32 },
                  "email": { "type": "string", "format": "email", "maxLength": 160 },
                  "propertyType": { "type": "string", "enum": ["logistics", "industrial", "retail", "medical"], "default": "logistics" },
                  "acres": { "type": "integer", "enum": [1, 3, 8, 15], "default": 3 },
                  "trigger": { "type": "string", "enum": ["zero", "one"], "default": "zero" },
                  "notes": { "type": "string", "maxLength": 1000 },
                  "requestedByAgent": { "type": "string", "maxLength": 120, "description": "Optional identifier if submitted by an AI assistant on behalf of a human" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Quote request received with dispatch reference ID" },
          "400": { "description": "Validation error" }
        }
      }
    }
  }
}
