Droom Dazlean Solutions logo DDS SMS Gatewayby Droom Dazlean Solutions

SMS API documentation

Send one SMS, thousands, or a personalised message to every customer from your website or software, and know exactly what happened to each one.

How it works

  1. Your system sends a request to https://sms.droomdazlean.com/api/v1/send.
  2. The server checks it and queues the messages straight away. A successful answer (HTTP 200, "ok": true) means accepted and queued, not yet delivered.
  3. Your connected phone sends the queued messages one by one at a steady, network-friendly pace (by default one every 10 seconds). Urgent sends of 10 numbers or fewer go first.
  4. Each message moves through pending → sending → sent → delivered (or failed). You can check its status at any time.

Base URL: https://sms.droomdazlean.com/api/v1 · Format: JSON (UTF-8) · Transport: HTTPS.

Authentication

Copy your API key from the SMS Gateway app and send it with every request in the X-API-Key header:

X-API-Key: YOUR_API_KEY

Authorization: Bearer YOUR_API_KEY works too. Spaces and lower case in the key are ignored.

Keep the key on your server. Store it in configuration or an environment variable and call the API from your back end (PHP, Python, Node.js, Java, .NET and so on). Never put it in public web pages or apps that others can inspect.

Send one SMS

POST/api/v1/send
curl -X POST https://sms.droomdazlean.com/api/v1/send \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": "0771234567", "message": "Your order #1045 is ready for collection."}'

Answer: HTTP 200

{
  "ok": true,
  "duplicate": false,
  "reference": null,
  "batch_id": "b_674dbbb00b2719332187",
  "count": 1,
  "phone_online": true,
  "invalid_count": 0,
  "invalid": [],
  "queue": {"waiting": 1, "send_interval_seconds": 10, "daily_limit": null,
            "estimated_time": "10 seconds", "estimated_finish": "2026-11-22T06:45:53+02:00"},
  "messages": [{"id": 406111, "to": "+263771234567", "status": "pending"}],
  "messages_listed": 1
}
FieldMeaning
oktrue when the request was accepted.
batch_idIdentifies this request. Use it to follow or cancel everything you sent in it.
countNumber of messages queued.
messagesOne entry per message: its id (save it), the number in international format, and the status. Large sends list the first 200; messages_listed says how many are listed.
phone_onlinefalse means the phone is offline right now: messages wait and go out when it reconnects.
queueHow many messages wait for your phone in total, the sending pace, and when the last one should go out.
invalid, invalid_countNumbers that were skipped (only when you allow skipping, see below).
duplicate, referenceSee avoid duplicates.

Request fields

FieldRequiredDescription
toYes*One number, several separated by commas, or a JSON array of numbers.
messageYes*The text (up to 5,000 characters).
messagesNoA list of {"to", "message"} objects for different messages.
fileNoA CSV file (multipart form upload). See CSV files.
simNoThe SIM to send from (see choose the SIM). Default: the phone's default SIM.
referenceNoYour own unique id for this request, up to 100 characters (for example an invoice or order number).
skip_invalidNotrue to send to the valid numbers when some are invalid. By default the whole request is refused so you can fix it.

* Give recipients with to, messages or file, and a text with message or per recipient.

Phone numbers

Local Zimbabwe numbers such as 0771234567 or 771234567 become +263771234567. Numbers in international format (+263…, 00263…, +27…) are kept. Spaces, dashes and brackets are ignored. A Zimbabwe number must have 9 digits after +263.

Message length

One SMS holds 160 standard characters, or 70 if the text contains emoji or special characters. Longer texts are sent as several parts and joined on the recipient's phone; each part is charged by the network as one SMS.

Send the same message to many people

Put all the numbers in one request: a JSON array, or one string separated by commas. Duplicates are removed.

curl -X POST https://sms.droomdazlean.com/api/v1/send \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": ["0771234567", "0712345678", "+263782345678"],
       "message": "School closes on Friday at 12:00. Thank you."}'

