{
  "openapi": "3.0.3",
  "info": {
    "title": "INFREV Website API",
    "version": "1.0.0",
    "description": "Public HTTP API of https://infrev.com. Currently exposes the contact-enquiry endpoint.",
    "contact": { "name": "INFREV", "email": "hello@infrev.com", "url": "https://infrev.com/contact" }
  },
  "servers": [{ "url": "https://infrev.com" }],
  "paths": {
    "/api/sendEmail": {
      "post": {
        "operationId": "sendEnquiry",
        "summary": "Submit a contact enquiry",
        "description": "Sends an enquiry email to INFREV. All fields are HTML-escaped server-side.",
        "tags": ["Contact"],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/EnquiryRequest" },
              "example": { "firstname": "Ada", "lastname": "Lovelace", "email": "ada@example.com", "phone": "+60123456789", "details": "I would like a consultation." }
            }
          }
        },
        "responses": {
          "200": { "description": "Enquiry sent", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } },
          "400": { "description": "Missing required fields (email, firstname)", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } },
          "500": { "description": "Upstream email provider error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ApiResponse" } } } }
        }
      }
    },
    "/manifest.json": {
      "get": {
        "operationId": "getWebManifest",
        "summary": "Web app manifest",
        "tags": ["Meta"],
        "responses": { "200": { "description": "Web manifest", "content": { "application/json": { "schema": { "type": "object" } } } } }
      }
    }
  },
  "components": {
    "schemas": {
      "EnquiryRequest": {
        "type": "object",
        "required": ["firstname", "email"],
        "properties": {
          "firstname": { "type": "string" },
          "lastname": { "type": "string" },
          "email": { "type": "string", "format": "email" },
          "phone": { "type": "string" },
          "details": { "type": "string" }
        }
      },
      "ApiResponse": {
        "type": "object",
        "properties": {
          "status": { "type": "string", "enum": ["success", "error"] },
          "message": { "type": "string" }
        }
      }
    }
  }
}
