EduFlex Notify SMS API
Send SMS to any MTN, Telecel or AT number in Ghana from your website, school portal or app. The API uses the same credits, sender IDs and contact rules as your dashboard, and every message gets a delivery status.
Authentication
Every request must include your API key in the Authorization header as a Bearer token. You can also send it in an X-API-Key header if your tool prefers that.
- Sign in and open Developers in your dashboard.
- Click Create API key and give it a name, for example "School portal".
- Copy the key straight away. It starts with
efn_and is shown only once.
EDUFLEX_API_KEY). Never put it in website JavaScript, a mobile app or a public code repository. If a key leaks, revoke it in your dashboard and create a new one.Base URL and requests
All endpoints start with this base URL:
- Send and receive JSON. Add
Content-Type: application/jsonto POST requests. - Every response has a
statusof"success"or"error". Successful responses put their result indata. - Times are in UTC using ISO 8601, for example
2026-11-20T08:00:00Z. Ghana time is the same as UTC. - Always use HTTPS so your API key stays private.
// Success { "status": "success", "data": { ... } }
// Error { "status": "error", "code": "INSUFFICIENT_CREDITS", "message": "You need 500 credits but have 120." }
Phone numbers
Send Ghana numbers in any common format. We clean them up for you, remove duplicates and skip numbers that are not valid.
| You send | We use | Result |
|---|---|---|
0241234567 | 233241234567 | Valid |
241234567 | 233241234567 | Valid |
+233 24 123 4567 | 233241234567 | Valid |
024-123-4567 | 233241234567 | Valid |
12345 | - | Skipped |
Numbers on your opt-out list are always skipped, even if you include them. The response tells you how many numbers were skipped and why.
Message length and credits
One credit sends one SMS page to one number. Longer messages are split into pages and joined again on the phone, so they use more credits.
| Characters used | 1 SMS page | Each page of a longer message | Maximum |
|---|---|---|---|
| Standard (A to Z, numbers, common punctuation) | 160 | 153 | 918 characters (6 pages) |
| Unicode (emojis, curly quotes, letters like ɛ and ɔ) | 70 | 67 | 402 characters (6 pages) |
’) or long dash (—), often added by Word or phone keyboards, switches the whole message to Unicode and can double the cost. Replace them with plain ' and -./sms/sendSend SMS
Send one message to one or many numbers (up to 50,000 per request). Credits are taken from your balance when the request is accepted. If anything goes wrong before your messages are stored, nothing is charged.
Body parameters
senderstringrequiredYour approved sender ID, for example EduFlex. Up to 11 letters or numbers.
recipientsarray of stringsrequiredPhone numbers to send to. A single comma-separated string also works. Accepted formats.
messagestringrequiredThe text to send. Up to 6 SMS pages. How length is counted.
schedule_atstringoptionalSend later instead of now. ISO 8601 date and time, at least 5 minutes and at most 90 days ahead. Scheduling.
Response fields
campaign_idstringKeep this to check delivery later.
statusstringqueued (going out now), scheduled, or held_for_review if the message contains restricted words and needs a quick check by our team.
recipientsintegerNumbers the message will be sent to, after cleaning.
credits_used / credits_leftintegerCredits taken for this request, and your balance afterwards.
encoding / sms_per_messagestring / integergsm7 fits 160 characters in one SMS; unicode (any emoji or special symbol) fits only 70, so the same text can cost 2 SMS. sms_per_message is how many SMS (credits) the longest message uses.
skippedobjectHow many numbers were left out: invalid, duplicates, opted_out and bad (numbers known not to work).
Possible errors
- 400
SENDER_NOT_FOUND,SENDER_NOT_APPROVED,NO_RECIPIENTS,MESSAGE_TOO_LONG,BAD_SCHEDULE - 401
UNAUTHORIZED - 402
INSUFFICIENT_CREDITS
Scheduling
Add schedule_at to a send request to deliver it later, for example a reminder the morning before an event. Credits are taken when you schedule, and the response status is scheduled.
- The time must be at least 5 minutes from now and no more than 90 days ahead.
- Ghana uses UTC all year, so
08:00Zis 8am in Ghana. - To cancel a scheduled message, open it under Campaigns in your dashboard and click Cancel campaign. All its credits are returned.
/sms/{campaign_id}Delivery status
Get a summary for a send request and the status of each number. Results come 1,000 numbers at a time. Add ?page=2 for the next 1,000.
Message statuses
| Status | Meaning |
|---|---|
queued | Waiting to be handed to the network. |
submitted / sent | Accepted by the network, waiting for the phone to confirm. |
delivered | The phone received the message. |
failed | Could not be delivered, for example the phone was off for too long or the number is no longer in use. See error. |
rejected | Not sent, for example because the campaign was cancelled. |
unknown | The network did not send a final report. Most of these were delivered. |
Delivery reports usually arrive within seconds, but can take a few hours if a phone is switched off. Check again later rather than every few seconds.
How OTP works
Use one-time codes to confirm that a phone number belongs to your user, for example at sign-up, login, password reset or before a payment. We create the code, send it by SMS on a priority route, and check it for you. You never handle or store the code yourself.
- Your server calls Send a code with the user's phone number and keeps the
otp_id. - The user receives an SMS like "Your verification code is 482913. It expires in 5 minutes." and types it into your app.
- Your server calls Verify a code with the
otp_idand what the user typed. Continue only ifverifiedistrue.
| Protection | Rule |
|---|---|
| Storage | Codes are stored scrambled (HMAC-SHA256). Nobody can read them, including us. |
| One use | A code works once. A new code to the same number cancels the old one. |
| Expiry | 5 minutes by default, 1 to 30 minutes if you choose. |
| Wrong tries | After 5 wrong tries the code is locked. |
| Sending limits | 30 seconds between codes to the same number, and at most 5 codes per number in 15 minutes. |
| Price | Each code uses OTP credits from your normal balance. Credits are returned if the code cannot be delivered. |
/otp/sendSend a code
Creates a new code and sends it straight away. Do not call this again for the same user until they ask for a new code.
Body parameters
phonestringrequiredThe user's Ghana number. Accepted formats.
senderstringoptionalYour approved sender ID registered for OTP. Networks only deliver codes from OTP sender IDs. Register one in your dashboard under Sender IDs with Use for OTP. If left out, we use your first OTP sender ID.
lengthintegeroptionalDigits in the code, 4 to 8. Default 6.
expiry_minutesintegeroptionalHow long the code works, 1 to 30. Default 5.
messagestringoptionalYour own wording. Must contain {code}; may contain {minutes}. Up to 2 SMS. Example: Your Kofi Shop code is {code}.
Possible errors
- 400
INVALID_PHONE,OTP_SENDER_REQUIRED,SENDER_NOT_OTP,SENDER_NOT_APPROVED,MESSAGE_NEEDS_CODE,BAD_LENGTH,BAD_EXPIRY - 402
INSUFFICIENT_CREDITS - 429
OTP_COOLDOWN(wait 30 seconds),OTP_RATE_LIMIT(too many codes to this number) - 502
OTP_SEND_FAILED(not delivered, credits returned, try again)
/otp/verifyVerify a code
Checks the code the user typed. The answer is always HTTP 200 with verified set to true or false, so your code only needs one check.
Body parameters
otp_idstringrequired*From the send response. *Or send phone instead to check the latest code sent to that number.
codestringrequiredWhat the user typed.
When verified is false
reason | Show your user |
|---|---|
invalid_code | "That code is not correct." (attempts_left tells you how many tries remain) |
expired | "Your code has expired. We have sent a new one." Then call send again. |
too_many_attempts | "Too many tries. Request a new code." |
already_used | The code was already verified once. |
replaced | A newer code was sent. Ask for the latest one. |
/otp/{otp_id}Code status
Shows whether a code is still waiting, verified, expired, replaced or failed, and how many tries are left. Useful for support screens. The code itself is never returned.
Webhooks: receiving events
Instead of asking the API for delivery status again and again, you can have us send events to your own server the moment they happen.
- In your dashboard, open Developers and click Add webhook.
- Enter your server address (it must start with
https://) and choose the events you want. - Copy the signing secret (it starts with
whsec_). It is shown only once. - Click Send test to check your server receives it.
Each event is a POST with a JSON body. Reply with any 2xx status within 10 seconds. If we do not get one, we try again after 1, 5, 30 and 120 minutes (5 tries in total). A webhook that fails 10 deliveries in a row is switched off and we email you.
Events can arrive more than once or out of order. Use X-EduFlex-Delivery (unique per delivery) to ignore repeats.
Event types
| Event | When |
|---|---|
message.delivered | A message reached the phone. |
message.failed | A message could not be delivered. |
campaign.completed | Every message in a send is finished. Includes totals. |
otp.verified | A user entered the right OTP code. |
Example body for message.delivered:
{
"event": "message.delivered",
"created_at": "2026-11-14T10:02:11Z",
"data": {
"message_id": "3f6c1b2e-8d4a-4c1f-9b7e-2a1d5c6e7f80",
"campaign_id": "6f1c2a8e-4b1d-4c7a-9e2f-1a2b3c4d5e6f",
"phone": "233241234567",
"network": "mtn",
"status": "delivered",
"error": null,
"parts": 1,
"delivered_at": "2026-11-14T10:02:09Z"
}
}campaign.completed data: campaign_id, sender, recipients, delivered, failed, credits_used, completed_at. otp.verified data: otp_id, phone, sender, verified_at.
Checking signatures
Every event has these headers: X-EduFlex-Event, X-EduFlex-Delivery, X-EduFlex-Timestamp and X-EduFlex-Signature. Work out an HMAC-SHA256 of timestamp + "." + raw body with your signing secret. It must match the signature after sha256=. Reject events whose timestamp is more than 5 minutes old.
// PHP
$body = file_get_contents('php://input');
$ts = $_SERVER['HTTP_X_EDUFLEX_TIMESTAMP'];
$expected = 'sha256=' . hash_hmac('sha256', $ts . '.' . $body, getenv('EDUFLEX_WEBHOOK_SECRET'));
if (!hash_equals($expected, $_SERVER['HTTP_X_EDUFLEX_SIGNATURE'] ?? '') || abs(time() - (int)$ts) > 300) {
http_response_code(401); exit;
}
$event = json_decode($body, true);
http_response_code(200);
# Python (Flask)
import hmac, hashlib, os, time
from flask import request, abort
ts = request.headers['X-EduFlex-Timestamp']
expected = 'sha256=' + hmac.new(os.environ['EDUFLEX_WEBHOOK_SECRET'].encode(), (ts + '.').encode() + request.get_data(), hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, request.headers.get('X-EduFlex-Signature', '')) or abs(time.time() - int(ts)) > 300:
abort(401)
event = request.get_json()Recurring sends
To send the same message on a schedule (for example every Monday at 8am), use Recurring messages in your dashboard. We send it for you on time, and each send appears in Campaigns with its delivery report.
If you prefer to keep the schedule in your own system, call POST /sms/send at the right time from your own scheduler (for example a cron job). For a one-off later send, use schedule_at.
/balanceBalance
Returns your SMS credits and wallet balance in Ghana cedis. Useful for showing your balance in your own system, or alerting your team before credits run out.
sms_creditsintegerCredits available for sending.
wallet_ghsnumberWallet money you can use to buy credits in your dashboard.
To buy credits, sign in to your dashboard and open Buy credits. You can pay with Mobile Money or card.
/sender-idsSender IDs
Lists the sender IDs on your account that are approved and ready to use in sender.
New sender IDs are requested in your dashboard under Sender IDs, where they are checked against our rules straight away. Read the Sender ID guidelines for names that get approved quickly.
Errors
Errors use standard HTTP status codes and a code you can check in your program. The message is written so you can show it to your own users. A request that fails is never charged.
| HTTP | Code | What to do |
|---|---|---|
| 400 | SENDER_REQUIRED | Add sender to the request. |
| 400 | SENDER_NOT_FOUND | Check the spelling of your sender ID, or list your sender IDs. |
| 400 | SENDER_NOT_APPROVED | Wait for approval, or use another approved sender ID. |
| 400 | RECIPIENTS_REQUIRED | Add recipients with at least one number. |
| 400 | NO_RECIPIENTS | All numbers were invalid or opted out. Check the numbers. |
| 400 | TOO_MANY_RECIPIENTS | Split your list into requests of up to 50,000 numbers. |
| 400 | MESSAGE_REQUIRED / MESSAGE_TOO_LONG | Add a message, or shorten it to 6 SMS pages or less. |
| 400 | BAD_SCHEDULE | Use a time between 5 minutes and 90 days from now. |
| 400 | BAD_JSON | Send a valid JSON body. |
| 401 | UNAUTHORIZED | Check your API key, or create a new one if it was revoked. |
| 402 | INSUFFICIENT_CREDITS | Buy more credits in your dashboard. |
| 403 | ACCOUNT_SUSPENDED | Contact support. |
| 404 | NOT_FOUND | Check the address, or the campaign ID. |
| 429 | RATE_LIMITED | Slow down. See rate limits. |
| 400 | BAD_IDEMPOTENCY_KEY | The optional Idempotency-Key header must be 8 to 100 letters, numbers, dashes or underscores. Send the same key again to safely retry a send: you get the first result back and are not charged twice. |
| 409 | REQUEST_IN_PROGRESS / PREVIOUS_ATTEMPT_FAILED | A request with the same idempotency key is still running, or failed earlier. Wait, or use a new key. |
| 403 | SCOPE_NOT_ALLOWED | The API key is not allowed to use this endpoint. Each key can be limited to sending SMS, OTP, or reading, on the Developers page. |
| 429 | KEY_DAILY_LIMIT_REACHED | The API key reached the daily credit limit you set for it. Nothing was charged. |
| 429 | DAILY_LIMIT_REACHED | Your account hit its daily sending limit. Nothing was charged. It resets at midnight (Ghana time). Contact support for a higher limit. |
| 503 | SENDING_LIMIT_REACHED | Sending is temporarily limited across the platform. Nothing was charged. Try again later. |
| 500 | SERVER_ERROR | Something went wrong on our side. Try again in a moment. |
| 400 | INVALID_PHONE | The phone number is not a valid Ghana number. |
| 400 | MESSAGE_NEEDS_CODE | Your custom OTP message must contain {code}. |
| 400 | BAD_PURPOSE | Optional purpose (for example login, reset, withdrawal): up to 40 lower-case letters, numbers, dashes or underscores. A code sent with a purpose only verifies when /otp/verify sends the same purpose. |
| 400 | BAD_LENGTH / BAD_EXPIRY | Use a code length of 4 to 8 and an expiry of 1 to 30 minutes. |
| 429 | OTP_COOLDOWN | Wait 30 seconds before sending another code to the same number. |
| 429 | OTP_RATE_LIMIT | At most 5 codes per number in 15 minutes. Try again later. |
| 429 | OTP_DAILY_LIMIT | The number has received the most codes allowed in 24 hours (10 from your account, 20 in total). Try again tomorrow. |
| 502 | OTP_SEND_FAILED | The code could not be delivered. Credits were returned. Try again. |
| 503 | MAINTENANCE | Sending is briefly paused. Try again shortly. |
Rate limits
Each API key can make up to 120 requests per minute. Above that you get HTTP 429. Wait a few seconds and try again.
You rarely need many requests: one send request can carry up to 50,000 numbers. If you send to many people at once, put them in one request instead of one request per number.
Best practices
Call the API from your backend, never from browser JavaScript or an app. Use one key per system so you can revoke one without affecting the others.
Put many numbers in one request instead of looping one number at a time.
If a request times out, check your recent campaigns in the dashboard before sending again so people do not get the message twice.
Send promotional messages between 8am and 8pm. Use schedule_at for early-morning reminders.
Add people who ask to stop to your opt-out list in the dashboard. They are skipped automatically.
Networks may block some words in promotional messages. Read our Acceptable use policy.
Voice Coming soon
We are adding voice messages for people who prefer to listen. They will use the same API keys and credits. This page will be updated when voice is ready.
Changelog
Send SMS, scheduling, delivery status, balance and sender IDs.
