Twilio and Intercom integrate to add SMS as a communication channel inside the Intercom inbox, letting your support and sales team send and receive text messages alongside live chat, email, and social conversations without switching to a separate SMS tool. This integration suits teams that already use Intercom as their primary customer communication hub and want to reach contacts via SMS for high-urgency support follow-ups, outbound sales sequences, or transactional notifications tied to customer lifecycle events in Intercom. The connection is built using Twilio's inbound webhook to receive SMS, the Intercom Conversations API to create or update conversation records, and Intercom webhooks to capture agent replies that are then dispatched back to the customer via the Twilio Messages API.
What You Need Before You Start
Generate an Intercom API access token from the Intercom Developer Hub by creating an app under your workspace, navigating to Authentication, and copying the Access Token, then confirm it has the conversations:read, conversations:write, contacts:read, and contacts:write permission scopes enabled. Your Intercom REST API base URL is https://api.intercom.io/ and all requests require the Authorization header set to Bearer {accessToken} and the Content-Type header set to application/json. From Twilio, collect your Account SID, Auth Token, and an SMS-capable phone number, and set your Twilio number's Messaging webhook URL in the Console to your middleware inbound handler endpoint. Decide whether you will use Intercom's standard email-channel workaround to bring SMS into the inbox, or the Intercom Switch feature (available on certain plans) which handles channel-switching natively, as this determines the conversation creation approach your middleware uses.
Step-by-Step Integration Guide
When an inbound SMS arrives at your Twilio number, your middleware receives the From, To, Body, and MessageSid fields from Twilio's POST payload and searches Intercom for an existing contact with that phone number by calling GET https://api.intercom.io/contacts?query={phone} or the search endpoint POST https://api.intercom.io/contacts/search with a filter on the phone attribute. If no contact exists, create one by calling POST https://api.intercom.io/contacts with a JSON body containing role set to user and phone set to the E.164 From number, then use the returned contact id in the next step. Create an Intercom conversation for the inbound SMS by calling POST https://api.intercom.io/conversations with a body containing from.type set to user, from.id set to the contact ID, and body set to the SMS message text, which opens the conversation in your Intercom inbox queue for agent pickup. To capture agent SMS replies sent from Intercom and deliver them back via Twilio, configure an Intercom webhook subscription at POST https://api.intercom.io/subscriptions with topics containing conversation.replied, pointing the url to your middleware reply handler that extracts the reply body and contact phone from the webhook payload and calls POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json with To set to the contact phone and Body set to the reply text.
Common Issues and How to Fix Them
Intercom creates duplicate contact records when an inbound SMS from a new phone number arrives and a contact with that phone already exists but was created without an E.164-formatted phone, causing the search query to miss the match and create a second record. Normalize the incoming Twilio From number to E.164 before searching, and add a secondary search using the contact's name or email if available to catch existing contacts whose phone was stored in a different format. Intercom conversations created via the API by the same user in quick succession merge into the existing open conversation rather than creating new ones, which is usually the desired behavior but can cause issues if your middleware creates a new conversation for each SMS and expects separate conversation IDs for threading. Track the active conversation ID per contact in your middleware database and add subsequent SMS messages to the existing conversation using the POST https://api.intercom.io/conversations/{id}/parts endpoint with type set to note or comment rather than always creating new conversations. Intercom webhook delivery for conversation.replied events uses an HMAC-SHA256 signature in the X-Hub-Signature header for request validation, and failing to verify this signature is a security risk if your middleware processes all POSTs to that endpoint as legitimate replies. Implement signature verification by computing HMAC-SHA256 of the raw request body using your Intercom client secret and comparing the hex digest against the value in the X-Hub-Signature header before processing any Intercom webhook payload.
How to Get More from This Integration
Build automated outbound SMS from Intercom by subscribing to the contact.created Intercom webhook event and triggering a Twilio welcome SMS to newly created contacts who have a phone number, personalizing the message using the contact's name from the Intercom webhook payload. Use Intercom's Custom Data Attributes to store the Twilio MessageSid of the last outbound SMS on each contact record by calling POST https://api.intercom.io/contacts/{contactId}/custom_data_attributes with the attribute name and value, giving your support team a reference to look up delivery status in the Twilio Console when a customer claims they did not receive a message. Extend the integration to Intercom Series (automated message sequences) by triggering Twilio SMS at specific Series steps using the Intercom Outbound Messages webhook event, dispatching the Series message body as an SMS to the enrolled contact's phone for multi-channel nurture sequences. Add conversation routing by tagging Intercom conversations created from SMS with a custom tag such as sms-channel via POST https://api.intercom.io/conversations/{id}/tags after creation, enabling your Intercom inbox assignment rules to automatically route SMS-originated conversations to a dedicated SMS support team rather than the general inbox queue.
Conclusion
Twilio and Intercom together create a unified customer communication hub where SMS conversations live alongside chat and email in the same inbox your team already works from. Talk to our team at Telphi Consulting to build and integrate this SMS channel into your Intercom 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.