{
  "openapi": "3.1.0",
  "info": {
    "title": "GetWidget Contact API",
    "version": "1.0.0",
    "description": "Submits a contact / audit-booking lead. Routes to GetWidget sales via AWS SES.",
    "contact": {
      "name": "GetWidget",
      "url": "https://www.getwidget.dev/contact-us/",
      "email": "sales@getwidget.dev"
    }
  },
  "servers": [
    { "url": "https://www.getwidget.dev" }
  ],
  "paths": {
    "/api/contact": {
      "post": {
        "operationId": "submitContact",
        "summary": "Submit a contact / audit-booking lead.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ContactPayload" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Lead accepted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": { "ok": { "type": "boolean" } },
                  "required": ["ok"]
                }
              }
            }
          },
          "400": { "description": "Validation error." },
          "429": { "description": "Rate limited." },
          "500": { "description": "Delivery failure." }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContactPayload": {
        "type": "object",
        "properties": {
          "name":        { "type": "string", "maxLength": 200 },
          "email":       { "type": "string", "format": "email" },
          "company":     { "type": "string", "maxLength": 200 },
          "phone":       { "type": "string", "maxLength": 50 },
          "workflow":    { "type": "string", "description": "Short description of the workflow / problem to audit." },
          "source_page": { "type": "string", "format": "uri" },
          "referrer":    { "type": "string", "format": "uri" },
          "utm":         { "type": "string" },
          "website":     { "type": "string", "description": "Honeypot — must be empty.", "maxLength": 0 }
        },
        "required": ["email"]
      }
    }
  }
}
