Skip to main content

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 (AC followed by 32 hexadecimal characters);
  • an SMS-capable from_number in E.164 format;
  • API Key SID (SK followed 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​

  1. Open Dashboard → Channel → Add.
  2. Choose SMS (Twilio).
  3. Enter the Account SID, From number, API Key SID, and Status callback URL.
  4. Add the API Key Secret and Auth Token.
  5. 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.

SMS can create direct cost

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​

ProblemCheck
Twilio rejects callback URLExact HTTPS /channels/sms/ACCOUNT_ID/webhook path
Webhook signature failsAuth Token and proxy preservation of the original URL/body
Outbound API failsAccount SID, API Key SID/Secret, and From number capability
Sender is ignoredDM policy and E.164 allowlist value
Status never advancesStatus callback URL and Twilio delivery callback configuration