A FastAPI application for sending SMS messages via Clicksend.
- 📱 Send SMS messages
- 🔄 Update message status
- 🚫 Unsubscribe phone numbers
- 👀 View message history
- ⚙️ YAML-based configuration
pip install -r requirements.txtEdit config.yaml and add your Clicksend credentials:
clicksend:
username: "your_clicksend_username"
api_key: "your_clicksend_api_key"python main.pyOr with uvicorn directly:
uvicorn main:app --reload --host 0.0.0.0 --port 8000The API will be available at http://localhost:8000
POST /mereth/api/send
{
"to": "+1234567890",
"message": "Hello from Mereth SMS API!",
"from_number": "YourSenderID"
}POST /mereth/api/update
{
"message_id": "12345678-1234-1234-1234-123456789012"
}POST /mereth/api/unsubscribe
{
"phone_number": "+1234567890"
}POST /mereth/api/view
{
"limit": 10
}curl -X POST "http://localhost:8000/mereth/api/send" \
-H "Content-Type: application/json" \
-d '{
"to": "+1234567890",
"message": "Test message",
"from_number": "YourSenderID"
}'curl -X POST "http://localhost:8000/mereth/api/view" \
-H "Content-Type: application/json" \
-d '{"limit": 10}'Once running, visit:
- Swagger UI:
http://localhost:8000/docs - ReDoc:
http://localhost:8000/redoc
- Phone numbers should be in E.164 format (e.g.,
+1234567890) - Messages are limited to 1600 characters
- Make sure your Clicksend account has sufficient credits
The API includes comprehensive error handling and logging. Check console output for detailed error messages.