Overview
OpenSRE’s Twilio integration delivers investigation findings via SMS using the Twilio Messaging API. It is configured independently of the existingwhatsapp integration, though both can share the same Twilio account credentials. Delivery-only — no gateway or pairing.
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.
Setup
Option 1: 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
twilio (docs path /messaging/twilio-sms).
Option 2: Environment variables
The
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.
Credentials
- Create or open a Twilio account.
- Provision a phone number or Messaging Service for SMS.
- Copy Account SID and Auth Token.
- Set exactly one SMS sender:
TWILIO_SMS_FROMorTWILIO_SMS_MESSAGING_SERVICE_SID(enforced by the verifier). - Set
TWILIO_SMS_DEFAULT_TOfor automatic delivery after investigations (reporting adapter).
Investigation tools
Test with an investigation
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.
Troubleshooting
Security
- Treat Twilio auth tokens like passwords.
- Prefer a dedicated Twilio project for OpenSRE.
- Store credentials in
.envor your secret manager — not in source control.