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.

<%= link_to docs_path, class: "btn-accent inline-flex items-center gap-2 rounded-xl px-7 py-3.5 text-base font-semibold text-slate-950" do %> Explore the API <% end %> <%= link_to admin_login_path, class: "btn-ghost inline-flex items-center gap-2 rounded-xl px-7 py-3.5 text-base font-semibold text-slate-200" do %> Admin Console <% end %>
Base URL https://<your-host>/api/v1
<% stats = [ { icon: "fa-bolt", value: "< 200ms", label: "API latency" }, { icon: "fa-infinity", value: "Unlimited", label: "Gateways" }, { icon: "fa-shield-halved", value: "SHA-256", label: "Key hashing" }, { icon: "fa-rotate", value: "3× retry", label: "Auto backoff" } ] %> <% stats.each do |s| %>
<%= s[:value] %> <%= s[:label] %>
<% end %>

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.

<% features = [ { icon: "fa-paper-plane", color: "from-sky-400 to-sky-600", title: "Send SMS", desc: "Queue outbound messages and let the gateway fleet deliver them. Automatic retries with exponential backoff." }, { icon: "fa-arrow-down", color: "from-emerald-400 to-emerald-600", title: "Receive SMS", desc: "Inbound messages land in your inbox instantly and fire webhooks so your app reacts in real time." }, { icon: "fa-shield-halved", color: "from-violet-400 to-violet-600", title: "OTP Generation", desc: "Six-digit codes with 5-minute expiry, 3-attempt limits, and 3-per-hour rate caps per phone number." }, { icon: "fa-plug", color: "from-amber-400 to-orange-600", title: "Webhooks", desc: "HMAC-signed event payloads for sms_received, sms_sent and sms_failed with configurable retries." }, { icon: "fa-tower-broadcast", color: "from-pink-400 to-rose-600", title: "Realtime WebSocket", desc: "Bidirectional Action Cable channel keeps every gateway in sync — heartbeats, delivery reports, and commands." }, { icon: "fa-mobile-screen", color: "from-blue-400 to-indigo-600", title: "Gateway Fleet", desc: "Register unlimited Android devices. Priority-based routing, health checks, and live status monitoring." } ] %> <% features.each_with_index do |f, i| %>

<%= f[:title] %>

<%= f[:desc] %>

<% end %>

Architecture

How messages flow

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

<% steps = [ { n: "01", icon: "fa-code", title: "Client calls API", desc: "POST /api/v1/sms/send with a Bearer API key. Phone numbers are validated with Phonelib." }, { n: "02", icon: "fa-database", title: "Message queued", desc: "SmsMessage is persisted and SendSmsJob is enqueued via Sidekiq. The API returns instantly with a message_id." }, { n: "03", icon: "fa-route", title: "Gateway selected", desc: "SendSmsJob picks the highest-priority online, active gateway and broadcasts over Action Cable." }, { n: "04", icon: "fa-mobile-screen-button", title: "Android delivers", desc: "The gateway device sends the SMS via its native radio and reports back a delivery status." }, { n: "05", icon: "fa-circle-check", title: "Status & webhooks", desc: "Delivery/failed status is recorded; webhooks fire for subscribed events. Failed messages auto-retry up to 3×." } ] %> <% steps.each do |s| %>
<%= s[:n] %>

<%= s[:title] %>

<%= s[:desc] %>

<% end %>

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"
}
<%= link_to docs_path, class: "btn-ghost inline-flex items-center gap-2 rounded-xl px-6 py-3 text-sm font-semibold text-slate-200" do %> Read the full API reference <% end %>

Built on a modern stack

Production-ready by default

<% stack = ["Rails 8.0", "Ruby 3.4", "PostgreSQL", "Redis 7", "Sidekiq 7", "Action Cable", "Puma + Thruster", "Docker / Kamal", "Tailwind CSS", "Phonelib", "HTTParty", "ROTP"] %> <% stack.each do |tech| %> <%= tech %> <% end %>

Ready to send your first SMS?

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

<%= link_to docs_path, class: "btn-accent inline-flex items-center gap-2 rounded-xl px-7 py-3.5 text-base font-semibold text-slate-950" do %> API Documentation <% end %> <%= link_to admin_login_path, class: "btn-ghost inline-flex items-center gap-2 rounded-xl px-7 py-3.5 text-base font-semibold text-slate-200" do %> Open Admin Console <% end %>