{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amfionhq-com/json-schema/amfionhq-com-route-lead-request-schema.json",
  "title": "RouteLeadRequest",
  "description": "A lead needs customerEmail or customerPhone (at least one; a phone needs at least 7 digits).",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amfionhq-com-openapi.yml#/components/schemas/RouteLeadRequest",
  "type": "object",
  "required": [
    "customerName",
    "preferredTimes"
  ],
  "properties": {
    "customerName": {
      "type": "string"
    },
    "customerEmail": {
      "type": "string",
      "format": "email",
      "description": "Required unless customerPhone is given."
    },
    "customerPhone": {
      "type": "string",
      "description": "Required unless customerEmail is given."
    },
    "preferredTimes": {
      "type": "string"
    },
    "notes": {
      "type": "string"
    },
    "tenantId": {
      "type": "string",
      "format": "uuid",
      "description": "Explicit routing target. Mutually exclusive with serviceQuery."
    },
    "serviceId": {
      "type": "string",
      "description": "Optional with tenantId; must be policy-visible."
    },
    "serviceQuery": {
      "type": "string",
      "description": "Auto-routing — fleet search picks the top match; 400 when nothing matches."
    }
  }
}