{
  "openapi": "3.1.0",
  "info": {
    "title": "Woopz website API",
    "version": "1.0.0",
    "summary": "Contact Woopz, request a demo or a support callback.",
    "description": "Public endpoints behind the forms on woopz.ai. A submission is delivered by email to the Woopz team, who reply within one business day. Rate limited to 5 submissions per 10 minutes per client.",
    "contact": { "name": "Woopz AS", "email": "theo@woopz.no", "url": "https://woopz.ai/contact" }
  },
  "servers": [{ "url": "https://woopz.ai" }],
  "paths": {
    "/api/contact": {
      "post": {
        "operationId": "contactWoopz",
        "summary": "Send a message, demo request or support request to Woopz",
        "description": "Use `form` to say what kind of request this is, for example \"Demo request\", \"Contact\" or \"Support request\". Only `email` is required; include as much context as you have.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ContactRequest" },
              "example": {
                "form": "Demo request",
                "name": "Kari Nordmann",
                "email": "kari@retailer.no",
                "company": "Example Retail AS",
                "domain": "example-retail.no",
                "stores": "25",
                "interests": "Price checkers, Infinity Aisle",
                "message": "We want to test price checkers in five stores this spring."
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Delivered to the Woopz team.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Result" } } } },
          "400": { "description": "Invalid request or email address.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Result" } } } },
          "413": { "description": "Request too large (max 20 000 characters)." },
          "429": { "description": "Too many submissions from this client. Try again later." },
          "502": { "description": "Email delivery failed. Email theo@woopz.no directly." }
        }
      }
    },
    "/api/health": {
      "get": {
        "operationId": "health",
        "summary": "API status",
        "responses": { "200": { "description": "The API is up.", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "const": "ok" } } } } } } }
      }
    }
  },
  "components": {
    "schemas": {
      "ContactRequest": {
        "type": "object",
        "required": ["email"],
        "properties": {
          "form": { "type": "string", "description": "Type of request, e.g. \"Demo request\", \"Contact\", \"Support request\", \"CSAT+ demo\"." },
          "name": { "type": "string" },
          "email": { "type": "string", "format": "email", "description": "Where Woopz should reply." },
          "company": { "type": "string" },
          "domain": { "type": "string", "description": "The retailer's website, used to build a demo on their products." },
          "stores": { "type": "string", "description": "Number of stores." },
          "store": { "type": "string", "description": "Store or chain name (support requests)." },
          "terminal": { "type": "string", "description": "Terminal ID or location (support requests)." },
          "topic": { "type": "string", "enum": ["Price checkers", "Infinity Aisle", "Kiosks & product information", "CSAT+", "Pricing", "Partnership", "Something else"] },
          "interests": { "type": "string", "description": "Comma-separated list, e.g. \"Price checkers, Infinity Aisle, Smart fitting rooms\"." },
          "message": { "type": "string", "maxLength": 5000 },
          "notes": { "type": "string", "maxLength": 5000 }
        }
      },
      "Result": {
        "type": "object",
        "properties": { "ok": { "type": "boolean" }, "error": { "type": "string" } }
      }
    }
  }
}
