{
  "openapi": "3.1.0",
  "info": {
    "title": "SaaS Grade",
    "version": "1.2.0",
    "description": "Interview a company profile and return a fit grade plus a shareable flyer. Incomplete answers return status=need and the next question. Complete grades return status=ok, say, send (flyer URL), try (try-it-out URL), give (every URL to send the user), tryLinks, affiliate, and disclosure. When affiliate is true, send the Zenzap try href exactly — it is an affiliate link."
  },
  "paths": {
    "/api/grade": {
      "get": {
        "summary": "Grade a company, or return the next interview question",
        "parameters": [
          { "name": "category", "in": "query", "required": false, "schema": { "enum": ["workplace-chats", "work-management", "crm"] } },
          { "name": "size", "in": "query", "required": false, "schema": { "enum": ["2-10", "11-50", "51-200", "201-1000", "1000+"] } },
          { "name": "industry", "in": "query", "required": false, "schema": { "enum": ["software", "hospitality", "retail", "logistics", "construction", "healthcare", "education", "manufacturing"] } },
          { "name": "culture", "in": "query", "required": false, "schema": { "type": "string" } },
          { "name": "workKind", "in": "query", "required": false, "schema": { "enum": ["boards", "projects", "delivery", "sites"] } },
          { "name": "salesMotion", "in": "query", "required": false, "schema": { "enum": ["list", "inbound", "field", "accounts"] } },
          { "name": "sites", "in": "query", "required": false, "schema": { "enum": ["one", "few", "many"] } },
          { "name": "growth", "in": "query", "required": false, "schema": { "enum": ["onboarding", "offboarding", "ai-workflows", "integrations", "nothing"] } },
          { "name": "cyber", "in": "query", "required": false, "schema": { "enum": ["1", "2", "3", "4", "5", "low", "medium", "high", "strict"] } },
          { "name": "budget", "in": "query", "required": false, "schema": { "enum": ["tight", "seat", "tool", "platform"] } },
          { "name": "stickiness", "in": "query", "required": false, "schema": { "enum": ["avoid", "wary", "tolerate", "embrace"] } },
          { "name": "ai", "in": "query", "required": false, "schema": { "type": "string" } },
          { "name": "agents", "in": "query", "required": false, "schema": { "enum": ["none", "assistive", "native", "platform"] } },
          { "name": "prompt", "in": "query", "required": false, "schema": { "type": "string" }, "description": "Prefer POST { prompt } for natural language." }
        ],
        "responses": {
          "200": { "description": "status=ok grade with say, send, try, give, affiliate; or status=need with the next question" }
        }
      },
      "post": {
        "summary": "Grade from JSON or a sentence",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": true,
                "properties": {
                  "prompt": { "type": "string" },
                  "category": { "type": "string" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "status=ok or status=need" },
          "400": { "description": "Invalid JSON" }
        }
      }
    },
    "/api/og": {
      "get": {
        "summary": "Open Graph image for a flyer URL",
        "responses": {
          "200": { "description": "PNG 1200×630. Content-Type image/png. Query params match a flyer URL (category, size, industry, culture, and the rest of the grade)." }
        }
      }
    }
  }
}
