Five steps from first contact to booked appointment — fully automated, 24/7.
When a call goes to voicemail, GHL triggers a webhook to LeadLoop within seconds. The caller's number is captured from Twilio's call log payload. This works for both GHL phone numbers and standalone Twilio numbers routed through GHL.
Endpoint: POST /api/webhooks/ghl with phone_number, contact_name
If using Twilio standalone, configure Twilio to POST missed calls to POST /api/webhooks/twilio. The From number and CallSid are extracted from the payload.
Immediately after the missed call is captured, LeadLoop sends an SMS via Twilio to the caller's number. The message acknowledges the missed call, promises a follow-up within 30 minutes, and provides a direct callback number for urgent inquiries.
Service: services/sms-service.js · Function: sendSMS({ to, body })
Each lead is sent to the OpenAI API with a scoring prompt tuned for med spa and dental verticals. The model returns a score (1-100), a decision (book_now / follow_up / low_quality), and a human-readable reason. This runs synchronously before the lead is saved to the database.
Model: gpt-4o-mini · Temperature: 0.3 · Max tokens: 300
Service: services/ai-qualify.js · Function: qualifyLead({ name, phone, email, source, message })
If the AI qualifies the lead as book_now (score 80+), a Calendly booking link is generated with the lead's name and email pre-populated via URL params. The link is saved to the lead record and can be included in a follow-up SMS or email. For follow_up leads, no link is sent — a human reps follows up instead.
Env var: CALENDLY_BOOKING_URL · Example: https://calendly.com/your-business/consultation
Once an appointment is confirmed (via Calendly webhook or manual API call to POST /api/appointments), LeadLoop immediately sends a review request SMS. In production, this would be scheduled 24 hours after the appointment time to catch the patient when the experience is fresh.
API: POST /api/appointments with lead_id, scheduled_at, service_type