The answer has one batch_id for the whole send and one id per message.

Send different messages to different people

Use messages: a list where each entry has its own number and text. Ideal for balances, invoices, results or reminders.

curl -X POST https://sms.droomdazlean.com/api/v1/send \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"messages": [
        {"to": "0771234567", "message": "Dear Ann, your balance is $20. Thank you."},
        {"to": "0712345678", "message": "Dear Ben, your balance is $35. Thank you."}
      ]}'

An entry without its own text uses the top-level message, if you give one.

Send from a CSV file

Upload a file in a multipart form field named file:

curl -X POST https://sms.droomdazlean.com/api/v1/send \
  -H "X-API-Key: YOUR_API_KEY" \
  -F "[email protected]" \
  -F "message=Our shop opens at 8:00 tomorrow."
  • One number per row, or a header row with a phone column (also number, mobile, msisdn, to).
  • An optional message column gives each row its own text; rows without one use the message field.
  • Comma, semicolon or tab separated. From Excel: File → Save As → CSV, with the phone column formatted as text so numbers keep their leading zero.
  • Rows without a valid number are skipped and listed in invalid as "row 17: …".
phone,message
0771234567,Dear Ann your results are ready
0712345678,Dear Ben your results are ready

Sending many requests

There is no limit on how many requests you make. Send one request per event (an order, a payment, a login code) as often as you need, even at the same time from several servers. Every request is queued in the order it arrives and nothing is lost.

  • Many recipients at once? Prefer one request with a list (to, messages or a CSV) over thousands of single requests: it is faster for you and gives you one batch_id to follow.
  • Urgent messages (requests with 10 numbers or fewer, such as OTP codes) are sent before waiting bulk lists.
  • Pace: however many requests arrive, your phone sends at its set pace, so a large queue takes time. Use queue.estimated_time in each answer, or GET /api/v1/queue, to see when it will finish.

Avoid duplicate messages

If your connection drops after you send a request, you can't know whether it arrived. Add a reference that is unique for that send (for example "INV-2045" or "otp-58821") and simply repeat the same request. If it was already accepted, nothing new is queued and the answer tells you so:

{"ok": true, "duplicate": true, "reference": "INV-2045", "batch_id": "b_77faf1178cce250bd6ee", "count": 1,
 "message": "A request with this reference was already accepted, so nothing new was queued.",
 "messages": [{"id": 406116, "to": "+263771234567", "status": "pending"}], "messages_listed": 1}

Use a new reference for every new message or list. A reference stays reserved for that phone.

Choose the SIM card

On dual-SIM phones, list the SIM cards and pass the sim value you want:

curl -H "X-API-Key: YOUR_API_KEY" https://sms.droomdazlean.com/api/v1/device

{"ok": true, "device": {"name": "SAMSUNG SM-A165F", "status": "active", "online": true,
  "last_seen": "2026-11-22T06:45:43", "battery": 80, "charging": true, "model": "SM-A165F",
  "sims": [{"sim": 1, "slot": 1, "carrier": "ECONET", "number": "+263771234567", "label": "SIM 1 (+263771234567 · ECONET)"},
           {"sim": 3, "slot": 2, "carrier": "NetOne", "number": null, "label": "SIM 2 (NetOne)"}]}}

Then send with "sim": 3 to use SIM 2. This call is also a quick way to check that your key works and the phone is online.

Track delivery

One message

curl -H "X-API-Key: YOUR_API_KEY" https://sms.droomdazlean.com/api/v1/messages/406111

{"ok": true, "data": {"id": 406111, "batch_id": "b_674dbbb00b2719332187", "to": "+263771234567",
  "message": "Your order #1045 is ready for collection.", "sim": null, "status": "delivered", "error": null,
  "created_at": "2026-11-22T06:45:43", "updated_at": "2026-11-22T06:45:58"}}

A whole send (batch)

curl -H "X-API-Key: YOUR_API_KEY" https://sms.droomdazlean.com/api/v1/batches/b_674dbbb00b2719332187

