Skip to main content

Overview

OpenSRE’s Twilio integration delivers investigation findings via SMS using the Twilio Messaging API. It is configured independently of the existing whatsapp 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

You’ll be prompted for:
  • 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 with MG...)
  • optional default recipient
Twilio SMS is not in the onboard Incident & Comms menu — use this setup command. The service key is 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

  1. Create or open a Twilio account.
  2. Provision a phone number or Messaging Service for SMS.
  3. Copy Account SID and Auth Token.
  4. Set exactly one SMS sender: TWILIO_SMS_FROM or TWILIO_SMS_MESSAGING_SERVICE_SID (enforced by the verifier).
  5. Set TWILIO_SMS_DEFAULT_TO for automatic delivery after investigations (reporting adapter).

Investigation tools

Test with an investigation

When the investigation finishes, the RCA summary is truncated to the SMS body limit (1600 chars) and posted via the Twilio Messaging API to the configured recipient.

Verify

A passing verification confirms:
  • The Twilio account credentials authenticate against the Twilio Account API.
  • The SMS channel is enabled and has a usable sender (from_number or messaging_service_sid).
Sample passing output:
If the account authenticates but the SMS channel has no sender, verification returns 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 .env or your secret manager — not in source control.