SMS with Twilio
The SMS Channel uses Twilio Messaging: inbound messages and delivery callbacks arrive by webhook, while outbound messages use Twilio's REST API.
What You Need
- Twilio Account SID (
ACfollowed by 32 hexadecimal characters); - an SMS-capable
from_numberin E.164 format; - API Key SID (
SKfollowed by 32 hexadecimal characters); - API Key Secret for outbound REST calls;
- Auth Token for verifying Twilio webhook signatures; and
- a public HTTPS callback URL.
See Twilio Messaging documentation for current phone-number and webhook setup.
Connect in Dashboard
- Open Dashboard → Channel → Add.
- Choose SMS (Twilio).
- Enter the Account SID, From number, API Key SID, and Status callback URL.
- Add the API Key Secret and Auth Token.
- Save the credentials, review policy through the CLI wizard, and configure the Twilio number's inbound webhook.
Enable Anyy's shared webhook listener and HTTPS proxy as described in Messaging Platforms. The callback URL must be HTTPS and end with the account route:
https://YOUR_HOST/channels/sms/ACCOUNT_ID/webhook
The default account ID is twilio. Use the same route for inbound messaging and the configured status callback.
Access Policy
SMS defaults to open and supports open, allowlist, or disabled. Choose SMS in the interactive anyy setup channel wizard to change policy. The Dashboard credential form does not expose it, and current setup actions do not edit SMS list entries. Pairing is unavailable; choosing allowlist alone does not add a permitted number.
Phone numbers should be normalized to E.164 form, such as +14155550123.
When HTTPS terminates at a same-host proxy, forward from loopback with accurate X-Forwarded-Proto: https and X-Forwarded-Host. This adapter does not trust forwarded URL headers from a non-loopback connection. Preserve the original public URL and form body for signature verification.
Delivery Receipts
Twilio can report delivery progress to the callback URL. A successful Anyy send first proves dispatch to the provider; inspect the later receipt/status before retrying an uncertain message.
Inbound, outbound, carrier, and international messaging charges depend on the Twilio account and destination. Restrict access and test with a known number before enabling automation.
Verify the Connection
anyy channel doctor sms
anyy channel reload
Send one inbound SMS, confirm the sender policy, then test a reply and delivery status.
Troubleshooting
| Problem | Check |
|---|---|
| Twilio rejects callback URL | Exact HTTPS /channels/sms/ACCOUNT_ID/webhook path |
| Webhook signature fails | Auth Token and proxy preservation of the original URL/body |
| Outbound API fails | Account SID, API Key SID/Secret, and From number capability |
| Sender is ignored | DM policy and E.164 allowlist value |
| Status never advances | Status callback URL and Twilio delivery callback configuration |