API Docs

NBM SMS API

What the NBM SMS API does and how to send your first message.

The NBM SMS API lets your application send SMS, one-time passcodes and WhatsApp template messages, track delivery, manage sender names and top up credit. It is a JSON REST API over HTTPS, with an SMPP gateway for systems that already speak SMPP.

What you can build

Quick start

  1. Create an account and an API keySign up at sms.nbmbrand.com, open API in the portal and choose New API key. Copy the key straight away — it starts with nbm_ and is shown only once. See Authentication.
  2. Keep the key on your serverStore it in an environment variable such as NBM_SMS_API_KEY. Never put it in a mobile app, a web page or a public repository.
  3. Send a message
    curl -X POST https://sms.nbmbrand.com/api/v1/messages \
      -H "Authorization: Bearer $API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "sender_name": "NBM",
        "messages": [
          {
            "receiver": "0712345678",
            "content": "Karibu! Your NBM account is ready."
          }
        ]
      }'
    Response
    201 Created
    {
      "success": true,
      "status_code": 201,
      "status_text": "Created",
      "message": "messages have been created",
      "data": null
    }
  4. Track deliveryAdd a webhook URL in the portal to receive delivery reports, or poll List messages.

Key concepts

TermMeaning
API keyA secret starting with nbm_ that identifies your account on every request. You can have many, one per integration.
Sender nameThe name recipients see as the sender, e.g. NBM. Up to 11 characters, reviewed by NBM before use.
UnitThe billing unit for SMS. A plain-text message of up to 160 characters is 1 unit; longer or Unicode messages use more. See billing.
BalanceYour prepaid SMS credit (in units) and your WhatsApp wallet. Checked and charged when a message is accepted.
WebhookA URL on your server that NBM calls when a message is delivered or a sender name / purchase changes status.
ResellerAn account that manages its own customers, shares sender names with them and can see their activity.