Skip to content
MZSMS

Sending

Send SMS

POST /api/v1/sms/send: send one message, with idempotency and scheduling.

POST/api/v1/sms/sendScope: sms:send

Request#

Parameters
FieldTypeDescription
torequiredstringBangladeshi mobile number in any common format.
messagerequiredstringMessage text, up to 10 segments (about 1,530 GSM-7 characters or 670 Unicode characters).
sender_idoptionalstringAn approved sender ID of your account. Defaults to your default sender, or the shared non-masking number.
typeoptional"transactional" | "promotional"Defaults to transactional. Promotional messages skip opted-out recipients and respect quiet hours.
referenceoptionalstringYour own reference (max 100 characters), returned in webhooks.
schedule_atoptionalISO 8601 stringSend later, up to 30 days ahead. Charged when accepted.
curl -X POST https://sms.marketian.net/api/v1/sms/send \
  -H "Authorization: Bearer $MZSMS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-10234-otp" \
  -d '{
    "to": "+8801XXXXXXXXX",
    "message": "Your verification code is 123456",
    "sender_id": "YOURBRAND",
    "type": "transactional"
  }'

Response#

202 Accepted with the message ID, status queued, segment count and the amount charged.

{
  "success": true,
  "data": {
    "message_id": "5b0f2c7e-7a55-4b1e-9d0a-3c1d2e4f6a70",
    "to": "+8801XXXXXXXXX",
    "status": "queued",
    "segments": 1,
    "encoding": "GSM7",
    "cost": "0.35",
    "currency": "BDT"
  },
  "meta": { "requestId": "req_8f2k1m0q7x3v9b2n" }
}

Segments and cost#

The cost is segments × rate. Plain Latin text is GSM-7: 160 characters for one segment, 153 per segment when longer. Any Bangla or emoji character switches the whole message to Unicode: 70 characters, or 67 per segment. Characters such as { } [ ] ~ \ | ^ € count as two in GSM-7. Exact limits are set per provider by the platform operator.

Idempotency#

Network failures happen. Send an Idempotency-Key header (any unique string up to 255 characters, such as your order ID plus purpose). If you retry with the same key and the same body within 24 hours, you receive the original response with an Idempotent-Replayed: true header and no second message is sent. Reusing a key with a different body returns 409 IDEMPOTENCY_CONFLICT.

Estimate before sending#

POST/api/v1/sms/estimateScope: sms:send

Returns encoding, segments and cost for a message without sending or charging anything.

curl -X POST https://sms.marketian.net/api/v1/sms/estimate \
  -H "Authorization: Bearer $MZSMS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "message": "প্রিয় গ্রাহক, আপনার অর্ডারটি আজ ডেলিভারি হবে।", "recipients": 250, "type": "promotional" }'