{
 "openapi": "3.1.0",
 "info": {
  "title": "Tcom Consultants lead API",
  "version": "1.0.0",
  "description": "Request a free AI Visibility Audit or a quote for website development, AI-ready websites, social media marketing, AI agents, apps or automation. Send only details the person has agreed to share."
 },
 "servers": [
  {
   "url": "https://tcomconsultants.com"
  }
 ],
 "paths": {
  "/api/lead.php": {
   "post": {
    "operationId": "createLead",
    "summary": "Send an enquiry to Tcom Consultants",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "name",
         "email"
        ],
        "properties": {
         "name": {
          "type": "string",
          "maxLength": 120
         },
         "email": {
          "type": "string",
          "format": "email"
         },
         "site": {
          "type": "string",
          "description": "The business website, if any"
         },
         "need": {
          "type": "string",
          "enum": [
           "More leads",
           "Get named by AI",
           "New website",
           "Social media growth",
           "AI agent / receptionist",
           "App, directory or marketplace"
          ]
         },
         "message": {
          "type": "string",
          "maxLength": 3000
         },
         "agent": {
          "type": "string",
          "description": "Name of the AI agent sending this on the person's behalf"
         },
         "kind": {
          "type": "string",
          "enum": [
           "lead",
           "project",
           "partner"
          ],
          "description": "lead = free AI audit, project = project request (a $500 retainer link is emailed), partner = freelancer application"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Received",
      "content": {
       "application/json": {
        "schema": {
         "type": "object",
         "properties": {
          "ok": {
           "type": "boolean"
          }
         }
        }
       }
      }
     },
     "422": {
      "description": "Missing name or invalid email"
     },
     "429": {
      "description": "Rate limited (8 per hour per IP)"
     }
    }
   }
  },
  "/api/book.php": {
   "get": {
    "operationId": "listSlots",
    "summary": "Open 45-minute consultation times (next 30 days)",
    "parameters": [
     {
      "name": "action",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "slots"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Days with open slots; start is a Unix timestamp (UTC)"
     }
    }
   },
   "post": {
    "operationId": "bookCall",
    "summary": "Start booking a 45-minute scoping call; returns a Stripe pay_url. The call is booked only after the $500 USD retainer is paid (time held 30 minutes)",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "required": [
         "action",
         "name",
         "email",
         "start",
         "agree"
        ],
        "properties": {
         "action": {
          "type": "string",
          "enum": [
           "book"
          ]
         },
         "name": {
          "type": "string"
         },
         "email": {
          "type": "string",
          "format": "email"
         },
         "start": {
          "type": "integer",
          "description": "Slot start from listSlots"
         },
         "agree": {
          "type": "string",
          "enum": [
           "yes"
          ],
          "description": "The person accepts the $500 USD retainer terms"
         },
         "company": {
          "type": "string"
         },
         "phone": {
          "type": "string"
         },
         "site": {
          "type": "string"
         },
         "topic": {
          "type": "string"
         },
         "meeting": {
          "type": "string",
          "enum": [
           "Google Meet",
           "Zoom",
           "Phone call",
           "Microsoft Teams"
          ]
         },
         "notes": {
          "type": "string"
         },
         "tz": {
          "type": "string",
          "description": "IANA time zone of the person, e.g. Europe/London"
         },
         "agent": {
          "type": "string"
         },
         "dry": {
          "type": "string",
          "enum": [
           "1"
          ],
          "description": "Validate only; nothing is booked or emailed"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Held: id, pay_url (Stripe checkout for the $500 USD retainer), hold_minutes. After payment Stripe returns the person to /book/, which confirms the booking"
     },
     "409": {
      "description": "Slot no longer available"
     },
     "422": {
      "description": "Missing name, email or agree=yes"
     },
     "429": {
      "description": "Rate limited (5 per hour per IP)"
     }
    }
   }
  }
 }
}