Twilio

Send SMS notifications, alerts, and two-factor authentication codes using Twilio's reliable messaging platform.

Setup

# .env
TWILIO_ACCOUNT_SID=...
TWILIO_AUTH_TOKEN=...
TWILIO_PHONE_NUMBER=+1234567890

Sending SMS

capabilityId: twilio-send-sms
provider:
  type: twilio
  operation: sendSMS

inputs:
  to:
    type: string
    description: "Phone number in E.164 format"
  body:
    type: string
    description: "Message content (max 1600 chars)"

outputs:
  messageSid:
    type: string
  status:
    type: string

Use cases

  • Order confirmations and shipping updates
  • Two-factor authentication codes
  • Appointment reminders
  • Alert notifications

Best practices

  • Always use E.164 format for phone numbers (+1234567890)
  • Keep messages under 160 characters to avoid splitting
  • Implement rate limiting to prevent spam
  • Handle delivery failures gracefully
  • Respect opt-out requests