API Reference
All 28 API endpoints in the Owner Quotes application.
Health & Utilities
/api/healthService health check
/api/servicesList all available inspection services with labels (cached 24h, CORS enabled)
/api/sentry-testSentry error reporting test (returns 404 in prod)
Quote Management
/api/quotes/estimateCalculate quote with pricing, addons, custom line items, and property intelligence
Returns base price, GST, discount, stage pricing, addons breakdown, and quote token.
/api/quotes/extract-propertyExtract property details from address using OpenAI / Domain API
/api/quotes/sign-tokenSign quote token for payment authentication
Lead Management
/api/leads/submitSubmit new lead with contact info, service type, address, UTM tracking
Partner lead source forcing via ?partner=code. CORS for multiple Owner Inspections domains.
Email Endpoints
/api/email/welcomeSend welcome email after lead submission (service-specific questions)
/api/email/send-quoteSend formatted quote email to customer (staff whitelist)
/api/email/payment-statusSend payment success/failed/booking/reminder emails
/api/email/quote-viewSend quote summary email with pricing breakdown
SMS Endpoints
/api/sms/bookingBooking confirmation SMS
/api/sms/followupQuote follow-up SMS with price and payment link
/api/sms/booking-reminderReminder to complete booking form after payment
Phone Verification (Twilio)
/api/twilio/send-otpSend OTP code via SMS (rate limited: 5/IP/10min, 5/phone/10min)
/api/twilio/verify-otpVerify OTP code against Twilio Verify service
Payment (Stripe)
/api/stripe/payment-intentCreate Stripe Payment Intent (validates quote token and amount)
/api/stripe/checkout-sessionCreate Stripe Checkout Session (domain restricted to quotes.ownerinspections.com.au)
/api/stripe/cancel-payment-intentCancel an active payment intent
/api/stripe/receipt/[id]Get receipt for a payment intent by charge ID
CRM Integration
/api/crm/leadsCreate lead in CRM
/api/crm/leads/[id]/emailUpdate lead email in CRM
/api/crm/bookingCreate booking in CRM
/api/crm/quoteRecord quote sent event
/api/crm/noteAdd note to CRM record
/api/crm/stageUpdate lead stage (verified, custom_quote, property_extracted)
/api/crm/trackTrack customer journey events (viewed_quote, accepted, paid, booked)
/api/crm/upload-fileUpload file to CRM item