HOME / DEVELOPERS
For developers

A REST API built for simplicity.

Send a single message, run a campaign, check balance, or hook inbound replies into your stack — all over HTTPS with HTTP Basic auth. Server-side libraries available in PHP, Node.js, Python, Java, C#, Go, Ruby and PowerShell.

Full API reference → Get an API key
Send your first SMS

Six lines of code. Any language.

Pick a tab. Each example sends a single SMS to a South African number using your API key + secret over HTTP Basic auth.

# Send your first SMS in one curl call
curl -X POST https://api.nextgensms.co.za/v1/messages \
  -u "$NEXTGENSMS_API_KEY:$NEXTGENSMS_API_SECRET" \
  -H "Content-Type: application/json" \
  -d '{
    "to":      "+27721234567",
    "from":    "NextGenSMS",
    "message": "Hi {FirstName}, your appointment is tomorrow at 09:00."
  }'
<?php
// Send your first SMS in 6 lines of PHP
$ch = curl_init("https://api.nextgensms.co.za/v1/messages");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Basic " . base64_encode("$apiKey:$apiSecret"),
  "Content-Type: application/json",
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
  "to"      => "+27721234567",
  "message" => "Hi {FirstName}, your appointment is tomorrow at 09:00.",
]));
$response = curl_exec($ch);
// Send your first SMS in 8 lines of Node.js
const auth = Buffer.from(`${process.env.API_KEY}:${process.env.API_SECRET}`).toString("base64");

const res = await fetch("https://api.nextgensms.co.za/v1/messages", {
  method: "POST",
  headers: { "Authorization": `Basic ${auth}`, "Content-Type": "application/json" },
  body: JSON.stringify({
    to: "+27721234567",
    from: "NextGenSMS",
    message: "Hi {FirstName}, your appointment is tomorrow at 09:00.",
  }),
});
const json = await res.json();
console.log(json);
# Send your first SMS in 7 lines of Python
import os, base64, requests

auth = base64.b64encode(f"{os.environ['API_KEY']}:{os.environ['API_SECRET']}".encode()).decode()
res = requests.post(
    "https://api.nextgensms.co.za/v1/messages",
    headers={"Authorization": f"Basic {auth}"},
    json={"to": "+27721234567", "from": "NextGenSMS",
          "message": "Hi {FirstName}, your appointment is tomorrow at 09:00."},
)
print(res.json())
// Send your first SMS in C# (HttpClient)
var auth = Convert.ToBase64String(Encoding.UTF8.GetBytes($"{apiKey}:{apiSecret}"));
using var http = new HttpClient();
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", auth);

var body = new {
    to = "+27721234567",
    from = "NextGenSMS",
    message = "Hi {FirstName}, your appointment is tomorrow at 09:00."
};
var json = new StringContent(JsonSerializer.Serialize(body), Encoding.UTF8, "application/json");
var res = await http.PostAsync("https://api.nextgensms.co.za/v1/messages", json);
var resp = await res.Content.ReadAsStringAsync();
// Send your first SMS in Go (net/http)
func sendSMS(apiKey, apiSecret, to string) (error) {
    payload := strings.NewReader(`{"to":"` + to + `","from":"NextGenSMS","message":"Hi {FirstName}, your appointment is tomorrow at 09:00."}`)
    req, _ := http.NewRequest("POST", "https://api.nextgensms.co.za/v1/messages", payload)
    req.Header.Set("Authorization", "Basic "+base64.StdEncoding.EncodeToString([]byte(apiKey+":"+apiSecret)))
    req.Header.Set("Content-Type", "application/json")
    res, err := http.DefaultClient.Do(req)
    if err != nil { return err }
    defer res.Body.Close()
    return nil
}
Endpoints

Everything you need for production SMS.

Stable, versioned REST endpoints. Authentication via HTTP Basic with your API key and secret.

Full reference →
POST/v1/messages
Send a single message or batch. Returns delivery status and message IDs.
POST/v1/campaigns
Schedule a campaign to a contact list or segment with merge tags.
GET/v1/messages/{id}
Look up delivery status, cost, network and DLR timestamps.
GET/v1/balance
Current credit balance, low-credit thresholds and projected run-out.
POST/v1/webhooks
Register inbound-reply, DLR and opt-out webhooks. Signed payloads.
GET/v1/inbound
List inbound SMS replies tied to your long numbers or short codes.
POST/v1/lists/:id/optout
Mark a contact as opted out. Suppresses them across all your sends.
GET/v1/senderids
List registered sender IDs and their WASPA / network approval status.
Get started

Three steps to your first send.

Most teams are sending in under an hour.

STEP 01

Register & get a key

Free account in under 90 seconds. We email you an API key + secret under Settings → API.

STEP 02

Top up with credits

Buy credits in-app or via the API itself. Pay with Netcash (EFT, card, debit order, QR, voucher, Payflex, retail).

STEP 03

Send & verify

Run the cURL snippet above against your sandbox key. Switch to a live key when you're ready for real traffic.

Read the full reference.

Every endpoint, every parameter, with copy-pasteable examples and SDKs.

Open reference → Get a sandbox key