Send SMS

Default sender, branded sender ID, template, or bulk recipients.

POST /send uses the platform default sender per carrier. POST /send/with-sender-id requires sender_id. to may be a string, CSV, or array (max 1000). Optional template_id or template_name plus variables: the rendered template body wins over message. Send Idempotency-Key to avoid charging twice on retries. Use a Sandbox key until you are ready to send to real phones.

GSM-7 (English) is 160 characters per SMS, concatenated cap 720 septets. Any non-GSM character (one Nepali letter is enough) switches the whole message to UCS-2: 70 per SMS, 335 max. Templates are sent on the same routes with template_id or template_name.

Scenario 1 — single transactional SMS (live key):

Request: POST /api/v1/sms/send

bash

curl -X POST "https://api.messengernepal.com.np/api/v1/sms/send" \
  -H "X-API-Key: msnp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-notify-1001" \
  -d '{
    "to": "98XXXXXXX",
    "message": "Your Content Here!",
    "message_type": "transactional"
  }'

Response: 202 Accepted (live)

json

{
  "success": true,
  "message": "SMS accepted for delivery",
  "data": {
    "dispatch_id": "661f0a1b2c3d4e5f67890123",
    "job_id": "661f0a1b2c3d4e5f67890123",
    "message_id": "661f0a1b2c3d4e5f67890123",
    "status": "accepted",
    "environment": "live",
    "sender_id": null,
    "recipient": "98XXXXXXX",
    "cost": 1,
    "remaining_balance": 482,
    "remaining_credits": 482
  }
}

Scenario 2 — branded sender ID:

Request: POST /api/v1/sms/send/with-sender-id

bash

curl -X POST "https://api.messengernepal.com.np/api/v1/sms/send/with-sender-id" \
  -H "X-API-Key: msnp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "98XXXXXXX",
    "sender_id": "Msngr_test",
    "message": "Your Content Here!"
  }'

Response: 202 Accepted (with sender)

json

{
  "success": true,
  "message": "SMS accepted for delivery",
  "data": {
    "dispatch_id": "661f0a1b2c3d4e5f67890123",
    "job_id": "661f0a1b2c3d4e5f67890123",
    "message_id": "661f0a1b2c3d4e5f67890123",
    "status": "accepted",
    "environment": "live",
    "sender_id": "Msngr_test",
    "recipient": "98XXXXXXX",
    "cost": 1,
    "remaining_balance": 481,
    "remaining_credits": 481
  }
}

Scenario 3 — saved SMS template:

Request: POST /api/v1/sms/send (template)

bash

curl -X POST "https://api.messengernepal.com.np/api/v1/sms/send" \
  -H "X-API-Key: msnp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "98XXXXXXX",
    "template_name": "welcome",
    "variables": {
      "name": "Ada"
    }
  }'

Scenario 4 — bulk recipients (string array or CSV, max 1000):

Request: bulk send

bash

curl -X POST "https://api.messengernepal.com.np/api/v1/sms/send" \
  -H "X-API-Key: msnp_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: bulk-campaign-42" \
  -d '{
    "to": ["98XXXXXXX", "97XXXXXXX"],
    "message": "Store opening tomorrow at 10am.",
    "message_type": "promotional"
  }'

Response: 202 Accepted (bulk)

json

{
  "success": true,
  "message": "SMS accepted for delivery",
  "data": {
    "batch_id": "6620aa11bb22cc33dd44ee55",
    "total_count": 2,
    "accepted_count": 2,
    "total_cost": 2,
    "remaining_balance": 480,
    "remaining_credits": 480,
    "dispatch_ids": [
      "661f0a1b2c3d4e5f67890123",
      "661f0a1b2c3d4e5f67890124"
    ],
    "job_ids": [
      "661f0a1b2c3d4e5f67890123",
      "661f0a1b2c3d4e5f67890124"
    ],
    "dispatches": [
      {
        "dispatch_id": "661f0a1b2c3d4e5f67890123",
        "job_id": "661f0a1b2c3d4e5f67890123",
        "message_id": "661f0a1b2c3d4e5f67890123",
        "status": "accepted",
        "environment": "live",
        "recipient": "98XXXXXXX",
        "cost": 1
      },
      {
        "dispatch_id": "661f0a1b2c3d4e5f67890124",
        "job_id": "661f0a1b2c3d4e5f67890124",
        "message_id": "661f0a1b2c3d4e5f67890124",
        "status": "accepted",
        "environment": "live",
        "recipient": "97XXXXXXX",
        "cost": 1
      }
    ]
  }
}

Replay the same Idempotency-Key on a retry to receive the original accept without a second charge. Missing templates return TEMPLATE_NOT_FOUND. Insufficient wallet credit returns INSUFFICIENT_CREDITS. Lists larger than 1,000 numbers need more than one request. See Large lists.