CTRL K
Description
The Twilio integration receives provider webhooks at /api/twilio/[userId], routes inbound text through the WhatsApp-compatible RAG trigger, and sends assistant replies through /api/twilio/reply. Use it when Twilio owns the phone number or WhatsApp sender that customers already use.
Prerequisites
- Twilio account with an SMS-capable number or approved WhatsApp sender.
- Account SID, auth token, and sender number.
- Public HTTPS webhook URL for the Kommander organization.
- A trained Kommander assistant and tested fallback behavior.
Setup
- Open Integrations > Twilio in Kommander and copy the webhook URL.
- In Twilio, set the inbound message webhook for the sender to
https://YOUR_DOMAIN/api/twilio/YOUR_ORGANIZATION_ID. - Save the Account SID, auth token, and sender number in Kommander.
- Send a test SMS or WhatsApp message to the Twilio sender.
- Confirm the conversation appears in Kommander and the reply is delivered by Twilio.
Architecture Diagram
Configuration
| Setting | Required | Notes |
|---|---|---|
| Account SID | Yes | Twilio account identifier. |
| Auth token | Yes | Keep encrypted and rotate if exposed. |
| Sender number | Yes | Must match the configured Twilio sender. |
| Webhook URL | Yes | Use /api/twilio/[userId] for inbound messages. |
Limitations
- Twilio channel capabilities vary between SMS and WhatsApp senders.
- Long messages may be split or billed as multiple segments.
- Media and rich interactions need explicit Twilio handling beyond text replies.
Troubleshooting
- If Twilio reports a webhook error, inspect the Twilio request log for HTTP status and response body.
- If replies come from the wrong number, verify the saved sender number.
- If messages appear but replies fail, rotate the auth token and confirm the Account SID belongs to the sender.
- If the assistant response is delayed, check RAG trigger and Twilio delivery logs separately.