Twilio and Five9 integrate through Five9's Digital Engagement channels and the Twilio Messages API to add SMS and WhatsApp as native digital channels in the Five9 contact centre, enabling agents to handle text-based customer interactions in the same Five9 Agent Desktop they use for voice, email, and chat. This integration is used by enterprise contact centres running Five9 for omnichannel customer service who want to add Twilio's carrier-grade SMS and WhatsApp Business channels without replacing their existing Five9 infrastructure or retraining agents on a separate SMS platform. The connection uses Five9's Digital Engagement API to route inbound Twilio SMS and WhatsApp messages into Five9 interaction queues, and uses Five9 workflow rules to trigger outbound Twilio SMS from contact centre events.
What You Need Before You Start
Confirm your Five9 subscription includes the Digital Engagement module by checking with your Five9 account manager, as SMS and non-voice digital channels require the Digital Engagement add-on and are not available on the base voice-only Five9 license. Obtain Five9 API credentials by navigating to Five9 Admin and requesting API access from your Five9 administrator, receiving a username and password for Basic authentication against the Five9 REST API endpoints at https://app.five9.com/appsvcs/rs/svc/. From Twilio, provision an SMS-capable phone number under A2P 10DLC registration for US-bound SMS, and if you are adding WhatsApp connect a Twilio WhatsApp Business sender to your Meta Business Manager account. Configure your Twilio phone number's inbound SMS webhook URL to point to a middleware endpoint that will translate Twilio webhook payloads into Five9 Digital Engagement API calls, bridging the two platforms.
Step-by-Step Integration Guide
In your middleware, receive the Twilio inbound SMS POST with the From, Body, and To fields, then create a new Five9 interaction by calling the Five9 Digital Engagement API at POST https://app.five9.com/appsvcs/rs/svc/interactions with Basic authentication using your Five9 API credentials and a JSON body containing type set to SMS, channelId set to your Five9 SMS channel ID, contactPhone set to the Twilio From number, and messageBody set to the Twilio Body text. Configure a Five9 IVR Script or Digital Engagement workflow rule that routes inbound SMS interactions to the appropriate agent skill queue based on keywords in the message body, directing messages containing words like billing to a billing queue and messages containing order to an order management queue. Handle outbound agent replies from Five9 by subscribing to the Five9 notification service using GET https://app.five9.com/appsvcs/rs/svc/listennotification with a WebSocket connection that receives agent message events, then for each outbound agent SMS message dispatching the reply via the Twilio Messages API with To set to the customer's phone extracted from the interaction contact data. Set up a Twilio StatusCallback URL on each outbound Twilio SMS to receive delivery receipts, and update the Five9 interaction's delivery status using the Five9 API to mark the message as delivered or failed so agents have visibility into whether their outbound SMS reached the customer.
Common Issues and How to Fix Them
Five9 Digital Engagement API calls fail with a 401 Unauthorized response when the Basic authentication credentials use the API user's plain username and password rather than the specific API key credentials issued separately from the admin portal, as Five9 differentiates between supervisor login credentials and API credentials. Request dedicated API credentials from your Five9 administrator through the Five9 admin portal under API Access, use those credentials for all programmatic API calls, and never use agent or supervisor login credentials for server-to-server authentication. Inbound Twilio SMS payloads arrive at your middleware and are successfully converted to Five9 interactions, but agents do not see the SMS in their desktop because the Five9 channel ID used in the API call does not match an active digital engagement channel configured in your Five9 domain. Verify the correct channel ID by calling GET https://app.five9.com/appsvcs/rs/svc/channels with your API credentials and identifying the channel where type is SMS and the status is active, then update your middleware configuration to use that exact channel ID for all SMS interaction creation calls. The Five9 WebSocket notification subscription disconnects after periods of inactivity, causing outbound agent SMS replies to stop being forwarded through Twilio because the listener is no longer receiving events. Implement a WebSocket reconnection handler that detects close events and re-establishes the Five9 notification subscription within 5 seconds of disconnection, and add a health check that periodically sends a ping to the WebSocket connection and reconnects if the pong is not received within 10 seconds.
How to Get More from This Integration
Build a proactive outbound SMS campaign from Five9 by creating a Five9 outbound campaign with a dial list containing customer phone numbers, exporting the campaign disposition data via the Five9 Reporting API at POST https://app.five9.com/appsvcs/rs/svc/reports/run with the report name set to the outbound campaign report, and dispatching a follow-up Twilio SMS to customers who received a voicemail disposition from the Five9 predictive dialer. Add Five9 screen pop SMS integration by triggering a Twilio SMS confirmation to the customer when a Five9 agent accepts an inbound voice call, using the Five9 notification API to detect call acceptance events and dispatching the SMS concurrently with the agent picking up the call so the customer receives a reference number by text while speaking with the agent. Create an after-hours SMS deflection by checking Five9's queue availability via the GET https://app.five9.com/appsvcs/rs/svc/supervisorStatistics/queues endpoint in your middleware before creating a Five9 interaction for an inbound SMS, and if the queue is closed outside business hours responding directly from the middleware with a Twilio SMS informing the customer of business hours and offering a callback scheduling link. Extend the Five9 Twilio integration to include WhatsApp by routing inbound WhatsApp messages from your Twilio WhatsApp sender through the same middleware-to-Five9-API pipeline, creating Five9 WhatsApp interactions using the same Digital Engagement API with type set to WHATSAPP, giving your Five9 agents a unified inbox for SMS and WhatsApp alongside voice.
Conclusion
Twilio and Five9 together bring SMS and WhatsApp into your enterprise contact centre as fully managed digital channels with agent routing, skill-based queuing, and reporting built in. Contact Telphi Consulting to architect and implement the Twilio Five9 digital engagement integration for your contact centre.
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.