{"ok": true, "batch_id": "b_674dbbb00b2719332187", "total": 3, "done": false,
 "counts": {"delivered": 1, "sent": 1, "pending": 1},
 "queue": {"waiting": 1, "send_interval_seconds": 10, "estimated_time": "10 seconds", "estimated_finish": "…"}}

done becomes true when no message of the batch is waiting any more.

Status meanings

StatusMeaningFinal?
pendingQueued, waiting for its turnNo
sendingHanded to the phone, being sentNo
sentAccepted by the mobile networkUsually: becomes delivered when the network confirms
deliveredDelivered to the recipient's phoneYes
failedCould not be sent; error explains why (for example no network service or no airtime)Yes
cancelledCancelled before sendingYes

Some networks don't send delivery confirmations, so a message can stay sent. Check statuses every 30 to 60 seconds at most, and stop when the status is final. To cancel messages that haven't gone out yet: POST /api/v1/batches/{batch_id}/cancel.

Response codes

Every answer is JSON. Errors always look like this:

{"ok": false, "error": "invalid_numbers", "message": "1 invalid phone number(s). Fix them, or add skip_invalid=true to send to the valid ones only.", "invalid": ["12345"]}

Check the HTTP status first, then error for the exact reason. Show message to people; it is written for them.

HTTPerrorWhat it meansWhat to doRetry?
200—Accepted and queued (or, with duplicate: true, already accepted earlier)Save batch_id and the message ids—
400bad_requestThe request could not be readCheck the JSON and headersNo
401invalid_api_keyKey missing, mistyped or no longer validCopy the key again from the app; contact support if it persistsNo
403not_activatedThe phone isn't ready to send yetCheck the app on the phone, or contact supportLater
403disabledSending is suspended for this keyContact supportNo
404not_foundUnknown address, message id or batch idCheck the URL and the idNo
405method_not_allowedWrong HTTP method (for example GET instead of POST)Use the method shown in this guideNo
413too_largeRequest or file larger than 20 MBSplit it into smaller requestsNo
422invalid_numbersOne or more numbers are invalid (listed in invalid)Fix them, or add skip_invalid: trueAfter fixing
422missing_toNo valid recipient givenAdd to, messages or a CSV fileAfter fixing
422missing_messageNo text for some recipientsAdd messageAfter fixing
422message_too_longText longer than 5,000 charactersShorten itAfter fixing
422too_manyMore than 100,000 recipients in one requestSplit the listAfter fixing
422bad_simsim isn't a numberUse a sim value from /api/v1/deviceAfter fixing
429queue_fullYour phone's queue is full (free says how many more fit)Wait for the queue to go down; see Retry-AfterYes, later
429rate_limitedToo many requests in a short timeWait the number of seconds in Retry-AfterYes, later
500server_errorA problem on our sideRetry after a short pause with the same referenceYes
502 / 503 / 504—Temporarily unreachable (maintenance or network)Retry after a short pause with the same referenceYes
Timeout / no answer—Your request may or may not have arrivedRetry with the same reference: it is never sent twiceYes

Handle errors in your code

These complete examples send a message, retry safely on temporary problems, and report permanent problems.

PHP

function sendSms(string $to, string $message, string $reference): array {
    $payload = json_encode(["to" => $to, "message" => $message, "reference" => $reference]);
    for ($attempt = 1; $attempt <= 3; $attempt++) {
        $ch = curl_init("https://sms.droomdazlean.com/api/v1/send");
        curl_setopt_array($ch, [
            CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30,
            CURLOPT_HTTPHEADER => ["X-API-Key: " . getenv("SMS_API_KEY"), "Content-Type: application/json"],
            CURLOPT_POSTFIELDS => $payload,
        ]);
        $body = curl_exec($ch);
        $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);
        $data = $body ? json_decode($body, true) : null;

        if ($status === 200 && !empty($data["ok"])) {
            return $data;                                  // queued: save $data["messages"][0]["id"]
        }
        if ($body === false || $status === 429 || $status >= 500) {
            sleep(5 * $attempt);                           // temporary problem: try again
            continue;
        }
        throw new RuntimeException($data["message"] ?? "SMS not sent (HTTP $status)");  // fix the request
    }
    throw new RuntimeException("SMS service unavailable, try again later");
}

