{
  "openapi": "3.1.0",
  "info": {
    "title": "Snowline (SnowlineApp) Real Business Intelligence & MCP API",
    "description": "Public REST & Model Context Protocol (MCP) API for Snowline (SnowlineApp) — Real Business Tracker. Access verified enterprise company data, real-time market updates, sector reports, search endpoints, and streamable MCP tool execution. Supports RFC 9457 Problem Details error formats, RFC RateLimit headers, and acceptmarkdown.com content negotiation.",
    "version": "1.0.0",
    "x-versioning-policy": {
      "strategy": "URL Path & Header",
      "currentVersion": "v1",
      "stableUntil": "2028-01-01T00:00:00Z",
      "headerParameter": "API-Version: 1.0.0"
    },
    "x-deprecation-policy": {
      "sunsetHeader": "Sunset: Sat, 01 Jan 2028 00:00:00 GMT",
      "deprecationHeader": "Deprecation: @1830297600",
      "noticePeriodDays": 180
    },
    "contact": {
      "name": "Snowline App",
      "url": "https://snowlineapp.xyz",
      "email": "support@snowlineapp.xyz"
    },
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    }
  },
  "servers": [
    {
      "url": "https://snowlineapp.xyz",
      "description": "Production (Apex Domain)"
    },
    {
      "url": "https://snowlinehq.vercel.app",
      "description": "Vercel Edge Deployment"
    },
    {
      "url": "http://localhost:3000",
      "description": "Local Development"
    }
  ],
  "paths": {
    "/api/v1/businesses": {
      "get": {
        "summary": "List all tracked businesses (v1)",
        "description": "Returns the complete catalog of verified technology enterprises and AI labs tracked on Snowline with standard RFC RateLimit headers.",
        "operationId": "listBusinessesV1",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Filter by business category (e.g. 'Artificial Intelligence', 'Search & Cloud', 'Semiconductor & Silicon')",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of tracked businesses.",
            "headers": {
              "RateLimit-Limit": { "schema": { "type": "integer", "example": 120 } },
              "RateLimit-Remaining": { "schema": { "type": "integer", "example": 118 } },
              "RateLimit-Reset": { "schema": { "type": "integer", "example": 60 } },
              "API-Version": { "schema": { "type": "string", "example": "1.0.0" } }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": { "type": "integer" },
                    "businesses": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/Business" }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "headers": {
              "Retry-After": { "schema": { "type": "integer", "example": 60 } }
            },
            "content": {
              "application/problem+json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      }
    },
    "/api/businesses": {
      "get": {
        "summary": "List all tracked businesses (alias)",
        "description": "Alias for /api/v1/businesses.",
        "operationId": "listBusinesses",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of tracked businesses."
          }
        }
      }
    },
    "/api/v1/businesses/{slug}": {
      "get": {
        "summary": "Get business by slug (v1)",
        "description": "Retrieve deep company intelligence, metrics, and milestones by business slug (e.g. 'anthropic', 'nvidia', 'alphabet').",
        "operationId": "getBusinessBySlugV1",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Unique company slug identifier",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Business profile details.",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Business" }
              }
            }
          },
          "404": {
            "description": "Business profile not found.",
            "content": {
              "application/problem+json": {
                "schema": { "$ref": "#/components/schemas/ErrorResponse" }
              }
            }
          }
        }
      }
    },
    "/api/businesses/{slug}": {
      "get": {
        "summary": "Get business by slug (alias)",
        "description": "Alias for /api/v1/businesses/{slug}.",
        "operationId": "getBusinessBySlug",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Business profile details."
          }
        }
      }
    },
    "/api/v1/updates": {
      "get": {
        "summary": "List verified corporate updates (v1)",
        "description": "Returns a chronological feed of verified company milestones.",
        "operationId": "listUpdatesV1",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": { "type": "integer" }
          }
        ],
        "responses": {
          "200": {
            "description": "List of updates.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": { "type": "integer" },
                    "updates": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/Update" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/updates": {
      "get": {
        "summary": "List verified corporate updates (alias)",
        "description": "Alias for /api/v1/updates.",
        "operationId": "listUpdates",
        "responses": {
          "200": {
            "description": "List of updates."
          }
        }
      }
    },
    "/api/v1/search": {
      "get": {
        "summary": "Search intelligence across businesses & milestones (v1)",
        "description": "Query matching businesses, news updates, operational stats, and summaries.",
        "operationId": "searchIntelligenceV1",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": { "type": "string" }
          }
        ],
        "responses": {
          "200": {
            "description": "Search results."
          },
          "400": {
            "description": "Missing query parameter."
          }
        }
      }
    },
    "/api/search": {
      "get": {
        "summary": "Search intelligence (alias)",
        "description": "Alias for /api/v1/search.",
        "operationId": "searchIntelligence",
        "responses": {
          "200": { "description": "Search results." }
        }
      }
    },
    "/api/v1/reports": {
      "get": {
        "summary": "Get industry sector intelligence reports (v1)",
        "description": "Returns synthesized industry sector intelligence reports.",
        "operationId": "getReportsV1",
        "responses": {
          "200": {
            "description": "List of sector reports.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total": { "type": "integer" },
                    "reports": {
                      "type": "array",
                      "items": { "$ref": "#/components/schemas/Report" }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/reports": {
      "get": {
        "summary": "Get sector reports (alias)",
        "description": "Alias for /api/v1/reports.",
        "operationId": "getReports",
        "responses": {
          "200": { "description": "List of sector reports." }
        }
      }
    },
    "/api/v1/health": {
      "get": {
        "summary": "System Health and Agent Readiness (v1)",
        "description": "Returns operational status and agent endpoints.",
        "operationId": "getHealthV1",
        "responses": {
          "200": { "description": "Service is healthy." }
        }
      }
    },
    "/api/health": {
      "get": {
        "summary": "System Health (alias)",
        "description": "Alias for /api/v1/health.",
        "operationId": "getHealth",
        "responses": {
          "200": { "description": "Service is healthy." }
        }
      }
    },
    "/api/mcp": {
      "get": {
        "summary": "Model Context Protocol Server Manifest",
        "description": "Returns MCP server capabilities, streamable transport configuration, and tool definitions.",
        "operationId": "getMcpManifest",
        "responses": {
          "200": { "description": "MCP Manifest." }
        }
      },
      "post": {
        "summary": "Execute MCP Tool or JSON-RPC 2.0 Request",
        "description": "Streamable HTTP transport endpoint executing tools (snowline_list_businesses, snowline_get_business_profile, snowline_list_updates, snowline_search_intelligence, snowline_get_reports, snowline_get_blog_posts).",
        "operationId": "executeMcpJsonRpc",
        "responses": {
          "200": { "description": "JSON-RPC response." }
        }
      }
    },
    "/api/cli": {
      "get": {
        "summary": "CLI Tool Specification & Install Guide",
        "description": "Returns Snowline CLI package distribution info, command references, and agent runner snippets.",
        "operationId": "getCliSpec",
        "responses": {
          "200": { "description": "CLI Specification." }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "type": { "type": "string" },
          "title": { "type": "string" },
          "status": { "type": "integer" },
          "detail": { "type": "string" },
          "code": { "type": "string" },
          "resolution": { "type": "string" },
          "timestamp": { "type": "string", "format": "date-time" },
          "instance": { "type": "string" }
        }
      },
      "Business": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "slug": { "type": "string" },
          "name": { "type": "string" },
          "category": { "type": "string" },
          "verified": { "type": "boolean" },
          "shortDescription": { "type": "string" },
          "description": { "type": "string" },
          "logoUrl": { "type": "string" },
          "stats": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": { "type": "string" },
                "value": { "type": "string" }
              }
            }
          },
          "latestUpdate": {
            "type": "object",
            "properties": {
              "title": { "type": "string" },
              "date": { "type": "string" },
              "platform": { "type": "string" },
              "sourceUrl": { "type": "string" }
            }
          }
        }
      },
      "Update": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "slug": { "type": "string" },
          "businessName": { "type": "string" },
          "businessSlug": { "type": "string" },
          "newsTitle": { "type": "string" },
          "publishedAt": { "type": "string" },
          "platform": { "type": "string" },
          "category": { "type": "string" },
          "summary": { "type": "string" },
          "content": {
            "type": "array",
            "items": { "type": "string" }
          },
          "sourceUrl": { "type": "string" }
        }
      },
      "Report": {
        "type": "object",
        "properties": {
          "id": { "type": "string" },
          "title": { "type": "string" },
          "sector": { "type": "string" },
          "summary": { "type": "string" },
          "companiesCovered": {
            "type": "array",
            "items": { "type": "string" }
          }
        }
      }
    }
  }
}
