{
  "openapi": "3.0.3",
  "info": {
    "title": "Exclusive House Cleaning API",
    "description": "API endpoints for Exclusive House Cleaning website forms.",
    "version": "1.0.0",
    "contact": {
      "name": "Exclusive House Cleaning",
      "url": "https://exclusivehousecleaning.com/"
    }
  },
  "servers": [
    {
      "url": "https://exclusivehousecleaning.com/"
    }
  ],
  "paths": {
    "/api/sendEmail.json": {
      "post": {
        "summary": "Send a form submission email",
        "description": "Accepts website form submissions (quote requests, feedback, referrals, contact, support) and routes them to the appropriate internal email address via Resend.",
        "operationId": "sendEmail",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": ["form_type"],
                "properties": {
                  "form_type": {
                    "type": "string",
                    "enum": [
                      "getaquote",
                      "feedback",
                      "referral",
                      "contactus",
                      "webmaster",
                      "support",
                      "fp"
                    ],
                    "description": "Identifies the form type, which determines email routing."
                  },
                  "name": {
                    "type": "string",
                    "description": "Submitter's name."
                  },
                  "email": {
                    "type": "string",
                    "format": "email",
                    "description": "Submitter's email address."
                  },
                  "phone": {
                    "type": "string",
                    "description": "Submitter's phone number."
                  },
                  "details": {
                    "type": "string",
                    "description": "Free-form message or request details."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Email sent successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": { "type": "string" }
                  }
                }
              }
            }
          },
          "500": {
            "description": "Server configuration or delivery error.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "message": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/health.json": {
      "get": {
        "summary": "API health check",
        "description": "Returns the operational status of the API.",
        "operationId": "healthCheck",
        "responses": {
          "200": {
            "description": "API is operational.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "ok"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}