$result = sendSms("0771234567", "Your order #1045 is ready.", "order-1045-ready");

Python

import os, time, requests

API = "https://sms.droomdazlean.com/api/v1"
HEADERS = {"X-API-Key": os.environ["SMS_API_KEY"]}

def send_sms(to, message, reference):
    for attempt in range(1, 4):
        try:
            r = requests.post(f"{API}/send", headers=HEADERS, timeout=30,
                              json={"to": to, "message": message, "reference": reference})
        except requests.RequestException:
            time.sleep(5 * attempt)            # network problem: safe to retry (same reference)
            continue
        if r.status_code == 429 or r.status_code >= 500:
            time.sleep(min(int(r.headers.get("Retry-After", 5 * attempt)), 60))   # temporary: retry
            continue
        data = r.json()
        if r.status_code == 200 and data["ok"]:
            return data                        # data["batch_id"], data["messages"]
        raise ValueError(f'{data["error"]}: {data["message"]}')   # 4xx: fix the request
    raise RuntimeError("SMS service unavailable, try again later")

result = send_sms(["0771234567", "0712345678"], "Meeting moved to 3 pm.", "meeting-2026-11-24")
print(result["count"], "queued, finished in", result["queue"]["estimated_time"])

Node.js

async function sendSms(to, message, reference) {
  for (let attempt = 1; attempt <= 3; attempt++) {
    let res;
    try {
      res = await fetch("https://sms.droomdazlean.com/api/v1/send", {
        method: "POST",
        headers: {"X-API-Key": process.env.SMS_API_KEY, "Content-Type": "application/json"},
        body: JSON.stringify({to, message, reference}),
        signal: AbortSignal.timeout(30000),
      });
    } catch (networkError) {
      await new Promise(r => setTimeout(r, 5000 * attempt));   // no answer: safe to retry (same reference)
      continue;
    }
    if (res.status === 429 || res.status >= 500) {
      await new Promise(r => setTimeout(r, 5000 * attempt));   // temporary problem: retry
      continue;
    }
    const data = await res.json();
    if (res.ok && data.ok) return data;                         // queued
    throw new Error(`${data.error}: ${data.message}`);           // 4xx: fix the request
  }
  throw new Error("SMS service unavailable, try again later");
}

const result = await sendSms("0771234567", "Your code is 482910", "otp-58821");

Devices and microcontrollers (ESP32, ESP8266, Arduino)

Field units, sensors and controllers can send SMS alerts directly. Small devices have limited encryption support, so choose the address that suits the device:

AddressWhen to use it
http://sms.droomdazlean.com/api/v1/sendRecommended for microcontrollers. Works with every device and firmware: no certificates, no clock needed. Use it on networks you trust; the key is not encrypted on the way.
https://sms.droomdazlean.com/api/v1/sendEncrypted. The device must support TLS 1.2 with ECDSA certificates (ECDHE-ECDSA ciphers) and SNI, and either trust the Google Trust Services root (GTS Root R4) with a correct clock (NTP), or skip certificate checking (setInsecure()).

Both accept the same requests: JSON or form data (to, message), with the key in the X-API-Key header.

Error -1 on an ESP32 or ESP8266 ("connection refused" or "TLS handshake failed") means the device could not open the HTTPS connection; the request never reached the gateway. Typical causes: no certificate configured (ESP32 core 3.x refuses HTTPS until you call setCACert(), setCACertBundle() or setInsecure()), RSA-only cipher settings, or a clock that isn't set. The quickest fix is the http:// address above.

ESP32 (Arduino core)

#include <WiFi.h>
#include <HTTPClient.h>
#include <WiFiClientSecure.h>

