Skip to main content

Clinics and real estate

Two industry connectors, each with a template flow. Install them from Console, Admin, Integrations; credentials are sealed with the company's key and never shown again.

Clinics: Doctoralia​

Connector doctoralia (category healthcare). The AI agent gets three tools, int_doctoralia_find_slots, int_doctoralia_book and int_doctoralia_cancel, and the template flow pbx/crates/flows/templates/clinic-reception.json (menu, AI booking agent, reception queue, voicemail; every branch ends at reception). The agent template clinic already carries the emergency and no_medical_advice prompt guardrails; the desk below enforces the same rules in code.

SettingMeaningDefault
domaincountry site: doctoralia.com.mx, .com.br, .com.ar, .cl, .com.co, .pe, .es, .itrequired
facility_id, doctor_id, address_idthe agenda that is bookedrequired
service_idvisit type bookedthe default visit
timezoneIANA zone of the clinicAmerica/Mexico_City
max_days_ahead / min_notice_minutesbooking horizon and shortest notice60 days / 60 minutes
max_per_phone_daybookings one number may make per day3
country_codecompletes national numbers to E.16452
escalate_toextension or queue the agent hands the call tonone

Secrets: client_id and client_secret of the Docplanner integration application.

Guardrails (clinic::guard, clinic::desk):

  • Text that sounds like an emergency (chest pain, cannot breathe, overdose, bleeding, unconscious, suicide and the like in Spanish, English and Portuguese) is refused with escalate: true and escalate_to; the agent hands the call to staff. A request for a diagnosis, prescription, dose or test result is refused with reason: medical_advice.
  • The visit reason and note are screened and never sent to Doctoralia; only name and phone leave the PBX.
  • A slot is booked only if the platform still offers it right before the write; a 409 is the same answer.
  • Notice and horizon are enforced; one number may book max_per_phone_day times a day.
  • Cancel needs the phone number the booking was made with (last ten digits compared); three wrong numbers lock the booking and escalate.

The desk talks to the clinic::provider::BookingProvider trait, so another booking system implements the same four calls.

Real estate: Inmuebles24​

Connector inmuebles24 (category realestate), template flow real-estate-leads.json, tool int_inmuebles24_listing (price, size, rooms, neighborhood; no owner data). Create a hook endpoint for the connector (see integration-hooks.md, shared_secret scheme) and give its address to the portal.

Each lead post (id, posting, contact, message) is handled once (realestate::desk::LeadDesk):

  1. The phone is normalised to E.164 (legacy Mexican 044/045/+521 forms included); a post without a usable number is only answered.
  2. A reply goes to the lead at once, in es, en or pt or from the administrator's reply_template ({name}, {title}, {url}, {when}).
  3. A callback by the AI agent is queued callback_delay_minutes later, moved into the office hours (open, close, days, timezone; nothing starts in the last ten minutes). Numbers on the do-not-call list are never called, and a second lead from the same number about the same listing is answered but not called again.
  4. If a step fails the inbox retries the post and only the missing step runs. The prospect's message reaches the agent only inside a fenced brief marked as data.

State is in memory until a later release. No migration, no new table.

Leads page​

Admin > Settings > Integrations > Leads (/admin/integration-leads, needs integrations:read) lists the newest real-estate leads with the state of the reply and of the callback, the reason a callback was skipped (no usable number, number on the do-not-call list, already called back for the listing, no time left in office hours) and totals over all leads kept for 180 days. The page is read only and shows no name, message or phone number, because none is stored. A lead with a step missing is tried again when the portal resends it, or you can retry it in the delivery log of the hook endpoints.