Identity-wide exclusions
Any opt-out or missing consent on an ID excludes every row for that ID, regardless of order.
Batch SMS Campaign Automation · Python CLI
A consent-first Python workflow to validate recipients, prepare personalized SMS, and deliberately submit reviewed campaigns through an Android gateway.
Real submission requires a separate Android phone running SMS Gateway for Android. This website never sends messages.
Explore the optional Dry RunSoftware checks support your review. They do not establish consent or guarantee delivery.
THE ANDROID CONNECTION
The Python CLI and Android app are separate software. SMS Gateway for Android is an external project, not an app distributed by this repository.
API acceptance → queueing → device processing → carrier delivery are separate stages. A successful API response is not a delivery receipt. This CLI does not poll delivery receipts.
Installing this repository does not install the phone app. No APK is hosted here.
The CLI calls the provider’s cloud API, which routes queued messages to the registered Android device. The device needs internet connectivity. Phone numbers and message content pass through third-party infrastructure; assess its privacy terms. This client does not implement the provider’s optional end-to-end encryption.
The default endpoint is https://api.sms-gate.app/3rdparty/v1/messages. The existing client uses Basic authentication; the provider now recommends JWT for new integrations while retaining Basic compatibility.
The Python client communicates with the Android device over your controlled network. The official local example uses HTTP, but this CLI refuses plain HTTP for live endpoints. A trusted HTTPS proxy or equivalent TLS deployment is required; do not disable certificate checks. Configure the full compatible URL using SMS_API_ENDPOINT and verify the deployed route/version.
Local mode supports Basic authentication. Network access, device service availability and secure routing are operator responsibilities.
Official local-server setupFor privately reviewed, permission-based communications. Purchased, scraped and unverified lists must not be used.
{name} templates, bounded CSV input and recipient counts. Invalid rows prevent live submission.QUICK START · NO SMS
Install Python 3.10–3.14 and Git on your computer. Package access is needed during installation; the default first run does not contact a gateway. No Android phone, credentials or .env file is needed for this example.
Run from a new terminal. The Python launcher selects your installed supported version.
git clone https://github.com/AlirezaBelal/batch-sms-campaign-automation.git
cd batch-sms-campaign-automation
py -3 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
python main.pyIf local policy prevents activation, run .\.venv\Scripts\python.exe -m pip install -r requirements.txt, then .\.venv\Scripts\python.exe main.py.
Use an installed Python 3.10–3.14.
git clone https://github.com/AlirezaBelal/batch-sms-campaign-automation.git
cd batch-sms-campaign-automation
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python main.pyUse Python 3.10–3.14 with its virtual-environment package installed.
git clone https://github.com/AlirezaBelal/batch-sms-campaign-automation.git
cd batch-sms-campaign-automation
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
python main.pyTwo aggregate JSON events: preflight, then summary. The bundled fictional example reports two simulated recipients and zero accepted or queued submissions.
python main.py performs Dry Run only. It does not send SMS or contact a gateway, even when live environment switches have been configured, unless the explicit CLI live request is also supplied.
event: preflight mode: dry_run
event: summary simulated: 2
accepted_or_queued: 0 exit_code: 0
Readable extract — actual output is JSON.Run in a POSIX shell from the repository root. The existing image runs as a non-root user; the example needs no secrets.
docker build -t batch-sms-campaign-automation .
docker run --rm --network none \
-e SMS_DRY_RUN=true -e SMS_SEND_ENABLED=false \
-e SMS_CSV_FILE_PATH=/tmp/contacts.csv \
-v "$PWD/examples/contacts.example.csv:/tmp/contacts.csv:ro" \
batch-sms-campaign-automationDocker build needs package access. Durable private state and separately authorized setup are required for any later live container use.
No schedules, automatic sends or blind retries. Development and website demonstrations never transmit SMS.
phone header and configure SMS_EXCLUSIONS_FILE. There is no automatic inbound STOP handler..env.example to a private .env. Configure SMS_USERNAME, SMS_PASSWORD and a trusted HTTPS endpoint. Keep secrets out of source control.SMS_CONSENT_SCOPE, conservative recipient/rate bounds and positive SMS_ESTIMATED_UNIT_COST / SMS_MAX_ESTIMATED_COST.python main.py and review its Dry Run preflight first.SMS_DRY_RUN=false, SMS_SEND_ENABLED=true, valid credentials, and --live with matching --campaign-id and --confirm-campaign values. This is not a copy-and-run sending example.The opt-out snapshot is checked before each request; a small check-to-send race remains. Interrupt a campaign if a withdrawal becomes known. SMS charges may occur; cost caps bound an estimate, not actual billing.
Read the complete authorization and reconciliation guideCampaign Lab is a secondary educational tool. The browser schema id, first_name, course, consent, opt_out and {{first_name}} / {{course}} tokens differ from Python’s consent metadata and {name} template. The engines and CSV files are not interchangeable.
OPTIONAL · CAMPAIGN LAB
Browser-only demonstration — no SMS sending. Use fictional fields only.
Optional CSV columns: id, first_name, course, consent, opt_out. No phone-number column is accepted.
Up to 1 MiB and 1,000 rows. Valid flags: true/false, yes/no, or 1/0. The file is read into this tab only.
| Sample recipient | Consent | Personalized preview | Decision |
|---|
No preview is ready. Fix validation errors or reset the sample and run again.
Any opt-out or missing consent on an ID excludes every row for that ID, regardless of order.
The browser uses one planning unit per eligible ID. It is not Python’s segmentation estimate or a provider quote.
No phone column, credentials, gateway access, analytics or persistent campaign state. Imported fictional fields stay in memory.
The real CLI runs in your environment. The public website is static. Neither a preflight nor an API acknowledgement proves lawful consent or carrier delivery.
Understand the workflow before configuring any external integration.