Back to Eliza

Twilio Connector

packages/docs/connectors/twilio.md

2.0.14.8 KB
Original Source

Twilio Connector

Connect your agent to Twilio for SMS messaging and voice call capabilities using the @elizaos/plugin-twilio package.

Note: Twilio is registered as a feature plugin (not a connector) in the plugin registry. It provides SMS and voice capabilities but is categorized under features in plugins.json.

Overview

The Twilio plugin is an elizaOS feature plugin that bridges your agent to Twilio's communication APIs. It supports inbound and outbound SMS, as well as voice call capabilities. This plugin is available from the plugin registry.

Note: Twilio is categorized as a feature plugin, not a connector. Configure it with environment variables rather than the connectors section.

Package Info

FieldValue
Package@elizaos/plugin-twilio
Config keyconnectors.twilio
Installeliza plugins install @elizaos/plugin-twilio

Setup

1. Get Your Twilio Credentials

  1. Sign up at twilio.com
  2. From the Twilio Console dashboard, copy your Account SID and Auth Token
  3. Purchase or configure a Twilio phone number

2. Configure Eliza

NameRequiredDescription
TWILIO_ACCOUNT_SIDYesTwilio Account SID
TWILIO_AUTH_TOKENYesTwilio Auth Token
TWILIO_PHONE_NUMBERNoTwilio phone number for sending/receiving
TWILIO_WEBHOOK_URLNoWebhook URL for inbound messages
TWILIO_WEBHOOK_PORTNoPort for the webhook server
VOICE_CALL_ENABLEDNoEnable voice call capabilities
VOICE_CALL_PROVIDERNoVoice call provider selection
VOICE_CALL_FROM_NUMBERNoPhone number for outbound calls
VOICE_CALL_TO_NUMBERNoDefault destination phone number
VOICE_CALL_ALLOW_FROMNoComma-separated list of allowed caller numbers
VOICE_CALL_PUBLIC_URLNoPublic URL for voice call webhooks
VOICE_CALL_WEBHOOK_PATHNoWebhook path for voice call events
VOICE_CALL_WEBHOOK_PORTNoPort for voice call webhook listener
VOICE_CALL_INBOUND_POLICYNoInbound call handling policy
VOICE_CALL_INBOUND_GREETINGNoGreeting message for inbound connections
VOICE_CALL_MAX_CONCURRENT_CALLSNoMaximum number of concurrent calls
VOICE_CALL_MAX_DURATION_SECONDSNoMaximum call duration in seconds

Install the plugin from the registry:

bash
eliza plugins install twilio

Configure in ~/.eliza/eliza.json:

json
{
  "connectors": {
    "twilio": {
      "accountSid": "YOUR_ACCOUNT_SID",
      "authToken": "YOUR_AUTH_TOKEN",
      "phoneNumber": "+1234567890"
    }
  }
}

Or via environment variables:

bash
export TWILIO_ACCOUNT_SID=YOUR_ACCOUNT_SID
export TWILIO_AUTH_TOKEN=YOUR_AUTH_TOKEN
export TWILIO_PHONE_NUMBER=+1234567890

Environment Variables

Core

VariableRequiredDescription
TWILIO_ACCOUNT_SIDYesTwilio Account SID
TWILIO_AUTH_TOKENYesTwilio Auth Token
TWILIO_PHONE_NUMBERYesTwilio phone number (E.164 format)
TWILIO_WEBHOOK_URLNoWebhook URL for inbound messages
TWILIO_WEBHOOK_PORTNoPort for webhook listener

Voice Calls

VariableRequiredDescription
VOICE_CALL_ENABLEDNoEnable voice call capabilities
VOICE_CALL_PROVIDERNoVoice call provider selection
VOICE_CALL_FROM_NUMBERNoPhone number for outbound calls
VOICE_CALL_TO_NUMBERNoDefault destination phone number
VOICE_CALL_ALLOW_FROMNoComma-separated list of allowed caller numbers
VOICE_CALL_PUBLIC_URLNoPublic URL for voice call webhooks
VOICE_CALL_INBOUND_POLICYNoInbound call handling policy
VOICE_CALL_INBOUND_GREETINGNoGreeting message for inbound calls
VOICE_CALL_WEBHOOK_PATHNoWebhook path for voice call events
VOICE_CALL_WEBHOOK_PORTNoPort for voice call webhook listener
VOICE_CALL_MAX_CONCURRENT_CALLSNoMaximum number of concurrent calls
VOICE_CALL_MAX_DURATION_SECONDSNoMaximum call duration in seconds

Configuration Reference

FieldRequiredDescription
accountSidYesTwilio Account SID
authTokenYesTwilio Auth Token
phoneNumberYesTwilio phone number (E.164 format)
enabledNoSet false to disable (default: true)

Features

  • SMS messaging (send and receive)
  • Voice call capabilities (inbound and outbound)
  • Webhook-based inbound message handling
  • Configurable inbound call policies and greetings
  • Concurrent call management
  • Call duration limits