About Twilio
Twilio is a cloud communications platform for messaging, including WhatsApp and SMS, and voice. This integration connects a Serval Workspace to one Twilio account so workflows can send WhatsApp messages from your Content templates and call the Twilio API. Authentication: Your Twilio Account SID and Auth Token. Serval checks them against Twilio when you save the connection, stores the Auth Token encrypted, and adds the credentials to each request server-side, so workflows never handle them. Serval sends them only toapi.twilio.com, messaging.twilio.com, and content.twilio.com.
Data sync: None. Connecting doesn’t sync anything into Serval, and you don’t configure a webhook in Twilio. Workflows call Twilio on demand.
What the Twilio integration enables
Get your credentials
Pick the Twilio account
Copy the Account SID and Auth Token
AC, and the Auth Token, which stays hidden until you reveal it.POST, PUT, PATCH, and DELETE requests, so a workflow that uses it can do anything the account can through the REST, Messaging, and Content APIs, such as sending messages or changing phone number settings.Prepare WhatsApp messaging in Twilio
The Send WhatsApp Message action needs a WhatsApp sender and at least one Content template in the connected account.Register a WhatsApp sender
Create Content templates
HX. Workflows pass that SID to the action.Submit templates for WhatsApp approval
Connect in Serval
Open the Twilio connect form
Enter the Account SID
AC followed by 32 hexadecimal characters. The form flags any other value before you save.Enter the Auth Token
Save
Verifying the connection
The connection ships three health checks that make live calls to Twilio. Run them from the Health Checks section under the connection’s API Integration settings in Serval:- Test Twilio Connection: authenticates with the stored credentials and reads the account. On success: “Successfully authenticated with Twilio account” followed by the account’s friendly name, when Twilio returns one. When it passes, the credentials and Serval’s path to Twilio both work.
- List Twilio WhatsApp Senders: reads one WhatsApp sender through the Messaging API. It reports the first sender it finds, or passes with “Messaging API reachable, but the account has no WhatsApp senders” when there are none.
- List Twilio Phone Numbers: reads one of the account’s incoming phone numbers. An account with no numbers still passes, with the message “Phone Numbers API reachable, but the account has no incoming phone numbers.”
Gotchas and troubleshooting
Invalid Twilio Account SID or Auth Token
Invalid Twilio Account SID or Auth Token
API keys aren't supported
API keys aren't supported
SK) and its secret don’t work in either field.Rotating the Auth Token breaks the connection
Rotating the Auth Token breaks the connection
Phone numbers must be E.164, without the whatsapp: prefix
Phone numbers must be E.164, without the whatsapp: prefix
fromPhoneNumber and toPhoneNumber as E.164 numbers with a leading +, for example +15551234567. The action adds Twilio’s whatsapp: prefix itself, so it rejects whatsapp:+15551234567, and a number without +, before sending anything.The action sends templates only
The action sends templates only
contentSid must be a Content SID: HX followed by 32 hexadecimal characters. The action has no free-text body. To send a free-form reply within the customer service window, call the Messages API with the Twilio API request action instead.Twilio could not send the WhatsApp message
Twilio could not send the WhatsApp message
Twilio accepted the request but returned an invalid message receipt
Twilio accepted the request but returned an invalid message receipt
A returned status isn't a delivery confirmation
A returned status isn't a delivery confirmation
messageSid and Twilio’s status at the moment it accepted the message, such as queued. It doesn’t wait for delivery. Use the messageSid to look up the message in Twilio later.The WhatsApp Sandbox isn't listed as a sender
The WhatsApp Sandbox isn't listed as a sender
Use form for form-encoded endpoints and body for JSON
Use form for form-encoded endpoints and body for JSON
form for endpoints that expect form-encoded parameters, such as Messages, and body for JSON endpoints, such as the Content API. Supplying both fails with “Specify either body or form, not both.”Only three Twilio hosts are reachable
Only three Twilio hosts are reachable
api.twilio.com, messaging.twilio.com, and content.twilio.com. Other Twilio hosts, such as verify.twilio.com or lookups.twilio.com, are blocked. These hostnames don’t name a Twilio Region, so Twilio handles the requests in its default US1 Region. Region-specific hosts such as api.sydney.au1.twilio.com aren’t reachable.Need help? Contact support@serval.com for assistance with your Twilio integration.

