Twilio
Use Twilio to connect an agent to phone calls (Twilio Voice) and WhatsApp (Twilio WhatsApp). Both are connected per agent in the Channels tab of the agent builder and share the same Twilio account credentials.
Prerequisites
- A saved agent (the Channels tab is locked until the agent is saved).
- A Twilio account — your Account SID and Auth Token from the Twilio Console .
- For Voice: a voice-enabled Twilio phone number.
- For WhatsApp: a Twilio WhatsApp sender (or the Twilio Sandbox for testing).
Twilio Voice
The agent answers and places phone calls. Twilio handles speech-to-text and text-to-speech (Amazon Polly voices); your agent drives the conversation via TwiML.
Fields
| Field | Notes | Required |
|---|---|---|
| Account SID | Twilio Console → Account Info | Yes |
| Auth Token | Twilio Console dashboard | Yes |
| Phone Number | Your Twilio number in E.164 format | No |
| Voice | An Amazon Polly voice for responses | No (defaults provided) |
| Greeting Message | Spoken when a call is answered | No |
How to connect
- Enter Twilio credentialsIn the agent’s Channels tab, open Twilio Voice → Configure and enter the Account SID and Auth Token. Pick a voice and greeting.
- Point your number at TeamMateIn Twilio Console → Phone Numbers → Active Numbers, open your number and set “A call comes in” to Webhook (HTTP POST), pasting TeamMate’s Voice Webhook URL.
- Save in TwilioSave the number configuration.
- Test the callUse Call Me in the Testing step, or call the Twilio number directly.
Voice webhook URL: https://tmmate.ai/api/webhook/twilio/voice/<agentId> (status callback: .../status).
Twilio WhatsApp
The agent sends and receives WhatsApp messages through Twilio.
Fields
| Field | Notes | Required |
|---|---|---|
| Account SID | Twilio Console → Account Info | Yes |
| Auth Token | Twilio Console dashboard | Yes |
| WhatsApp Phone Number | Your WhatsApp-enabled number in E.164 format | Yes |
| Messaging Service SID | Twilio Console → Messaging → Services | No |
How to connect
- Enter Twilio credentialsIn the agent’s Channels tab, open Twilio WhatsApp → Configure and enter the Account SID, Auth Token, and WhatsApp number.
- Set the webhook in TwilioIn Twilio Console → Messaging → Services → your service → Integration, paste TeamMate’s webhook URL for incoming messages (HTTP POST) and save.
- Test itUse the Testing step to message your number. For the Twilio Sandbox, opt in by sending join <keyword> to the sandbox number first.
WhatsApp webhook URL: https://tmmate.ai/api/webhook/twilio/whatsapp/<agentId> (status callback: https://tmmate.ai/api/webhook/twilio/status/<agentId>).
Limits
- Twilio WhatsApp supports media up to 16 MB.
- Sandbox messages only reach numbers that have opted in with the join keyword.
Troubleshooting
- Test call/message fails. Re-check the Account SID and Auth Token, and that the number is voice- or WhatsApp-enabled.
- No inbound calls. Confirm the number’s “A call comes in” webhook points at the Voice Webhook URL with HTTP POST.