Freshdesk and Twilio integrate through the Freshdesk Tickets API and Twilio's inbound webhook system to convert customer SMS messages into Freshdesk support tickets automatically, associate them with the correct contact, and send resolution SMS notifications back when agents close tickets. This integration is used by support teams running Freshdesk as their helpdesk who want to add SMS as a contact channel without purchasing a separate SMS tool or switching platforms. The architecture receives inbound SMS at a Twilio number, passes the event to middleware that creates or updates the Freshdesk ticket, and optionally uses Freshdesk Automations to fire outbound SMS at ticket lifecycle events.
What You Need Before You Start
Generate a Freshdesk API key from the Freshdesk account settings under Profile Settings, then click the eye icon next to Your API Key to reveal and copy the key value. Your Freshdesk API base URL is https://{domain}.freshdesk.com/api/v2/ and all requests require Basic authentication with the API key as the username and the letter X as the password, as the Freshdesk API does not use a password field. From Twilio, collect your Account SID, Auth Token, and an SMS-capable phone number, and configure that number's Messaging webhook URL in the Twilio Console to your middleware inbound handler endpoint. Confirm your Freshdesk account has the phone channel enabled under Admin, then Channels, then Phone, as Freshdesk requires the phone channel to be active before tickets can be associated with phone contact records created by the integration.
Step-by-Step Integration Guide
When an inbound SMS arrives, your middleware receives the Twilio POST payload containing From, To, Body, and MessageSid, and searches Freshdesk for a contact with that phone number by calling GET https://{domain}.freshdesk.com/api/v2/contacts?mobile={E164number} with Basic authentication and the Content-Type header set to application/json. If no contact exists, create one by calling POST https://{domain}.freshdesk.com/api/v2/contacts with a body containing name set to a placeholder like the phone number and mobile set to the From number in E.164 format, storing the returned id for the ticket creation step. Create a Freshdesk ticket by calling POST https://{domain}.freshdesk.com/api/v2/tickets with a body containing subject set to SMS from {From number}, description set to the message body, requester_id set to the contact ID, status set to 2 for Open, priority set to 1 for Low as a default, and source set to 7 for Chat since SMS maps to the chat source in Freshdesk's channel taxonomy. To send proactive SMS when a ticket is resolved, set up a Freshdesk Automation Rule under Admin, then Automations that fires when the Ticket Status changes to Resolved, adds a webhook action posting to your middleware with the ticket ID and requester phone in the payload, and in your middleware dispatch the Twilio SMS via POST https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json with a resolution message.
Common Issues and How to Fix Them
Freshdesk returns 401 Unauthorized when the API key is passed in the Authorization header using Bearer format instead of the required Basic format with the key as the username and X as the password. Encode the credentials as Base64 using the format {apiKey}:X and include the result in the Authorization header as Basic {base64string}, and verify this by testing the request in a tool like Postman before deploying to middleware. Freshdesk contact search by mobile number fails to match when the phone is stored with a different format than the search query, for example when the contact mobile field contains +12025551234 but the search is performed with 2025551234 without the prefix. Normalize the phone number to E.164 format before both storing the contact and querying for matches, and as a fallback perform a second search without the plus prefix if the first search returns no results. Freshdesk Automation webhook payloads do not include the requester's phone number by default, meaning your middleware receives only the ticket ID and must make a secondary API call to fetch the contact details. Include the requester phone in the webhook payload by using Freshdesk's custom webhook body template in the Automation action, adding a JSON template with requester_id, ticket_id, and requester.phone fields that Freshdesk populates from the ticket data before firing.
How to Get More from This Integration
Build a ticket reply delivery system by adding a Reply via SMS button to the Freshdesk ticket view using a Freshdesk App built with the Freshdesk Developer Kit, which calls your middleware when clicked, passes the ticket ID and agent reply text, retrieves the requester phone from the Freshdesk contact, and sends the Twilio SMS, logging the sent event back to the ticket as a note. Create an SMS first-response SLA tracker by storing the inbound MessageSid and timestamp when creating the Freshdesk ticket, and when the first agent reply SMS is dispatched, calculate the time delta and update a custom ticket field named SMS First Response Time in minutes via PUT https://{domain}.freshdesk.com/api/v2/tickets/{ticketId} for SLA reporting. Implement keyword-based ticket routing by parsing the inbound SMS body in your middleware for keywords such as billing, technical, or sales, and setting the Freshdesk ticket group_id field to the corresponding support team group ID during ticket creation, ensuring SMS inquiries reach the right team without manual triage. Log Twilio delivery receipts back to Freshdesk by pointing the Twilio StatusCallback to a middleware endpoint that calls POST https://{domain}.freshdesk.com/api/v2/tickets/{ticketId}/notes with private set to true and body set to SMS Delivered or SMS Failed plus the MessageSid, giving agents delivery confirmation directly on the ticket.
Conclusion
Freshdesk and Twilio together give your support team a complete SMS ticket management system where every customer text becomes a trackable ticket and every resolution sends an automatic confirmation. Reach out to Telphi Consulting to build and configure this integration for your Freshdesk 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.