{
  "openapi": "3.1.0",
  "info": {
    "title": "Avodas public inquiry API",
    "version": "1.1.0",
    "description": "Public inquiries only. A person reviews every request; no pricing or booking is confirmed.",
    "contact": {
      "email": "hello@avodas.tech"
    }
  },
  "servers": [
    {
      "url": "https://forms.avodas.tech"
    }
  ],
  "paths": {
    "/": {
      "get": {
        "operationId": "get_inquiry_fields",
        "summary": "Get inquiry fields and handling policy",
        "responses": {
          "200": {
            "description": "Field requirements, hourly limit, and contact fallback",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/enquiry": {
      "get": {
        "operationId": "get_inquiry_policy",
        "summary": "Get inquiry fields and handling policy",
        "responses": {
          "200": {
            "description": "Field requirements and policy",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "submit_inquiry",
        "summary": "Submit an inquiry for human review",
        "description": "Use the requesting person's details. At most six inquiries per hour from one network address. A successful response confirms receipt, never a booking or price.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name",
                  "email",
                  "message"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 120,
                    "description": "Full name of the person who wants the work",
                    "minLength": 1
                  },
                  "email": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Their email address, where the reply goes",
                    "minLength": 1,
                    "format": "email"
                  },
                  "phone": {
                    "type": "string",
                    "maxLength": 40,
                    "description": "Their phone number"
                  },
                  "business_name": {
                    "type": "string",
                    "maxLength": 160,
                    "description": "Business or organisation, if any"
                  },
                  "street": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Property street address"
                  },
                  "city": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "Property city"
                  },
                  "state": {
                    "type": "string",
                    "maxLength": 40,
                    "description": "Property state"
                  },
                  "zip": {
                    "type": "string",
                    "maxLength": 12,
                    "description": "Property ZIP code"
                  },
                  "product": {
                    "type": "string",
                    "maxLength": 40,
                    "description": "One of: Twinstead, Curastead, Twinsite, Curasite, Handiwork, Captrove, Royaltiste, Avodas consulting, Not sure",
                    "enum": [
                      "",
                      "Twinstead",
                      "Curastead",
                      "Twinsite",
                      "Curasite",
                      "Handiwork",
                      "Captrove",
                      "Royaltiste",
                      "Avodas consulting",
                      "Not sure"
                    ]
                  },
                  "property_type": {
                    "type": "string",
                    "maxLength": 80,
                    "description": "e.g. house, ranch, office, warehouse, retail"
                  },
                  "message": {
                    "type": "string",
                    "maxLength": 4000,
                    "description": "What they need, in their words",
                    "minLength": 1
                  },
                  "contact_ok": {
                    "type": "string",
                    "maxLength": 5,
                    "description": "\"yes\" if they agree to be contacted about this inquiry"
                  },
                  "agent": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "If you are software acting for the person: your name/product"
                  },
                  "source": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "The page the inquiry came from"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Inquiry saved or notification delivered",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "reference"
                  ],
                  "properties": {
                    "ok": {
                      "const": true
                    },
                    "reference": {
                      "type": "string"
                    },
                    "next": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid fields",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "429": {
            "description": "Hourly inquiry limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "503": {
            "description": "Could not save or deliver; email hello@avodas.tech",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}
