Architecting HIPAA-Compliant Automation for a $50M+ D2C Telehealth Network
A $50M+ D2C telehealth network couldn’t scale compliant patient outreach.
We built a stateless API orchestration engine. It sits between their custom ERP and HubSpot. It triggers personalized Twilio SMS and email sequences for 12,000 monthly leads, and it never exposes protected health information (PHI) to the CRM.
Executive Summary
Context
A high-growth Men’s Telemedicine Provider manages over 600,000 patient records across multiple US states. It relied on a custom-built ERP (Memo) for clinical data and a fragmented mix of Twilio and Mailgun for patient comms. That mix broke attribution and created compliance risks.
What We Built
We built a bi-directional API bridge. It uses non-sensitive lifecycle flags to trigger complex, multi-stage patient nurture sequences. PHI stays isolated inside the client’s legacy ERP, while HubSpot orchestrates over 50,000 automated SMS and email touchpoints per month.
Tech Stack
- HubSpot Marketing & Operations Hub Enterprise
- Memo (Custom Legacy ERP)
- Twilio SMS API
- Konnektive Billing
- Mailgun Email Infrastructure
This isn’t for every clinic. Not when a clinic needs full medical history visibility inside the CRM for sales agents. Not when the legacy system lacks an open API for high-frequency stateless triggers.
The Challenge
The clinic was generating 9,000 to 12,000 new leads monthly. The technical stack was failing under that volume. Their homegrown ERP, "Memo," held the master medical records, but it couldn’t talk to HubSpot effectively. A blunt API call created 168,000 contacts and labeled every source simply as "API," which destroyed marketing attribution.
The Eastern European IT team guarded the legacy codebase closely. The integration had to augment their existing architecture, not replace it. A compliance catch-22 set the real constraint. The client needed automated patient follow-ups to drive revenue. But moving the required medical context into HubSpot for those automations would have triggered immediate HIPAA audit risks they weren’t equipped to manage yet.
Our Approach
We shifted the strategy from a "data sync" to a "command sync." We didn’t move patient medical data into HubSpot. Instead, we identified a set of "stateless flags," such as "Consultation Booked" or "Lab Kit Purchased." Those flags could push from Memo to HubSpot through a custom middleware layer. That kept PHI out of HubSpot entirely, while still letting it drive the automation logic.
We rebuilt the endpoint payloads to capture granular UTM and source data. That finally separated Facebook and Google leads that had been lumped together before. When a patient hit a specific milestone in the clinic, like finishing a medical history form, Memo would ping HubSpot. HubSpot then instantly triggered a Twilio SMS workflow. That let us build 360-day nurture sequences. They halted automatically the moment a patient moved to the next clinical stage, all without the CRM ever "knowing" the patient’s specific medical diagnosis.
Impact
20% Increase in Lead-to-Patient Conversion
Automated Twilio SMS touchpoints, triggered by real-time clinical milestones, gave leads the right instructions for lab kits and consultations. No manual intervention was needed.
35% Reduction in Manual Operational Tasks
This outreach used to be manual. The call center and clinical staff handled it by hand. Automating it removed hundreds of hours of manual follow-up from the weekly workflow.
12% Marketing Budget Reallocation
30% Data Error Reduction
Bi-directional syncing now unifies the billing system (Konnektive), the ERP (Memo), and HubSpot. Duplicate contact records and misfired automation sequences are gone.
We built a custom API endpoint. It accepts only boolean or categorical "readiness" flags from the clinical ERP. HubSpot uses those flags to orchestrate patient care without storing any protected health data, and the compliance boundary stays clean.
We integrated Twilio directly into HubSpot workflows. We used custom code actions to do it. That delivery covers 50,000+ monthly SMS messages, each dynamically personalized using data properties the ERP’s API calls update.
We overhauled the legacy API integration. It now includes multi-channel source data. We mapped incoming webhooks to specific HubSpot custom properties to preserve the original lead source, which fixed the "API-only" labeling issue.
We mapped a custom 5-stage telemedicine path across HubSpot and the legacy ERP: Lead, Assessment, Lab, Meds. A bi-directional sync watches the clinical system. When a status changes there, it updates the HubSpot deal stage and contact lifecycle instantly, firing the relevant nurture or suppression logic.
An integration architecture connecting HubSpot with a custom ERP and Twilio. It establishes an API bridge to safely orchestrate healthcare automation and data synchronization. This ensures compliant, real-time communication between telehealth platforms and patient engagement workflows.
FAQ