{
  "openapi": "3.1.0",
  "info": {
    "title": "DumpHelp.ca Agent Quote API",
    "version": "1.0",
    "description": "Discover services and locations, validate with dry-run, and submit consented waste hauling quote requests."
  },
  "servers": [
    {
      "url": "https://dumphelp.ca"
    }
  ],
  "paths": {
    "/api/v1/services": {
      "get": {
        "operationId": "listServices",
        "responses": {
          "200": {
            "description": "Supported services"
          }
        }
      }
    },
    "/api/v1/locations": {
      "get": {
        "operationId": "listLocations",
        "responses": {
          "200": {
            "description": "Supported locations"
          }
        }
      }
    },
    "/api/v1/health": {
      "get": {
        "operationId": "healthCheck",
        "responses": {
          "200": {
            "description": "Healthy"
          }
        }
      }
    },
    "/api/v1/quotes": {
      "post": {
        "operationId": "submitQuoteRequest",
        "summary": "Submit a waste hauling quote request",
        "description": "Obtain explicit user consent before submitting PII. Use dry_run=true to validate and preview without creating a lead.",
        "parameters": [
          {
            "name": "dry_run",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuoteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Dry-run preview"
          },
          "201": {
            "description": "Quote created"
          },
          "400": {
            "description": "Validation error"
          },
          "429": {
            "description": "Rate limited"
          },
          "502": {
            "description": "Persistence adapter failed"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "QuoteRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "consent",
          "name",
          "email",
          "address",
          "city",
          "province",
          "postal",
          "country",
          "service",
          "rental_start",
          "rental_end"
        ],
        "properties": {
          "consent": {
            "type": "boolean",
            "description": "Explicit consent to share PII for contractor matching",
            "const": true
          },
          "name": {
            "type": "string",
            "description": "Full name",
            "minLength": 2,
            "maxLength": 120
          },
          "email": {
            "type": "string",
            "description": "Email address",
            "format": "email",
            "maxLength": 254
          },
          "phone": {
            "type": "string",
            "description": "Phone number",
            "minLength": 7,
            "maxLength": 40
          },
          "address": {
            "type": "string",
            "description": "Property street address",
            "minLength": 5,
            "maxLength": 200
          },
          "city": {
            "type": "string",
            "description": "Property city",
            "minLength": 2,
            "maxLength": 80
          },
          "province": {
            "type": "string",
            "description": "Canadian province code",
            "enum": [
              "AB",
              "BC",
              "MB",
              "NB",
              "NL",
              "NS",
              "NT",
              "NU",
              "ON",
              "PE",
              "QC",
              "SK",
              "YT"
            ],
            "minLength": 2,
            "maxLength": 2
          },
          "postal": {
            "type": "string",
            "description": "Canadian postal code",
            "pattern": "^[A-Z]\\d[A-Z] \\d[A-Z]\\d$"
          },
          "country": {
            "type": "string",
            "description": "Country code",
            "const": "CA",
            "default": "CA"
          },
          "details": {
            "type": "string",
            "description": "Project details",
            "maxLength": 4000
          },
          "agent_source": {
            "type": "string",
            "description": "Submitting agent, e.g. chatgpt",
            "maxLength": 64,
            "default": "agent"
          },
          "agent_version": {
            "type": "string",
            "description": "Optional submitting agent version",
            "maxLength": 64
          },
          "submission_method": {
            "type": "string",
            "description": "openapi, mcp, webmcp, or agent-skill",
            "enum": [
              "openapi",
              "mcp",
              "webmcp",
              "agent-skill"
            ],
            "default": "openapi"
          },
          "website": {
            "type": "string",
            "description": "Spam honeypot; leave empty"
          },
          "service": {
            "type": "string",
            "description": "Hauling service",
            "enum": [
              "bin-rental",
              "roll-off-dumpster",
              "construction-debris",
              "roofing-tear-off",
              "estate-cleanout",
              "haul-away-junk",
              "concrete-disposal",
              "moving-bin-rental",
              "appliance-removal",
              "yard-waste-removal"
            ]
          },
          "rental_start": {
            "type": "string",
            "description": "Rental start or service date",
            "format": "date"
          },
          "rental_end": {
            "type": "string",
            "description": "Rental end date",
            "format": "date"
          },
          "delivery_instructions": {
            "type": "string",
            "description": "Placement and access instructions",
            "maxLength": 1000
          }
        }
      }
    }
  }
}