whatsapp integration, though both can share the same Twilio
account credentials.
WhatsApp delivery is owned entirely by the separate
whatsapp integration
(opensre integrations setup whatsapp) — see the WhatsApp
page. The twilio integration documented here is SMS-only. For voice
paging on critical incidents, route through PagerDuty or Opsgenie, which
provide voice escalation with proper acknowledgement.Prerequisites
- A Twilio account: Sign up.
- A Twilio-provisioned phone number or a Messaging Service SID.
Step 1: Configure the integration
Via CLI wizard (recommended)
- Twilio Account SID (starts with
AC...) - Twilio Auth Token
- Twilio SMS From number (E.164, e.g.
+14155551234) — or leave blank and provide a Messaging Service SID (starts withMG...) - optional default recipient
Via environment variables
Add to your.env file:
twilio env-bootstrap activates when the account + token are set and
an SMS sender (TWILIO_SMS_FROM or TWILIO_SMS_MESSAGING_SERVICE_SID) is
present. The legacy whatsapp record is bootstrapped independently from
TWILIO_WHATSAPP_FROM.
Step 2: Verify
- The Twilio account credentials authenticate against the Twilio Account API.
- The SMS channel is enabled and has a usable sender (
from_numberormessaging_service_sid).
failed with a message telling you to set a
from_number or messaging_service_sid.
Step 3: Test with an investigation
Trigger a real investigation against a bundled fixture:Programmatic notifications: twilio_notify tool
When the Twilio integration is configured, the investigation planner
exposes a twilio_notify tool. The tool sends a short notification body
via SMS and returns the Twilio Message SID for traceability.
Troubleshooting
opensre integrations verify twilio errors
| Detail | Likely cause |
|---|---|
Missing account_sid | TWILIO_ACCOUNT_SID is unset. |
Missing auth_token | TWILIO_AUTH_TOKEN is unset. |
Twilio API check failed: 401 | The SID/token pair is invalid. |
SMS channel is not ready | No SMS sender — set TWILIO_SMS_FROM or TWILIO_SMS_MESSAGING_SERVICE_SID. |
SMS never arrives but verify passes
- Confirm
TWILIO_SMS_FROM(or the Messaging Service SID) is provisioned for the destination country. - Confirm the recipient is in E.164 format (
+14155550000). - For trial accounts: the recipient must be a verified caller ID.
- Inspect
Messagesin the Twilio Console for an error code; common failures (30007,21610, etc.) are documented at twilio.com/docs/api/errors.
Tracer