SMS Gateway · API v1

Send SMS through your Android devices

A production-grade REST & WebSocket API that turns any Android phone into a programmable SMS gateway. Send messages, generate OTPs, receive inbound texts, and orchestrate fleets of devices in real time.

Base URL https://<your-host>/api/v1
< 200ms API latency
Unlimited Gateways
SHA-256 Key hashing
3× retry Auto backoff

Capabilities

Everything you need to route SMS at scale

From a single device to a distributed fleet — message queuing, delivery tracking, and OTP workflows are built in.

Send SMS

Queue outbound messages and let the gateway fleet deliver them. Automatic retries with exponential backoff.

Receive SMS

Inbound messages land in your inbox instantly and fire webhooks so your app reacts in real time.

OTP Generation

Six-digit codes with 5-minute expiry, 3-attempt limits, and 3-per-hour rate caps per phone number.

Webhooks

HMAC-signed event payloads for sms_received, sms_sent and sms_failed with configurable retries.

Realtime WebSocket

Bidirectional Action Cable channel keeps every gateway in sync — heartbeats, delivery reports, and commands.

Gateway Fleet

Register unlimited Android devices. Priority-based routing, health checks, and live status monitoring.

Architecture

How messages flow

A clean, asynchronous pipeline keeps the API fast and delivery resilient.

01

Client calls API

POST /api/v1/sms/send with a Bearer API key. Phone numbers are validated with Phonelib.

02

Message queued

SmsMessage is persisted and SendSmsJob is enqueued via Sidekiq. The API returns instantly with a message_id.

03

Gateway selected

SendSmsJob picks the highest-priority online, active gateway and broadcasts over Action Cable.

04

Android delivers

The gateway device sends the SMS via its native radio and reports back a delivery status.

05

Status & webhooks

Delivery/failed status is recorded; webhooks fire for subscribed events. Failed messages auto-retry up to 3×.

Quick Start

Send your first message

1

Register a gateway device

No auth required — receive a gateway API key back.

# Register your Android device
curl -X POST https://your-host/api/v1/gateway/register \
  -H "Content-Type: application/json" \
  -d '{"device_id":"pixel-001","name":"Office Phone"}'
2

Connect via WebSocket

Keep the device online and ready to receive commands.

# wscat
wscat -c "ws://your-host:3000/cable?api_key=gw_live_..."
3

Send an SMS

Use a client API key (api_live_…) in the Authorization header.

curl -X POST https://your-host/api/v1/sms/send \
  -H "Authorization: Bearer api_live_..." \
  -H "Content-Type: application/json" \
  -d '{"to":"+14155551234","message":"Hello from MySMSAPio!"}'
# → 202 Accepted
{
  "success": true,
  "message_id": "msg_3f8a9c1b2e7d4f60",
  "status": "queued"
}

Built on a modern stack

Production-ready by default

Rails 8.0 Ruby 3.4 PostgreSQL Redis 7 Sidekiq 7 Action Cable Puma + Thruster Docker / Kamal Tailwind CSS Phonelib HTTParty ROTP

Ready to send your first SMS?

Dive into the complete API reference or jump straight into the admin console to manage your gateways.