{
  "openapi": "3.1.0",
  "info": {
    "title": "Cornwall House Clearance enquiry API",
    "version": "1.0.0",
    "description": "Public house-clearance enquiry intake. No authentication. A name, consent and either an email or telephone number are required. A postcode is requested on the quote form.",
    "contact": {
      "name": "Cornwall House Clearance",
      "email": "info@cornwallhouseclearance.co.uk",
      "url": "https://cornwallhouseclearance.co.uk/contact/"
    }
  },
  "servers": [
    {
      "url": "https://cornwallhouseclearance.co.uk"
    }
  ],
  "paths": {
    "/api/quote/": {
      "post": {
        "operationId": "submitQuote",
        "summary": "Submit a house clearance enquiry",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/QuoteEnquiry"
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/QuoteEnquiry"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Enquiry accepted and emailed to the business."
          },
          "400": {
            "description": "Missing required fields or an unsupported photograph."
          },
          "415": {
            "description": "Request was not form-encoded."
          },
          "502": {
            "description": "The enquiry could not be delivered."
          }
        }
      }
    },
    "/api/health/": {
      "get": {
        "operationId": "getHealth",
        "summary": "Service health",
        "responses": {
          "200": {
            "description": "The site Worker is responding."
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "QuoteEnquiry": {
        "type": "object",
        "required": [
          "name",
          "consent"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "telephone": {
            "type": "string"
          },
          "postcode": {
            "type": "string"
          },
          "clearanceType": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "consent": {
            "type": "string",
            "description": "Must be present. Confirms the sender agrees the details may be used to reply."
          },
          "photos": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "binary"
            },
            "description": "Optional JPEG, PNG, WebP or HEIC photographs, each under 8MB."
          }
        }
      }
    }
  }
}
