Close CRM includes built-in calling and SMS powered by Twilio under the hood, but accessing the raw Twilio API alongside Close unlocks capabilities the native interface does not expose, including custom IVR flows, SMS automation tied to lead status changes, and external call routing to non-Close numbers. This integration connects the Close API with your own Twilio account so you can log SMS activities sent from Twilio back into Close lead timelines and trigger Twilio messages from Close webhook events without manual copying between systems. Teams building power dialers, multi-step SMS sequences, or external call routing on top of Close use this pattern to extend the CRM without replacing it.
What You Need Before You Start
Generate a Close API key from Settings, then Developer, then API Keys in your Close account, and confirm you have at least a Close Business subscription since webhooks and advanced API features are limited on the Startup tier. From Twilio, collect your Account SID, Auth Token, and a dedicated phone number separate from any numbers already assigned inside Close, to avoid routing conflicts between Close's native SMS delivery and your custom Twilio integration. Set up a Close Webhook subscription from Settings, then Developer, then Webhooks, subscribing to the events lead.updated and activity.sms_created to detect status changes and existing SMS activity that your middleware can act on. Your middleware needs a public HTTPS endpoint and should maintain a local mapping between Close lead IDs and primary contact phone numbers to avoid repeated Close API lookups on every webhook event.
Step-by-Step Integration Guide
Configure Close Webhooks to POST to your middleware endpoint on the lead.updated event, and in your handler check the data.status_id field against the status IDs for your target stages, which you can retrieve by calling GET https://api.close.com/api/v1/status/lead/ with your API key in the Authorization header as Basic {base64(apiKey:)}. When your target status is detected in the webhook payload, fetch the lead's primary contact phone by calling GET https://api.close.com/api/v1/lead/{leadId}/ and reading contacts[0].phones[0].phone from the response, normalizing it to E.164 before using it. Send the Twilio SMS by calling POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json with To set to the E.164 phone, From set to your Twilio number, Body set to your message, and StatusCallback set to your delivery endpoint. After the Twilio call succeeds, log the sent SMS back into Close by posting to POST https://api.close.com/api/v1/activity/sms/ with lead_id, contact_id, direction set to outbound, status set to sent, text set to the message body, and local_phone and remote_phone set to your Twilio number and the contact phone respectively.
Common Issues and How to Fix Them
Close's SMS activity API requires both local_phone and remote_phone to be in strict E.164 format, and submitting numbers in any other format returns a 400 Bad Request with a phone number validation error message. Always normalize both the Twilio number and the contact phone through a libphonenumber parsing function before constructing the activity POST body. Close Webhooks do not retry on delivery failure and fire only once per event, meaning if your middleware is down or returns a non-200 response during a lead status change, that trigger is permanently lost. Implement a recovery job that runs every 15 minutes calling GET https://api.close.com/api/v1/lead/?query=status_label:{targetStatus}&_skip=0&_limit=100 to find leads in target statuses and cross-references them against your local sent-message log to catch any gaps. Duplicate SMS sends occur when a rep moves a lead's status back and then forward again within a short window, firing the webhook twice for the same target status on the same lead. Add a cooldown check in your middleware that queries your database for any SMS sent to that lead in the same status within the past 24 hours and skips the send if one is found, logging the suppression reason for auditability.
How to Get More from This Integration
Build an inbound routing layer where Twilio receives calls or SMS from prospects, searches Close leads by calling GET https://api.close.com/api/v1/lead/?query=phone_number:{E164number} to find the matching lead, and routes the communication to the Close lead owner or logs an inbound SMS activity automatically without any rep intervention. Use Twilio Studio to build a multi-step SMS survey flow and record each response as a Close custom activity or note by posting to POST https://api.close.com/api/v1/activity/note/ with note_html containing the survey question, the answer, and the timestamp. Create a power dialer by building a queue of Close leads filtered by target status, sequentially initiating Twilio calls via the REST API, and recording call outcomes by creating Close call activity records with the disposition and duration from the Twilio StatusCallback payload. Set Twilio call recordings to write their URL to a Close note via POST https://api.close.com/api/v1/activity/note/ with note_html linking to the RecordingUrl, giving managers access to every recorded call from the lead timeline in Close.
Conclusion
Twilio and Close CRM together give you the pipeline visibility of a purpose-built sales CRM combined with the full programmability of a carrier-grade communications platform. Reach out to Telphi Consulting to build custom SMS sequences or power dialer workflows on top of your Close account.
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.