Base URL https://gateway.nhzglobal.com/api/v1. All requests and responses are JSON over HTTPS.
Create a key in Settings → API keys. It is shown once; store it like a password. Send it on every request:
Authorization: Bearer nhz_xxxxxxxxxxxxxxxxxxxxxxxx
A missing or wrong key returns 401.
POST /api/v1/messages
{
"to": ["+14155550123", "+447700900123"],
"message": "Hi {name}, your order has shipped",
"channel": "sms",
"device_id": 3,
"sim_slot": 0,
"schedule_at": "2026-12-01T09:00:00Z"
}
| Field | Required | Notes |
|---|---|---|
to | Yes | Array or comma separated string, up to 1,000 numbers. Numbers without a + get your account's default country code (set in Settings). |
message | Yes | Up to 1,600 characters. {name} becomes the contact's name. |
channel | No | sms (default) or whatsapp. |
device_id | No | Send from one phone. Default: any online phone. |
sim_slot | No | 0 or 1. Default: spread across SIMs. |
schedule_at | No | ISO 8601 date and time to send later. |
marketing | No | true for promotional texts: adds your opt-out line and holds the send until your quiet hours end (both set in Settings). |
Response 201: the queued messages, plus any numbers skipped as invalid or opted out.
{
"batch": "01JD3Q...",
"messages": [{ "id": 9123, "phone": "+14155550123", "status": "queued" }],
"skipped": [{ "phone": "+447700900123", "reason": "opted out" }]
}
GET /api/v1/messages/9123 GET /api/v1/messages?direction=in&since_id=9000&limit=50
Filters: direction (in, out), status, channel, batch, phone, since_id, limit (max 200). Newest first.
DELETE /api/v1/messages/9123
Cancels a message that is still queued. Returns {"cancelled": true} or false if it already went.
GET /api/v1/devices
Your paired phones with online state, battery, SIMs and sending limits.
We create the code, send it, and check it. Your app never stores the code.
POST /api/v1/otp
{ "to": "(415) 555-0123", "length": 6, "expires_in": 600 }
# 201
{ "id": 55, "phone": "+14155550123", "status": "pending", "expires_at": "..." }
POST /api/v1/otp/verify
{ "id": 55, "code": "483920" }
# 200
{ "valid": true, "status": "approved" }
message | Optional text with {code}, for example "Your Acme code is {code}". |
channel | sms (default) or whatsapp, which needs template: an approved authentication template with one body value. |
| Limits | 5 wrong tries per code, 5 codes per number per hour, one new code every 30 seconds. Codes skip ahead of bulk campaigns in the phone queue. |
| queued | Waiting for a phone (or for its scheduled time). |
| dispatched | Handed to a phone or to WhatsApp. |
| sent | Left the phone or WhatsApp accepted it. |
| delivered | The handset confirmed delivery. |
| read | Read by the customer (WhatsApp only). |
| failed | Not delivered; see error. |
| received | An incoming message. |
Set a URL in Settings. We POST these events: message.received, message.status, link.clicked (first click on a tracked link) and otp.approved. Each call carries X-NHZ-Event and X-NHZ-Delivery headers. Failed calls retry five times over about 8 hours, and you can see every attempt in Settings.
{
"event": "message.received",
"data": { "id": 9130, "channel": "sms", "direction": "in",
"phone": "+14155550123", "body": "Yes please" },
"sent_at": "2026-11-20T10:07:00Z"
}
Verify each call: X-NHZ-Signature equals HMAC-SHA256 of the raw body with your webhook secret.
// PHP $ok = hash_equals(hash_hmac('sha256', file_get_contents('php://input'), $secret), $_SERVER['HTTP_X_NHZ_SIGNATURE'] ?? '');
120 requests a minute per key. Each phone sends at its own pace (set on the Devices page) to protect the SIM, so large sends queue and go out steadily.