Drift and Twilio integrate to extend live chat conversations into SMS, so when a website visitor starts a chat but leaves before a rep connects, your team can follow up by text message using the phone number the visitor provided during the conversation. This integration closes the gap between the real-time chat channel and the asynchronous SMS channel, which consistently achieves higher open and response rates for sales follow-up than email. The connection uses Drift Webhooks to detect conversation events, the Drift REST API to read contact details including phone number, and Twilio's Messages API to send the follow-up SMS automatically.
What You Need Before You Start
Generate a Drift API token by going to Settings, then Integrations, then API in your Drift account and creating a new app token with permissions for reading conversations and contacts and writing messages. Your Drift API base URL is https://driftapi.com/ and you will use the conversations and contacts endpoints to retrieve session data and visitor phone numbers collected during the chat. From Twilio, collect your Account SID, Auth Token, and an SMS-capable phone number, and decide whether reps will reply to SMS from a shared team number or from individual Twilio numbers assigned to each rep for personalized outreach. Configure a Drift Webhook subscription by going to Settings, then Integrations, then Webhooks in Drift and subscribing to the conversation_started and new_message events, pointing the delivery URL to your middleware endpoint over HTTPS.
Step-by-Step Integration Guide
In your Drift Webhook handler, receive the conversation_started event payload and extract the conversationId and contactId from the data object, then call GET https://driftapi.com/contacts/{contactId} with your Drift token in the Authorization header as Bearer {token} to retrieve the contact attributes including the phone field if the visitor provided it in the chat. If the contact record contains a valid phone number, store the conversationId-to-phone mapping in your database and set a timer that fires after 5 minutes, at which point your system checks the conversation status via GET https://driftapi.com/conversations/{conversationId} to see whether it is still in a waiting state before deciding to send the SMS. Send the follow-up SMS via POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json with To set to the contact phone, From set to your Twilio number, and Body set to a message such as your visitor's name followed by a note that your team saw the message and will reply shortly via text. Route inbound SMS replies back into the Drift conversation thread by calling POST https://driftapi.com/conversations/{conversationId}/messages with the body containing the message text from the Twilio inbound payload, so the rep sees the customer reply inside the Drift conversation without needing to switch to a separate SMS interface.
Common Issues and How to Fix Them
Drift contact records frequently do not contain a phone number because most chat visitors do not volunteer it proactively, and attempting to send an SMS to a null value results in a Twilio error 21211 for an invalid To field. Build a guard in your middleware that checks for a non-empty, valid phone number before scheduling the SMS send, and update your Drift bot playbook to ask for the visitor's phone early in the conversation flow to increase the rate of phone capture before they navigate away. Drift Webhooks expect a 200 OK response within 10 seconds and retry the event up to 5 times with exponential backoff on failure or timeout, which can cause your middleware to send duplicate SMS if the first request timed out but already sent the message. Acknowledge every Drift Webhook immediately with a 200 OK before starting any asynchronous work, and use the event ID from the webhook payload as an idempotency key to skip processing on any retry you have already handled. The Drift API enforces a rate limit of 10 requests per second per API token, and a high-traffic chat environment with many simultaneous conversations can exceed this when your middleware fires multiple Drift API calls per event in rapid succession. Implement a token bucket rate limiter in your middleware that queues excess Drift API calls and processes them at a steady rate below 10 per second to stay within the limit without dropping conversation events.
How to Get More from This Integration
Build a two-way SMS bridge where all replies from a Drift-originated conversation are forwarded into the Drift thread in real time via the messages endpoint, and all messages a Drift rep sends in the conversation are echoed to the prospect's SMS thread via Twilio, creating a seamless channel handoff that is invisible to the customer. Store the Twilio number used for each follow-up on the Drift contact record by calling PATCH https://driftapi.com/contacts/{contactId} with an attributes field containing twilio_sms_number set to the phone used, enabling any rep to pick up the SMS thread from the Drift contact profile without needing to look up the number separately. Track SMS follow-up conversion rates by adding a Drift conversation tag via PATCH https://driftapi.com/conversations/{conversationId} each time an SMS is sent, then comparing tagged versus untagged conversations in Drift reporting to measure whether SMS follow-up measurably improves meeting booking rates. Extend phone capture in Drift bot flows by using a Drift bot question block that explicitly requests the visitor's phone number and writes it to the contact attribute immediately on response, increasing the percentage of conversations where SMS follow-up is possible before the visitor leaves the page.
Conclusion
Twilio and Drift together create a channel continuity layer that keeps sales conversations alive after the chat window closes, using SMS to re-engage prospects at response rates far above email follow-up. Reach out to Telphi Consulting to implement this integration in your Drift workspace.
Ready to Transform Your Business Communications?
Get a free consultation with our VoIP experts and discover how we can help you save costs, improve efficiency, and scale your business.
Comments (0)
Join the discussion and share your thoughts (AI-moderated for quality)
Be the first to comment
No comments yet. Share your thoughts below.