{
  "openapi": "3.1.0",
  "info": {
    "title": "gr0.ai Public API",
    "version": "1.0.0",
    "summary": "Public-surface endpoints for gr0.ai — currently the contact intake.",
    "description": "Minimal OpenAPI spec for public, unauthenticated endpoints on gr0.ai. Internal customer APIs live behind authentication and are not described here. AI agents and integrators: this spec is the source of truth for the public surface; please file issues at sean@gr0.ai for additions.",
    "contact": {
      "name": "gr0.ai",
      "email": "sean@gr0.ai",
      "url": "https://www.gr0.ai/contact"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://www.gr0.ai/terms"
    }
  },
  "servers": [
    {
      "url": "https://www.gr0.ai",
      "description": "Production"
    }
  ],
  "paths": {
    "/api/contact": {
      "post": {
        "operationId": "submitContactForm",
        "summary": "Submit a contact / inquiry form.",
        "description": "Accepts a JSON body with the visitor's name, email, message, and consent. Returns 200 on success, 400 for missing fields or invalid email, 500 on server error. No auth required.",
        "tags": ["Contact"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ContactRequest" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Submission accepted",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/ContactSuccess" }
              }
            }
          },
          "400": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ContactRequest": {
        "type": "object",
        "required": ["name", "email", "message", "consent"],
        "properties": {
          "name":    { "type": "string", "minLength": 1, "maxLength": 200 },
          "email":   { "type": "string", "format": "email", "maxLength": 254 },
          "company": { "type": "string", "maxLength": 200 },
          "role":    { "type": "string", "maxLength": 100 },
          "message": { "type": "string", "minLength": 1, "maxLength": 5000 },
          "consent": { "type": "boolean", "description": "Must be true — confirms the visitor consents to gr0.ai contacting them in response." }
        }
      },
      "ContactSuccess": {
        "type": "object",
        "properties": {
          "success": { "type": "boolean", "const": true },
          "message": { "type": "string" }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": { "type": "string" }
        }
      }
    }
  }
}
