Open-source · Self-hosted · Apache 2.0

DeviceFlow

Turn Android phones into an API-driven SMS gateway

Pair real devices with a Django API and React dashboard. Send OTP, transactional SMS, and USSD—on SIMs you control.

Phones send traffic to a REST API which delivers OTP SMS to users.
  • Apache 2.0
  • Open source
  • Self-hosted
  • Django + React + Android

Capabilities

Everything you need to run an SMS fleet

From pairing and OTP to USSD, webhooks, and agent security—each piece of DeviceFlow is built for operators who want API control on real SIMs.

Device pairing & heartbeat sync

Pair phones with a short-lived code. Heartbeats keep battery, SIM, GPS, and online status fresh so the control plane always knows what’s live.

482915

OTP / login verification SMS

Send one-time codes for signup and 2FA with mode: "otp". Real SIM routes, project scoping, and delivery status your auth stack can trust.

Transactional SMS

Order confirmations, receipts, and account alerts through a REST API. Templates and project keys keep product messaging clean and auditable.

Bulk / marketing SMS

Campaign send for announcements and outreach when you need volume—still self-hosted, still on your SIMs, with queue visibility in the dashboard.

Live device fleet monitor

Watch online status, queues, battery, and dual-SIM health in real time over WebSockets. Ops sees the fleet the moment something drifts.

SIM1 SIM2

Dual-SIM routing

Route by SIM slot and operator. Keep failover paths ready when one carrier falters—ideal for multi-country or multi-operator fleets.

*141#

USSD from dashboard

Run carrier USSD codes from the web UI. Balance checks, top-ups, and ops flows without touching the handset every time.

API KEY

Webhooks & project API keys

Scoped API keys per project plus outbound webhooks for delivery and inbox events. Wire DeviceFlow into your backend without polling forever.

Contacts, inbox & conversations

Import contacts, read inbound SMS, and follow conversation threads. Support and ops stay in one place with the devices that sent the messages.

MCI RTL

Smart routing / operator rules

Prefer operators, SIM slots, and projects with rules that match how your fleet is deployed—less guesswork when a message has to land.

hidden

Hide launcher icon + passcode lock

Agent app can hide from the launcher and require a UI passcode. Physical access to the phone does not mean open access to the agent.

*#*#738#*#*

Custom secret dialer code

Reveal the agent with a dialer code like *#*#CODE#*#*. Field techs unlock the app without a visible launcher icon on the home screen.

IF EVENT PLUGIN / HOOK

Automations & plugins

Extend the control plane with automations and plugins. Trigger follow-ups, hooks, and custom logic when devices or messages change state.

Analytics, map & queues

Ops views for send volume, GPS map pins from agents, and queue depth. See bottlenecks before they become outages.

How to use

From zero to OTP in five steps

Run the stack, pair a phone, attach it to a project, then send from your backend while Live Monitor watches the fleet.

  1. Step 1

    Run API + dashboard

    Start the Django API and React dashboard locally or with Docker Compose. Redis backs WebSockets and queues when you want the full ops stack.

  2. 7K2M

    Step 2

    Pair an Android phone

    Generate a pairing code in the dashboard. The Kotlin agent posts it once and receives a device token—no long-lived WebSocket required.

  3. pk_live

    Step 3

    Attach device & create API key

    Assign the device to a project, then mint a project API key. Routing, templates, and webhooks all hang off that project boundary.

  4. mode:otp

    Step 4

    Send OTP / SMS from your backend

    Call the REST API with mode: "otp" (or transactional / bulk). Your app stays the source of truth; DeviceFlow owns the SIM path.

  5. Step 5

    Monitor live status

    Watch heartbeats (~15s), command polls (~3s), queue depth, and delivery in Live Monitor. Fix fleet issues before users feel them.

Architecture at a glance

Dashboard ↔ API ↔ Android agent. The agent polls for work about every 3s and heartbeats about every 15s—no persistent device WebSocket required.

Dashboard  ←JWT / WS→  Django API (+ Redis/Celery)
                              │
              device token · poll ~3s · heartbeat ~15s
                              │
                         Android agent
$ curl -X POST https://api.example/api/v1/messages/ \
  -H "Authorization: Bearer pk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+15551234567",
    "body": "Your code is 482915",
    "mode": "otp"
  }'

Use cases

Built for real product and ops paths

Whether you need auth OTP, order SMS, or carrier automation, DeviceFlow keeps the message path on hardware you operate.

OTP

Startup auth / 2FA OTP

Ship login and verification codes on real SIMs you control—no per-message SaaS lock-in for your critical auth path.

Shipped

Marketplace & e-commerce SMS

Order updates, shipping pings, and seller alerts from the same fleet that already handles OTP.

!

Internal ops alerts

Page on-call or notify warehouse staff when queues spike, devices drop, or jobs fail—SMS that stays inside your infra.

*141#

Carrier USSD automation

Balance checks and carrier menus from the dashboard instead of walking every handset in the rack.

Multi-country dual-SIM fleet

Run phones with local SIMs across regions. Route by operator and keep failover when one path degrades.

Self-hosted vs pure SaaS SMS

Keep numbers, logs, and routing under your roof. Open source under Apache 2.0 with clear attribution.

Product

Live Monitor in the dashboard

Real-time device tiles, queue depth, and fleet health—operators see status the moment heartbeats and WebSocket events land.

DeviceFlow dashboard Live Monitor showing device tiles, online status, battery, and dual-SIM details
Live Monitor — real-time device health, queues, and fleet status

Why DeviceFlow

Control the path. Keep the license clean.

A self-hosted alternative to pure SaaS SMS vendors—API-first, open source, and attribution-friendly under Apache 2.0.

Self-hosted control

Your phones, your Postgres, your Redis. Deploy on hardware you trust and keep message paths inside your boundary.

Real SIM routes

OTP and transactional SMS leave through physical SIMs—not a black-box SaaS number pool you cannot audit.

API-first

REST for send and ops, WebSockets for live UI, OpenAPI for discoverability. Build products on DeviceFlow, not around a click-only console.

Attribution-friendly license

Apache 2.0 plus a clear NOTICE: use it, fork it, ship it—credit the DeviceFlow GitHub repo.

Run your own SMS gateway

Clone DeviceFlow, pair a phone, and send your first OTP. Open source under Apache 2.0—credit the GitHub repo when you ship.