Developer REST API

Developer SMS & WhatsApp API with Zero Per-Message Fees

Integrate high-speed transactional SMS, one-time passwords (OTP), customer alerts, and two-way WhatsApp messaging into your application using standard HTTP JSON endpoints. Send through your own paired Android mobile gateways at a flat monthly cost.

Standard REST API  ·  2-way Webhooks  ·  Dual-SIM Routing  ·  JSON Payloads

<100ms API Response Latency cURL / Node / Python / PHP SDKs $0 / SMS on Your SIM Plan Real-Time Delivery Receipts (DLR)
Quickstart Integration

Send Your First API Message in 60 Seconds

Simple, standard HTTP POST requests compatible with any programming language or backend framework.

cURL Request

curl -X POST "https://sharksms.com/api/send/sms"   -d "secret=YOUR_API_SECRET_KEY"   -d "mode=devices"   -d "device=YOUR_DEVICE_ID"   -d "sim=1"   -d "phone=+1234567890"   -d "message=Your verification code is 849201"

Form-encoded parameters, JSON back, HTTP always 200: read the status field. Full reference: /docs/api.

Node.js / Express

const res = await fetch("https://sharksms.com/api/send/sms", {
  method: "POST",
  body: new URLSearchParams({
    secret: "YOUR_API_SECRET_KEY",
    mode: "devices",
    device: "DEVICE_ID",
    sim: "1",
    phone: "+1234567890",
    message: "Your order #1042 has shipped!"
  })
});
const data = await res.json(); // check data.status === 200

Python (requests)

import requests

payload = {
    "secret": "YOUR_API_SECRET_KEY",
    "mode": "devices",
    "device": "DEVICE_ID",
    "sim": 1,
    "phone": "+1234567890",
    "message": "Security Alert: New login detected."
}
res = requests.post("https://sharksms.com/api/send/sms", data=payload)  # form body
print(res.json())

PHP (cURL)

$ch = curl_init("https://sharksms.com/api/send/sms");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([
    'secret'  => 'YOUR_API_SECRET_KEY',
    'mode'    => 'devices',
    'device'  => 'DEVICE_ID',
    'sim'     => 1,
    'phone'   => '+1234567890',
    'message' => 'Appointment confirmed for 2:00 PM.'
]));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
API Endpoints

Full-Featured Messaging Capabilities

Everything you need to send, receive, and automate transactional mobile messaging.

⚡ Single & Bulk SMS

Dispatch individual transactional alerts or batch payloads to multiple recipients simultaneously with custom parameters.

💬 WhatsApp Messages & Media

Send WhatsApp text, PDF receipts, and image notifications through your linked WhatsApp number with instant delivery confirmation.

🔄 Two-Way Webhooks

Configure webhook URLs to receive instant HTTP callbacks whenever a customer replies or delivery status transitions to delivered.

🔐 OTP & 2FA Authentication

Generate secure, time-expiring numerical verification codes and validate customer authentication attempts via dedicated endpoints.

📱 Dual-SIM & Gateway Pooling

Route traffic across multiple physical phones or balance load between SIM 1 and SIM 2 automatically to maximize throughput.

📊 Real-Time Delivery Reports

Query message status (Pending, Sent, Delivered, Failed) by unique message ID with precise carrier timestamp tracking.

Cost Analysis

SharkSMS API vs. Metered Cloud Aggregators

Stop paying 1¢ to 3¢ for every OTP and notification. See how our flat-rate model saves high-volume apps thousands.

Monthly API SMS SharkSMS (Flat Monthly) Twilio (~$0.0079 + carrier) MessageBird / Sinch (~$0.012)
5,000 API Requests ~$15.00 / mo ~$47.50 / mo ~$60.00 / mo
20,000 API Requests ~$45.00 / mo (Fixed) ~$190.00 / mo ~$240.00 / mo
50,000 API Requests ~$45.00 / mo (Fixed) ~$475.00 / mo ~$600.00 / mo

Frequently Asked Questions · SMS API

Where do I find my API Secret Key and Device ID?

Log in to your SharkSMS Dashboard and navigate to API > Credentials to generate your API token. Your Device IDs are listed under Devices > Android Gateways.

Are there any rate limits on API requests?

The REST API accepts hundreds of concurrent requests and queues them in real-time. Messages are dispatched through your paired Android phones based on hardware capabilities and local carrier network limits.

Can I receive customer replies via Webhooks?

Yes. Enter your endpoint URL under Webhooks in the dashboard. Whenever an incoming SMS or WhatsApp response is detected, SharkSMS posts a JSON payload to your server immediately.

Does the API support international numbers?

Yes. Provide phone numbers in international standard E.164 format (e.g. +14155550100). The gateway will route through the matching SIM card or default active line.

Reference and examples

Start building with the SharkSMS API today

Generate your API secret, pair an Android phone, and send test messages in minutes.