const char* SMS_URL = "http://sms.droomdazlean.com/api/v1/send";   // or https://... (see below)
const char* API_KEY = "YOUR_API_KEY";

int sendSms(const String& to, const String& message, const String& reference) {
  HTTPClient http;
  WiFiClient plain;
  WiFiClientSecure secure;
  bool https = String(SMS_URL).startsWith("https");
  if (https) secure.setInsecure();                 // encrypted; or secure.setCACert(GTS_ROOT_R4) + NTP time
  http.begin(https ? (WiFiClient&)secure : plain, SMS_URL);
  http.setTimeout(20000);
  http.addHeader("X-API-Key", API_KEY);
  http.addHeader("Content-Type", "application/x-www-form-urlencoded");
  String body = "to=" + to + "&message=" + urlencode(message) + "&reference=" + reference;
  int code = http.POST(body);                      // 200 = queued; 4xx = fix request; -1 = connection/TLS
  String reply = http.getString();
  http.end();
  return code;
}

urlencode() stands for your URL-encoding helper (spaces as %20, & as %26). Use a unique reference per alert (for example the pole id and the time) so a retried alert is never sent twice.

ESP8266

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

WiFiClient client;                                  // for https: BearSSL::WiFiClientSecure client; client.setInsecure();
HTTPClient http;
http.begin(client, "http://sms.droomdazlean.com/api/v1/send");
http.addHeader("X-API-Key", "YOUR_API_KEY");
http.addHeader("Content-Type", "application/json");
int code = http.POST("{\"to\":\"0771234567\",\"message\":\"Pole ZESA-PL-0001 tilt alarm\",\"reference\":\"PL0001-1795330606\"}");
http.end();

Device error codes (negative numbers) come from the device's HTTP library, not from the gateway: -1 connection or TLS failed, -4 not connected, -11 timed out. Retry later with the same reference.

Read replies

curl -H "X-API-Key: YOUR_API_KEY" "https://sms.droomdazlean.com/api/v1/received?limit=50"

{"ok": true, "data": [{"id": 88, "from": "+263771234567", "message": "YES, I will attend", "received_at": "2026-11-22T07:10:02"}]}

Endpoint reference

RequestDescription
POST /api/v1/sendQueue one or many SMS: to, messages or file; plus message, sim, reference, skip_invalid
GET /api/v1/messages/{id}Status of one message
GET /api/v1/messagesYour messages, newest first. Filters: status, batch_id, to; paging: page, limit (max 200)
GET /api/v1/batches/{batch_id}Progress of one send: total, counts per status, done
POST /api/v1/batches/{batch_id}/cancelCancel the messages of that send that haven't gone out yet
GET /api/v1/queueMessages waiting for your phone, the pace and the estimated finish time
GET /api/v1/devicePhone status (online, battery) and its SIM cards
GET /api/v1/receivedIncoming SMS (replies); limit up to 200

Limits

RequestsNo limit
Recipients per request100,000
Request or file size20 MB
Message length5,000 characters
Sending paceSet per phone (default one SMS every 10 seconds)
Android's own limitAbout 30 SMS per 30 minutes per app until confirmed on the phone; can be raised on dedicated phones

For high volumes, set the gateway phone up properly: all permissions granted, battery optimisation off, and Android's SMS limit raised. The setup guide explains hidden settings, settings for each phone brand and raising the limit with ADB on dedicated devices. To send more per day, add more phones: each has its own key and queue.

Go-live checklist

  • The API key is stored on your server, not in web pages or source code.
  • Every send has a unique reference, and retries reuse it.
  • You save the batch_id and message ids, and check status at most every 30 to 60 seconds.
  • You retry only on timeouts, 429 and 5xx; you fix and log 4xx errors.
  • Large lists go in one request (array, messages or CSV) instead of thousands of single calls.
  • You tested with the web sender and your own number first.
Need help with an integration? Talk to our developers on WhatsApp, call +263 77 878 5354 or email [email protected].