{
  "openapi": "3.1.0",
  "info": {
    "title": "baachee.ai Public API",
    "version": "0.1.0",
    "description": "Public HTTP endpoints exposed by baachee.ai. Covers the landing-page chatbot, access/demo request intake, and demo-booking flows. All other API surface is private and requires invite-based access.",
    "contact": {
      "name": "baachee.ai",
      "url": "https://baachee.ai/#request"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://baachee.ai/terms"
    }
  },
  "servers": [
    { "url": "https://baachee.ai", "description": "Production" }
  ],
  "tags": [
    { "name": "chat", "description": "Landing-page chatbot" },
    { "name": "intake", "description": "Access and project intake" },
    { "name": "booking", "description": "Demo booking" }
  ],
  "paths": {
    "/api/baachee-chat": {
      "post": {
        "tags": ["chat"],
        "summary": "Ask the baachee.ai landing-page assistant a scoped question.",
        "description": "Answers questions grounded in a curated Baachee knowledge base. Off-scope questions receive a fallback response.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["message"],
                "properties": {
                  "message": { "type": "string", "maxLength": 2000 },
                  "locale": { "type": "string", "enum": ["en", "nl", "tr"], "default": "en" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Assistant response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "answer": { "type": "string" },
                    "actions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "label": { "type": "string" },
                          "href": { "type": "string" }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": { "description": "Missing or oversize message" }
        }
      }
    },
    "/api/submit": {
      "post": {
        "tags": ["intake"],
        "summary": "Submit an access, agent, or project request.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["type", "email"],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": ["access-request", "agent-request", "project-request"]
                  },
                  "name": { "type": "string", "maxLength": 500 },
                  "email": { "type": "string", "format": "email" },
                  "company": { "type": "string", "maxLength": 500 },
                  "location": { "type": "string", "maxLength": 500 },
                  "products": { "type": "array", "items": { "type": "string" } },
                  "note": { "type": "string", "maxLength": 2000 }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Request stored" },
          "400": { "description": "Missing/invalid fields" }
        }
      }
    },
    "/api/demo-booking": {
      "post": {
        "tags": ["booking"],
        "summary": "Book a demo slot with a host.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["type", "hosts", "day", "slot", "guestName", "guestEmail"],
                "properties": {
                  "type": { "type": "string" },
                  "hosts": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": { "type": "string" },
                        "email": { "type": "string", "format": "email" }
                      }
                    }
                  },
                  "day": { "type": "string", "enum": ["tuesday", "thursday", "friday"] },
                  "slot": { "type": "string", "enum": ["18:00", "18:30", "19:00", "19:30"] },
                  "guestName": { "type": "string" },
                  "guestEmail": { "type": "string", "format": "email" }
                }
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Booking confirmed and email sent" },
          "400": { "description": "Invalid input" }
        }
      }
    }
  },
  "components": {
    "schemas": {}
  }
}
