Send SMS

Deliver SMS to any Ghana mobile network from the Zend API with a single POST /messages request. The same endpoint powers WhatsApp and voice, so the message you send can automatically fall back to another channel if SMS can't be delivered.

POST/messages

Authentication

All API requests authenticate with your API key in the x-api-key header:

-H "x-api-key: YOUR_API_KEY"

Send an SMS

Send a message to a single recipient. to accepts Ghana numbers in international or local format, and preferred_channels tells Zend which channel(s) to use.

curl -X POST https://api.tryzend.com/messages \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+233593152134",
    "body": "Hello! This is a test SMS message.",
    "preferred_channels": ["sms"]
  }'

Response

{
  "id": "6884da240f0e633b7b979bff",
  "status": "pending",
  "estimated_cost": 0.02,
  "message": "Message queued for processing"
}

The response returns immediately with a pending status and the message id. Use that id to track the final outcome — see SMS delivery & webhooks.

Request fields

tostringrequired
Recipient phone number. Ghana formats accepted: +233593152134, 233593152134, or 0593152134.
bodystringrequired
The message text.
preferred_channelsstring[]required
Ordered list of channels to attempt. Use ["sms"] for SMS only.
sender_idstring
The approved sender ID shown to the recipient. Defaults to your account's default sender ID.

Note

Phone numbers must be valid Ghana mobile numbers. Sending to an unregistered format returns a 400 — see the error reference in SMS delivery & webhooks.

Sender IDs

Set sender_id to control the name that appears as the sender on the recipient's handset. Sender IDs must be approved for your account before use.

{
  "to": "+233593152134",
  "body": "Your order has been confirmed!",
  "preferred_channels": ["sms"],
  "sender_id": "RODIN"
}

If you omit sender_id, your account's default is used. Sending with an unapproved sender ID returns a 400 Bad Request.

Message limits & segments

SMS is billed and segmented per part. A single message holds up to 160 characters; longer messages are split into concatenated parts, and each part is billed separately.

  • Character limit: 160 characters per SMS part
  • Concatenated SMS: up to 10 parts (1600 characters)
  • Rate limit: 100 messages per minute
  • Cost: $0.02 per SMS part

Estimate how many parts a message will use before sending:

const message = "Your verification code is: 123456";

const parts = Math.ceil(message.length / 160);
console.log(`Characters: ${message.length}`); // 33
console.log(`SMS parts: ${parts}`);           // 1

Best practices

  • Use international format for phone numbers (+233593152134) to avoid ambiguity across networks.
  • Keep messages concise. Staying under 160 characters keeps each message to a single billed part.
  • Prefer plain characters. Non-GSM characters can shrink the per-part limit and increase segment count.
  • Track every send. Store the returned id and confirm the final status rather than assuming delivery — see SMS delivery & webhooks.
  • Add fallback for critical messages. For OTPs and time-sensitive alerts, let Zend retry over WhatsApp or voice — see SMS fallback & priority.

Next steps