A lightweight Python automation tool for sending SMS messages and initiating voice calls using the Telnyx API. Built for personal automation workflows, notifications, and call routing.
- Send outbound SMS messages via Telnyx
- Initiate and manage outbound voice calls
- Webhook handler for inbound SMS and call events
- Simple CLI interface for quick one-off sends
- Environment-based config (no hardcoded credentials)
- Python 3.9+
- A Telnyx account with an API key and a phone number
pip install -r requirements.txt
git clone https://github.com/Cyber1245-ai/telnyx-sms-voice-bot.git
cd telnyx-sms-voice-bot
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your Telnyx API key and phone numberCopy .env.example to .env and fill in your credentials:
TELNYX_API_KEY=your_api_key_here
TELNYX_PHONE_NUMBER=+1XXXXXXXXXX
python cli.py sms --to +1XXXXXXXXXX --message "Hello from the bot!"python cli.py call --to +1XXXXXXXXXX --say "This is an automated message."python server.pyThe webhook server listens on port 5000 by default and handles inbound SMS and call events from Telnyx.
telnyx-sms-voice-bot/
├── bot/
│ ├── __init__.py
│ ├── sms.py # SMS send/receive logic
│ ├── voice.py # Voice call logic
│ └── webhooks.py # Inbound event handlers
├── cli.py # Command-line interface
├── server.py # Flask webhook server
├── config.py # Config loader
├── requirements.txt
├── .env.example
└── README.md
| Event | Description |
|---|---|
message.received |
Inbound SMS received |
call.initiated |
Outbound call started |
call.answered |
Call was answered |
call.hangup |
Call ended |
MIT License. See LICENSE for details.