A Python Flask application that sends voice reminder calls using Twilio.
- Make voice reminder calls via Twilio API
- RESTful API endpoints for scheduling reminders
- Webhook support for call status updates
- Test script for direct call testing
- Python 3.7 or higher
- A Twilio account (sign up at https://www.twilio.com/)
- A Twilio phone number with voice capabilities
pip install -r requirements.txt-
Copy the example environment file:
cp .env.example .env
-
Edit
.envand add your Twilio credentials:TWILIO_ACCOUNT_SID: Found in your Twilio Console dashboardTWILIO_AUTH_TOKEN: Found in your Twilio Console dashboardTWILIO_PHONE_NUMBER: Your Twilio phone number (E.164 format, e.g., +1234567890)
python app.pyThe server will start on http://localhost:5000 by default.
Since Twilio needs to send webhooks to your server, you'll need to expose your local server to the internet. Use one of these options:
Option A: Using ngrok (Recommended for testing)
# Install ngrok: https://ngrok.com/download
ngrok http 5000Copy the HTTPS URL provided by ngrok (e.g., https://abc123.ngrok.io) and use it in your Twilio webhook URLs.
Option B: Deploy to a cloud service Deploy your Flask app to Heroku, AWS, or another cloud platform.
Send a POST request to /make-call:
curl -X POST http://localhost:5000/make-call \
-H "Content-Type: application/json" \
-d '{
"to": "+1234567890",
"message": "Don't forget your meeting at 3 PM today!"
}'Run the test script:
python make_call.py +1234567890 "Your reminder message here"Or run it interactively:
python make_call.pyGET /- API information and available endpointsPOST /make-call- Make a voice reminder call- Required JSON fields:
to(phone number),message(optional, defaults to "This is your reminder.")
- Required JSON fields:
POST /voice- Twilio webhook for handling voice calls (TwiML response)POST /call-status- Twilio webhook for call status updates
.
├── app.py # Main Flask web server with API endpoints
├── make_call.py # Test script for making phone calls
├── requirements.txt # Python dependencies
├── .env.example # Template for environment variables
├── .env # Your actual environment variables (create this)
└── README.md # This file
The main Flask application that provides REST API endpoints for making voice calls. It handles:
- Making calls via Twilio API
- Generating TwiML responses for voice calls
- Receiving call status webhooks from Twilio
A standalone test script that demonstrates how to make a phone call using the Twilio Python SDK. Useful for testing your Twilio credentials and setup.
Lists all Python package dependencies needed for the project:
twilio: Twilio SDK for making callsflask: Web framework for the API serverpython-dotenv: For loading environment variables from.envfile
Template file showing what environment variables are needed. Copy this to .env and fill in your actual Twilio credentials.
This documentation file with setup and usage instructions.
- Never commit your
.envfile to version control - Keep your Twilio Auth Token secret
- Use environment variables for all sensitive credentials
- Consider adding
.envto your.gitignorefile
- "Twilio client not initialized": Check that your
.envfile exists and contains valid credentials - Call fails: Verify your Twilio phone number has voice capabilities and you have sufficient account balance
- Webhook not working: Ensure your server is publicly accessible (use ngrok or deploy to cloud)
This project is provided as-is for educational purposes.

