EduFlex Notify Docs
API version 1

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.

Before you start you need an EduFlex Notify account, SMS credits and an approved sender ID. All three take a few minutes from your dashboard. Create a free account.

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.

  1. Sign in and open Developers in your dashboard.
  2. Click Create API key and give it a name, for example "School portal".
  3. Copy the key straight away. It starts with efn_ and is shown only once.
Keep your key secret. Anyone with it can send SMS using your credits. Store it on your server (for example in an environment variable called 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/json to POST requests.
  • Every response has a status of "success" or "error". Successful responses put their result in data.
  • 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 sendWe useResult
0241234567233241234567Valid
241234567233241234567Valid
+233 24 123 4567233241234567Valid
024-123-4567233241234567Valid
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 used1 SMS pageEach page of a longer messageMaximum
Standard (A to Z, numbers, common punctuation)160153918 characters (6 pages)
Unicode (emojis, curly quotes, letters like ɛ and ɔ)7067402 characters (6 pages)
A single curly quote (’) 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 -.
POST/sms/send

Send 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

senderstringrequired

Your approved sender ID, for example EduFlex. Up to 11 letters or numbers.

recipientsarray of stringsrequired

Phone numbers to send to. A single comma-separated string also works. Accepted formats.

messagestringrequired

The text to send. Up to 6 SMS pages. How length is counted.

schedule_atstringoptional

Send later instead of now. ISO 8601 date and time, at least 5 minutes and at most 90 days ahead. Scheduling.

Response fields

campaign_idstring

Keep this to check delivery later.

statusstring

queued (going out now), scheduled, or held_for_review if the message contains restricted words and needs a quick check by our team.

recipientsinteger

Numbers the message will be sent to, after cleaning.

credits_used / credits_leftinteger

Credits taken for this request, and your balance afterwards.

encoding / sms_per_messagestring / integer

gsm7 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.

skippedobject

How many numbers were left out: invalid, duplicates, opted_out and bad (numbers known not to work).

Possible errors

  • 400SENDER_NOT_FOUND, SENDER_NOT_APPROVED, NO_RECIPIENTS, MESSAGE_TOO_LONG, BAD_SCHEDULE
  • 401UNAUTHORIZED
  • 402INSUFFICIENT_CREDITS
201Response

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:00Z is 8am in Ghana.
  • To cancel a scheduled message, open it under Campaigns in your dashboard and click Cancel campaign. All its credits are returned.
GET/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

StatusMeaning
queuedWaiting to be handed to the network.
submitted / sentAccepted by the network, waiting for the phone to confirm.
deliveredThe phone received the message.
failedCould not be delivered, for example the phone was off for too long or the number is no longer in use. See error.
rejectedNot sent, for example because the campaign was cancelled.
unknownThe 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.

200Response

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.

  1. Your server calls Send a code with the user's phone number and keeps the otp_id.
  2. The user receives an SMS like "Your verification code is 482913. It expires in 5 minutes." and types it into your app.
  3. Your server calls Verify a code with the otp_id and what the user typed. Continue only if verified is true.
ProtectionRule
StorageCodes are stored scrambled (HMAC-SHA256). Nobody can read them, including us.
One useA code works once. A new code to the same number cancels the old one.
Expiry5 minutes by default, 1 to 30 minutes if you choose.
Wrong triesAfter 5 wrong tries the code is locked.
Sending limits30 seconds between codes to the same number, and at most 5 codes per number in 15 minutes.
PriceEach code uses OTP credits from your normal balance. Credits are returned if the code cannot be delivered.
POST/otp/send

Send 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

phonestringrequired

The user's Ghana number. Accepted formats.

senderstringoptional

Your 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.

lengthintegeroptional

Digits in the code, 4 to 8. Default 6.

expiry_minutesintegeroptional

How long the code works, 1 to 30. Default 5.

messagestringoptional

Your own wording. Must contain {code}; may contain {minutes}. Up to 2 SMS. Example: Your Kofi Shop code is {code}.

Possible errors

  • 400INVALID_PHONE, OTP_SENDER_REQUIRED, SENDER_NOT_OTP, SENDER_NOT_APPROVED, MESSAGE_NEEDS_CODE, BAD_LENGTH, BAD_EXPIRY
  • 402INSUFFICIENT_CREDITS
  • 429OTP_COOLDOWN (wait 30 seconds), OTP_RATE_LIMIT (too many codes to this number)
  • 502OTP_SEND_FAILED (not delivered, credits returned, try again)
201Response
POST/otp/verify

Verify 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.

codestringrequired

What the user typed.

When verified is false

reasonShow 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_usedThe code was already verified once.
replacedA newer code was sent. Ask for the latest one.
200Response
GET/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.

200Response

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.

  1. In your dashboard, open Developers and click Add webhook.
  2. Enter your server address (it must start with https://) and choose the events you want.
  3. Copy the signing secret (it starts with whsec_). It is shown only once.
  4. 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

EventWhen
message.deliveredA message reached the phone.
message.failedA message could not be delivered.
campaign.completedEvery message in a send is finished. Includes totals.
otp.verifiedA 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.

GET/balance

Balance

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_creditsinteger

Credits available for sending.

wallet_ghsnumber

Wallet 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.

200Response
GET/sender-ids

Sender 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.

200Response

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.

HTTPCodeWhat to do
400SENDER_REQUIREDAdd sender to the request.
400SENDER_NOT_FOUNDCheck the spelling of your sender ID, or list your sender IDs.
400SENDER_NOT_APPROVEDWait for approval, or use another approved sender ID.
400RECIPIENTS_REQUIREDAdd recipients with at least one number.
400NO_RECIPIENTSAll numbers were invalid or opted out. Check the numbers.
400TOO_MANY_RECIPIENTSSplit your list into requests of up to 50,000 numbers.
400MESSAGE_REQUIRED / MESSAGE_TOO_LONGAdd a message, or shorten it to 6 SMS pages or less.
400BAD_SCHEDULEUse a time between 5 minutes and 90 days from now.
400BAD_JSONSend a valid JSON body.
401UNAUTHORIZEDCheck your API key, or create a new one if it was revoked.
402INSUFFICIENT_CREDITSBuy more credits in your dashboard.
403ACCOUNT_SUSPENDEDContact support.
404NOT_FOUNDCheck the address, or the campaign ID.
429RATE_LIMITEDSlow down. See rate limits.
400BAD_IDEMPOTENCY_KEYThe 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.
409REQUEST_IN_PROGRESS / PREVIOUS_ATTEMPT_FAILEDA request with the same idempotency key is still running, or failed earlier. Wait, or use a new key.
403SCOPE_NOT_ALLOWEDThe API key is not allowed to use this endpoint. Each key can be limited to sending SMS, OTP, or reading, on the Developers page.
429KEY_DAILY_LIMIT_REACHEDThe API key reached the daily credit limit you set for it. Nothing was charged.
429DAILY_LIMIT_REACHEDYour account hit its daily sending limit. Nothing was charged. It resets at midnight (Ghana time). Contact support for a higher limit.
503SENDING_LIMIT_REACHEDSending is temporarily limited across the platform. Nothing was charged. Try again later.
500SERVER_ERRORSomething went wrong on our side. Try again in a moment.
400INVALID_PHONEThe phone number is not a valid Ghana number.
400MESSAGE_NEEDS_CODEYour custom OTP message must contain {code}.
400BAD_PURPOSEOptional 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.
400BAD_LENGTH / BAD_EXPIRYUse a code length of 4 to 8 and an expiry of 1 to 30 minutes.
429OTP_COOLDOWNWait 30 seconds before sending another code to the same number.
429OTP_RATE_LIMITAt most 5 codes per number in 15 minutes. Try again later.
429OTP_DAILY_LIMITThe number has received the most codes allowed in 24 hours (10 from your account, 20 in total). Try again tomorrow.
502OTP_SEND_FAILEDThe code could not be delivered. Credits were returned. Try again.
503MAINTENANCESending 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

Keep keys on your server

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.

Send in batches

Put many numbers in one request instead of looping one number at a time.

Retry safely

If a request times out, check your recent campaigns in the dashboard before sending again so people do not get the message twice.

Respect quiet hours

Send promotional messages between 8am and 8pm. Use schedule_at for early-morning reminders.

Honour opt-outs

Add people who ask to stop to your opt-out list in the dashboard. They are skipped automatically.

Avoid blocked words

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

13 November 2026
Version 1 released

Send SMS, scheduling, delivery status, balance and sender IDs.