Get up and running
with Lunyazi
Everything you need to send your first SMS, set up OTP verification, and reach production, without contacting support.
Welcome
What Lunyazi is and what this guide will help you achieve.
Getting Started
A step-by-step onboarding journey from login to first message.
Credits & Billing
How credits work, the two pools, and how to recharge via MoMo.
Sender IDs
What they are, how to request one, and common mistakes.
SMS Messaging
Single sends, bulk sends, test mode, and delivery status.
Send Your First SMS
A step-by-step walkthrough from your API key to a confirmed delivery.
API Integration
Three ways to connect Lunyazi to your own system, and which one to use.
OTP Verification
Integrate phone verification into your app in two API calls.
Secure Share
Send a document that only the intended recipient can open, with OTP verification and malware scanning.
Troubleshooting
Solutions to common issues with SMS, OTP, and billing.
Team Accounts
Invite your team to your account, each with their own login, while you keep control of billing and settings.
1 of 11
Welcome to Lunyazi
What Lunyazi is, what problems it solves, and what this guide will help you achieve.
Lunyazi is a prepaid business communications platform that lets you send SMS messages and OTP verification codes to your customers, members, or users, through a simple dashboard or API.
What problems does Lunyazi solve?
- Send SMS to many people at once: reminders, notifications, alerts.
- Verify phone numbers or identities using one-time codes (OTP).
- Reach Eswatini and international numbers from one account.
- Automate recurring messages without building complex infrastructure.
What this guide covers
By the end of this guide you will be able to:
- Recharge your account with credits
- Set up your Sender ID
- Send your first SMS
- Integrate OTP verification into your application
- Reach production without needing to contact support
Did this page help?
2 of 11
Getting Started
A step-by-step onboarding journey from login to your first production message.
Go to lunyazi.com/dashboard and sign in with your email and password. If you don't have an account, click Create account. You'll receive 10 free credits on signup.
Go to Billing in the sidebar. Select your credit pool, enter the quantity you want, and pay via MTN MoMo. Credits are added instantly. See Credits & Billing for full details.
Your Sender ID is the name that appears on your recipients' phones. Contact the Lunyazi team to request one before your first production send. See Sender IDs for full details.
Go to SMS in the sidebar. Enter a recipient number and a message, then click Send. To try a send without using credits, turn on Test mode first; it simulates the message without charging or reaching the carrier. See SMS Messaging for full details.
Go to Reports in the sidebar. Your message log shows each send with its delivery status: Delivered, Sent, Pending, or Failed.
Go to Account in the sidebar. Click Show next to your API key, copy it, and include it as the X-Api-Key header in every API request.
+268000000000 test number is for OTP verification, not SMS.Did this page help?
3 of 11
Credits & Billing
How credits work, the two credit pools, how to recharge, and purchase history.
Lunyazi uses a credit system. You buy credits in advance and spend them when you send messages.
Two credit pools
| Pool | Used for | Expiry |
|---|---|---|
| Eswatini | Numbers starting with +268 | End of month |
| International | SA (+27), UK (+44), and other countries | Never expire |
How to recharge
- Go to Billing in the sidebar.
- Select Eswatini (+268) or International.
- Enter the quantity of credits you need.
- Review the total: pricing is tiered by volume.
- Enter your MTN MoMo number and click Pay with MoMo.
- Approve the payment prompt on your phone.
- Credits appear in your balance instantly once payment is confirmed.
Purchase history
Scroll to the bottom of the Billing page to see your full purchase history: date, pool, credits, and payment status for each transaction.
Did this page help?
4 of 11
Sender IDs
What a Sender ID is, why it matters, how to request one, and common mistakes to avoid.
A Sender ID is the name or number that appears on your recipient's phone when they receive your message.
Why it matters
- A recognised Sender ID improves open rates: recipients know who sent the message.
- Without a custom Sender ID, messages arrive from a generic number.
- A branded Sender ID looks professional and builds trust with your audience.
How to request a Sender ID
- Contact Lunyazi support via email at sales@lunyazi.com or WhatsApp.
- Provide the name you want to use (max 11 characters, letters and numbers only), a short description of your use case, and your business website.
- Allow 1β2 business days for activation.
- Once activated, all your outgoing messages will show your Sender ID.
Sender ID rules
- Maximum 11 characters
- Letters and numbers only, no spaces or special characters
- Must represent your organisation or brand
- Cannot impersonate another organisation
Common mistakes
- Spaces in the name: use a single word or abbreviation (e.g.
MyBusinessnotMy Business) - Too long: names over 11 characters are truncated by the carrier
- Sending before activation: messages will show a default sender until your Sender ID is activated
Did this page help?
5 of 11
SMS Messaging
How to send a single message, send in bulk, use test mode, and check delivery status.
Sending a single message
- Go to SMS in the sidebar.
- Enter the recipient's phone number in international format (e.g.
+26876123456). - Type your message.
- Click Send.
Sending bulk messages
- On the SMS page, switch to the Bulk tab.
- Upload a CSV or paste numbers, one per line.
- Enter your message.
- Review the recipient count and estimated credit cost.
- Click Send to all.
Test mode
Enable Test mode on the SMS page to simulate sending without using credits or reaching the carrier. Every number is simulated in this mode, so no real SMS is delivered. (The +268000000000 test number applies to OTP verification, not SMS. Via the API, use test_mode: true on /sms/send-bulk for the same dry run.)
Delivery status
Go to Reports to check delivery status for each message.
| Status | Meaning |
|---|---|
| β Delivered | Confirmed received by the handset |
| π€ Sent | Accepted by the carrier, delivery pending |
| β³ Pending | Awaiting delivery confirmation |
| β Failed | Could not be delivered |
Did this page help?
6 of 11
Send Your First SMS
Step-by-step SMS API integration guide, for developers integrating business notifications, reminders, confirmations, and alerts.
Lunyazi lets your application send SMS through a simple HTTPS API. In this guide, you'll retrieve your API key, send a message, store its identifier, and check delivery status.
Before you start
You'll need:
- A Lunyazi account: lunyazi.com/dashboard
- Access to the account's Account and Billing pages
- An API key
- Sufficient SMS credits for a live send
- A phone you control for delivery testing
- A terminal with
curl, Postman, or any backend that can send HTTPS requests
For a branded production message, request a Sender ID from sales@lunyazi.com if one has not already been configured. You can integrate the API before your custom Sender ID is approved; messages sent before activation may show a default sender.
Step 1: Sign in and check your credits
- Open lunyazi.com/dashboard and sign in, or create an account.
- Open Billing to check or purchase SMS credits.
- For Eswatini numbers (
+268), select the Eswatini credit pool. - Confirm your balance before sending a live SMS.
Step 2: Retrieve your API key
- In the dashboard, open Account.
- Click Show next to your API key.
- Copy the key into a secure secret store or an environment variable.
- Do not put the API key into frontend JavaScript, public repositories, or mobile-app source code.
All authenticated requests use this header:
X-Api-Key: YOUR_API_KEY
Requests with a JSON body also use:
Content-Type: application/json
Step 3: Send your first message
Lunyazi's single-message endpoint is:
POST https://api.lunyazi.com/sms/send
Run this command after replacing YOUR_API_KEY, YOUR_UNIQUE_MESSAGE_KEY, and the example recipient number. Use a number you control.
curl -X POST 'https://api.lunyazi.com/sms/send' \
-H 'X-Api-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: YOUR_UNIQUE_MESSAGE_KEY' \
-d '{
"to": "+26876123456",
"message": "Hello! This is my first Lunyazi API message.",
"client_reference": "first-sms-001"
}'
Request fields
| Field | Purpose |
|---|---|
to | Recipient number in international format (for example, +26876123456). A single number only, no commas or spaces. |
message | SMS text to send. Up to 480 characters (up to 3 SMS segments). Longer messages are rejected with 400. |
client_reference | Optional ID from your application for matching messages to records. It is echoed back in the send and status responses. |
Idempotency-Key | Optional HTTP header to make retries safer; use a unique value per logical message. |
Your account's configured Sender ID is applied to outgoing messages. The basic send payload above does not require a Sender ID field.
Step 4: Read the API response
A successful send request returns JSON similar to this illustrative response; values will differ for your message:
{
"success": true,
"message": "SMS sent",
"message_id": "0913000166",
"credits_remaining": 42,
"cost": 1,
"segments": 1,
"destination": "Eswatini",
"pool": "sz",
"client_reference": "first-sms-001"
}
Save the returned message_id alongside your own client_reference. The cost, segments, and credits_remaining fields help you reconcile usage.
success field in the body, not only the HTTP status. A message held for content review returns HTTP 200 with success: false and a hold_id; it has not been sent, and you can track it in the dashboard Reports tab.Step 5: Check delivery status
Use the message_id returned by Step 4:
curl -G 'https://api.lunyazi.com/sms/status' \ -H 'X-Api-Key: YOUR_API_KEY' \ --data-urlencode 'message_id=YOUR_MESSAGE_ID'
An illustrative status response:
{
"message_id": "0913000166",
"status": "delivered",
"success": true,
"recipient": "+26876123456",
"timestamp": "2026-10-28T12:41:50Z",
"client_reference": "first-sms-001"
}
| Status | Meaning |
|---|---|
pending | Waiting for carrier or delivery confirmation. |
sent | Accepted by the carrier; delivery not yet confirmed. |
delivered | Delivery confirmed. |
failed | Delivery failed. |
unknown | No delivery confirmation arrived within the confirmation window (about 7 days). Treat this as unconfirmed, not as a confirmed failure. |
A message not found in your account returns 404. You can also view message activity in Reports in the dashboard.
Step 6: Handle retries without unnecessary duplicates
Networks occasionally time out even when a message was accepted. Include an Idempotency-Key header on each send request and reuse the same key only when retrying that exact logical message.
- If an identical request is retried within 24 hours with the same key, Lunyazi can return the stored response without sending or charging again. Replayed responses include
Idempotent-Replayed: true. - If the first request is still processing, a retry may return
409. Wait briefly and retry using the same key. - If a send returns an indeterminate
5xxerror, retry using the same key with backoff and a retry limit. - For each genuinely new message, generate a new key.
Idempotency reduces duplicate sends but carrier-level delivery cannot be guaranteed to be exactly once in all failure scenarios.
Step 7: Test safely before production
For a first end-to-end live delivery test, use your own phone number and expect the send to consume credits.
For a simulation without delivery or charges, use Test mode on the dashboard's SMS page. The API's /sms/send-bulk endpoint also supports test_mode: true for dry runs; refer to the API documentation for that endpoint's full request format.
+268000000000 as an SMS test recipient. That special number is for OTP testing, not ordinary SMS.Before going live, confirm:
- Authentication succeeds from your backend.
- The correct Sender ID is active, if branded messaging is required.
- Your test message arrives on a phone you control.
- You record the API response and
message_id. - Delivery status is checked separately.
- You handle transient errors and retries safely.
- You keep API keys server-side and out of logs.
- You have sufficient credits for expected production traffic.
Troubleshooting
| Response or symptom | What to check |
|---|---|
400 Bad Request | Validate the payload, phone number, required fields, and message length (max 480 characters). |
401 Unauthorized | Confirm the X-Api-Key header and API key are correct. |
402 Payment Required | Check your credits and the destination credit pool. |
403 Forbidden | Review message content against applicable carrier/content restrictions. |
404 Not Found on status | Check the message_id and that it belongs to your account. |
409 Conflict on retry | The initial idempotent send may still be processing; wait, then retry with the same key. |
429 Too Many Requests | Reduce request frequency; add backoff or use an appropriate bulk-sending approach. |
5xx | Retry with the original idempotency key and controlled backoff. |
200 with success: false | The message was held for content review (see the hold_id); it was not sent. |
| No delivery confirmation | Inspect the status endpoint or dashboard Reports; sent does not mean delivered, and unknown means unconfirmed. |
What to integrate next
Once your first SMS works, explore these patterns:
- Template-based sending: Use a managed template rather than hardcoded message text.
- Event-driven sending: Call
/sms/postwhen business events occur, allowing message wording to be updated independently of application code. - OTP verification: Use
/otp/sendand/otp/verifyto confirm phone ownership.
See the API Integration section for these patterns in detail.
Need help?
Contact sales@lunyazi.com or +268 7817 0242. Include the relevant error response, your Customer ID, and (when available) the message_id or client_reference. Never send your API key.
Did this page help?
7 of 11
API Integration
Three ways to connect Lunyazi's SMS API to your own system, and which one to use.
Every integration boils down to one question: what triggers a send, and where does the message wording live? There are three patterns, in increasing order of how well they scale as your system grows.
Option 1: Raw send
Your system builds the full message text itself, every time.
POST https://api.lunyazi.com/sms/send
X-Api-Key: your_api_key
{
"to": "+26876123456",
"message": "Hi Thabo, your order is ready for collection."
}
Simplest to start with, but any wording change means editing your own code and redeploying. Fine for a single internal tool with one message type.
Option 2: Template by ID
Message wording lives in Lunyazi and can be edited without a redeploy, but your code still needs to know the specific template's ID.
POST https://api.lunyazi.com/sms/send
X-Api-Key: your_api_key
{
"to": "+26876123456",
"template_id": "tpl_02b4b421",
"variables": {"name": "Thabo"}
}
Option 3: Event-driven (recommended)
Your system fires a plain event name it already understands from its own business logic, e.g. PAYMENT_RECEIVED or APPLICATION_CONFIRMED. No template IDs, no coupling to Lunyazi's internals. This is the right fit whenever the wording of a message might need to change without a code deploy, which is the common case for most businesses.
Do this once per message type, from your own code or directly in the dashboard.
POST https://api.lunyazi.com/sms/templates
X-Api-Key: your_api_key
{
"name": "Application Confirmed",
"event_name": "APPLICATION_CONFIRMED",
"body": "Hi {{name}}, we've received your application to {{program}}. We'll be in touch soon."
}This is the only call your application code ever needs to make, whenever the event happens.
POST https://api.lunyazi.com/sms/post
X-Api-Key: your_api_key
{
"event": "APPLICATION_CONFIRMED",
"to": "+26876123456",
"data": {"name": "Thabo", "program": "Software Engineering"}
}Lunyazi looks up your active template for that event, substitutes data into the {{variables}}, and sends.
Validation: a
data object missing a required {{variable}} returns 400 with the missing field named, no send attempted. An unknown or inactive event returns 404.Safe retries: idempotency
To make a send safe to retry, add an Idempotency-Key header with a value that is unique per message (for example, one per order, booking, or request). If a request with the same key arrives again within 24 hours, Lunyazi returns the original response and does not send a second message or charge again. So a network timeout followed by a retry with the same key results in exactly one SMS. This works on both /sms/send and /sms/post.
POST https://api.lunyazi.com/sms/send
X-Api-Key: your_api_key
Idempotency-Key: order-8f2a1c
{
"to": "+26876123456",
"message": "Your order is ready for collection.",
"client_reference": "order-8f2a1c"
}
Every send response includes a message_id you can store and use to check delivery (below). The optional client_reference is echoed back and stored, so you can match a message to your own record.
{
"success": true,
"message": "SMS sent",
"message_id": "0913000166",
"credits_remaining": 42,
"cost": 1,
"segments": 1,
"destination": "Eswatini",
"pool": "sz",
"client_reference": "order-8f2a1c"
}
Idempotent-Replayed: true. The response body is identical either way.Retry behaviour: a retry that arrives while the first is still processing returns
409 (wait briefly, then retry with the same key). An indeterminate failure returns a 5xx and is safe to retry with the same key. A clear error such as 402 (insufficient credits) releases the key, so you can fix the problem and retry.Honest limit: idempotency makes retries safe and prevents duplicates in the timeout-and-retry case. It cannot be guaranteed to zero, because the underlying carriers do not offer idempotency at their layer. In practice, a stable per-request key gives exactly-once behaviour for a timed-out retry.
Checking delivery status
Use the message_id from any send response to check delivery. The endpoint returns only your own messages.
GET https://api.lunyazi.com/sms/status?message_id=0913000166 X-Api-Key: your_api_key
{
"message_id": "0913000166",
"status": "delivered",
"success": true,
"recipient": "+26876123456",
"timestamp": "2026-10-28T12:41:50Z",
"client_reference": "order-8f2a1c"
}
status moves through pending, sent, and delivered, or failed. A status of unknown means no delivery confirmation arrived within about 7 days, so treat it as unconfirmed rather than a confirmed failure. A message ID that is not found, or not yours, returns 404.
Did this page help?
8 of 11
OTP Verification
What OTP is, typical use cases, and how to integrate it into your application in two API calls.
OTP (One-Time Password) lets you verify that a user owns a phone number by sending them a code and checking that they entered it correctly.
Typical use cases
- User registration: confirm the phone number during signup
- Login verification: two-factor authentication (2FA)
- Password reset: verify identity before allowing a reset
- Transaction confirmation: confirm high-value actions
- Membership verification: confirm a member's identity
Integration flow
Call the Lunyazi OTP API with the user's phone number. Lunyazi generates a code and sends it via SMS.
POST https://api.lunyazi.com/otp/send
X-Api-Key: your_api_key
{
"channel": "sms",
"recipient": "+26876123456",
"app_name": "Your App Name"
}The response includes an otp_id. Save this for the verification step.
Show an input field for the user to enter the code they received on their phone.
Pass the otp_id and the user's entered code to the verify endpoint.
POST https://api.lunyazi.com/otp/verify
X-Api-Key: your_api_key
{
"otp_id": "otp_abc123",
"code": "492817"
}A successful response means the code is valid and the phone number is verified.
+268000000000 always returns code 123456 and uses no credits, so use this to test your integration before going live.Eswatini DPA 2022: OTP verification meets the identity verification requirements of Section 14 of the Data Protection Act 2022. See lunyazi.com/otp for more.
Did this page help?
10 of 11
Troubleshooting
Solutions to common issues. If your issue is not listed, contact support.
SMS not delivered
| Possible cause | What to check |
|---|---|
| No credits remaining | Check your balance on the Overview page and top up via Billing. |
| Invalid phone number format | Numbers must be in international format: +26876123456. No spaces or dashes. |
| Recipient's phone is off | A Pending status in Reports means the carrier is still attempting delivery. |
| Message blocked by content policy | Certain words are blocked to comply with carrier policies. If you receive a 403 error, review your message content. |
OTP code not received
| Possible cause | What to check |
|---|---|
| No credits | OTP sends use the same credit pool as SMS. Check your balance. |
| Invalid phone number | Confirm the number is in international format and is reachable. |
| Code expired | OTP codes expire after 5 minutes. Request a new one. |
Unable to recharge
| Possible cause | What to check |
|---|---|
| MoMo approval not completed | Check your phone for the MoMo prompt. It expires after a few minutes. |
| Insufficient MoMo balance | Ensure your MoMo wallet has enough funds before initiating payment. |
| Incorrect number format | Enter your MoMo number without the + sign: 26878XXXXXX. |
API returning 401 Unauthorized
- Your API key may be incorrect. Go to Account and copy it again.
- Ensure you are sending the key as the
X-Api-Keyheader, not in the request body.
API returning 429 Too Many Requests
- You have exceeded the per-minute rate limit. Add a delay between sends or use the bulk send endpoint for large batches.
Did this page help?
11 of 11
Team Accounts
Invite your team to your account, each with their own login, while you keep control of billing and settings.
A Lunyazi account can have more than one person. Everyone works from the same account and the same credit balance, and every message shows who sent it. There are two roles: Admin (can send, manage contacts and manage the team) and Member (can send and manage their own contacts). You, the account owner, always keep full control.
Invite a team member
In the dashboard sidebar, open Team. Only the owner and admins can see it.
Enter the person's name and email, choose Member or Admin, and send. They receive an email with a link to set their own password.
The member opens the link, sets a password, then logs in at lunyazi.com/dashboard with their own email and password, at the same place you do.
What members can and cannot do
- Members can: send SMS (single and bulk, to anyone), manage their own contacts, and view the message history.
- Owner only: billing and top-ups, the API key, account settings, and managing team members. Members never see your API key.
- Admins can additionally manage the team and all contacts, but billing, the API key and account settings stay with the owner.
Contacts
Members can add their own contacts and delete the ones they added. The owner and admins can manage all contacts on the account.
Remove a member
On the Team page, click Disable next to a member. Their access ends immediately and they can no longer log in or send.
Did this page help?