Kenya SMS API Architecture: Safaricom M-Pesa Verification, CAK Regulations, and Bulk Sender IDs
Kenya's SMS market is gated by a single document and a single commercial rule. Get the Letter of Authorization right and register separate sender IDs for transactional and promotional traffic, and the market opens at $0.0120 per message. Get either wrong and you deliver to half the country without knowing it.
An agritech platform launched its Kenyan payments feature with a promise that mattered: every farmer who sold produce through the app would receive an M-Pesa confirmation within a minute. The payments worked flawlessly. The confirmation messages did not. Settlement records showed money arriving in farmer accounts while the app showed pending transactions, and by the end of the first week the support line was handling reconciliation disputes rather than growth questions.
The failure was not in the payment rail. It was in the assumption that one sender ID could carry both the payment confirmation and the weekly produce-price newsletter the marketing team had scheduled. On Safaricom, a sender ID registered for promotional traffic cannot be used for transactional traffic at the same time, and the reverse holds too. The platform had registered one identity, used it for both, and lost the transactional leg.
Kenya rewards operators who understand two specific constraints: the commercial rule that separates promotional from transactional sender identities, and the documentary process that gates registration in the first place. This guide covers both, along with the M-Pesa verification architecture that makes the SMS leg load-bearing, the Data Protection Act obligations that apply to the numbers you hold, and the MCC 639 telemetry for Safaricom and Airtel.
What does Kenya require before you can send SMS?
Kenya requires sender ID registration before you can send, and registration is gated by a Letter of Authorization. The LOA must be issued on company letterhead, dated, carry the company name, the company and representative details, the sender details you want registered, and the representative's name, designation and signature with the company stamp. A sender name must be linked to the company or individual and match the initials on an identity document, or you must supply a trademark certificate; special characters are forbidden and generic sender names are not permitted. On Safaricom the same sender ID cannot be used for both promotional and transactional traffic, so separate IDs are required, and a sender ID cannot be registered with multiple service providers simultaneously — it must be deregistered by the previous aggregator before a new one can register it. International senders additionally provide a Certificate of Incorporation, a use case description, the company name and the company website, and political senders are not accepted on international traffic.
That answer contains the two facts that decide most Kenyan launches. The first is that registration is documentary, not technical: an LOA with a missing stamp or a sender name that does not match an identity document will stall, and no amount of routing quality compensates for an unregistered identity. The second is that the promotional and transactional split is not a naming convention. It is a hard commercial rule, and violating it produces exactly the failure the agritech platform experienced.
The Letter of Authorization: the document that gates the Kenyan market
The LOA exists because the operator is accepting liability for a name it cannot bill and cannot attribute to a subscriber. An alphanumeric sender ID is a claim about who is speaking, and the operator's only defence against a fraudulent claim is a signed document that ties the identity to a legal person. That is why the process is bureaucratic: the bureaucracy is the control.
The template is prescriptive, and the prescription is the part teams get wrong. Fields are pre-filled with instructions; you replace the highlighted fields with your own information and leave the rest untouched. Company letterhead and footer are required. The date must be the date the LOA was completed. The company and representative details go in one table and the sender details in another, followed by the representative's name, designation and signature with the company stamp.
| Requirement | Detail | Common rejection cause |
|---|---|---|
| Company letterhead | The LOA must be printed on the company's letterhead with its footer | Submitting a plain document with the logo typed into the header |
| Sender name link | Name must connect to the company or individual and match ID initials | A brand name that appears on no document and no trademark register |
| Character set | Special characters are forbidden | An ampersand, dot or dash introduced by a marketing brand guideline |
| Generic names | Not permitted unless they represent a company or product | Requesting something like ALERTS or NOTIFY as the sender identity |
| Trademark certificate | Required when the name does not match identity document initials | Assuming the certificate is optional and discovering it is not |
| Registration exclusivity | A sender ID cannot sit with two service providers at once | Switching aggregators without asking the previous one to deregister |
| International senders | Certificate of Incorporation, use case, company name and website | Omitting the website, which is used as a legitimacy signal |
| Restricted categories | Political senders are not accepted on international traffic; betting and lottery senders need a BCLB licence and a CSP licence | Applying without the sector licence and stalling at review |
Requirements vary by operator and by sender type. Confirm the current template with your aggregator before submitting, because a rejected LOA resets the clock.
The exclusivity rule deserves emphasis because it is the one that surprises teams migrating providers. If your sender ID is currently registered with another aggregator, the new one cannot register it until the old one has deregistered it with the operator. That is a two-party process with human steps on both sides, and it means a provider migration is a project rather than a configuration change.
The Safaricom transactional and promotional split
Safaricom's rule is short and it is enforced: the same sender ID cannot be used for promotional and transactional messages at the same time. Two identities are required, and the assignment is made at registration. This is the constraint that broke the agritech platform, and it is the single most common architectural mistake in the Kenyan market.
| Dimension | Transactional sender ID | Promotional sender ID |
|---|---|---|
| Traffic carried | OTP, payment confirmations, service alerts | Marketing, newsletters, price updates, offers |
| Consent basis | Relationship or contract with the recipient | Explicit opt-in with a working opt-out |
| Sending window | Any time | Restricted to reasonable hours |
| Can it be shared? | No | No |
| Failure if confused | Transactional delivery collapses on the network | Promotional messages filtered as spam and complaints rise |
Two identities means two LOAs, two registration timelines and two entries in your configuration. Budget for both in the project plan rather than treating the second as an afterthought.
The sending-window difference is worth stating explicitly because it is a design decision as much as a compliance one. Transactional traffic is expected at any hour, because a payment confirmation at two in the morning is legitimate. Promotional traffic at two in the morning is not, and the practical policy is to restrict promotional delivery to the daytime window — roughly 08:00 to 20:00 East Africa Time — so that quiet hours between 20:00 and 07:00 carry only transactional messages.
Enforcing that window in the application layer, in the recipient's local time, is not merely courteous. It is the mechanism that keeps complaint rates low, and complaint rates are what the Communications Authority of Kenya's consumer protection framework and the operators' own fair-use terms respond to. A sender who respects the window is a sender whose traffic is treated as legitimate.
M-Pesa verification: why the SMS leg is load-bearing
Mobile money is the reason Kenyan SMS volumes are dominated by transactional traffic, and it is also the reason a failed SMS is a financial event rather than a marketing inconvenience. When a farmer sells produce, the money moves on the M-Pesa rail and the confirmation arrives on the SMS rail. If the second leg fails, the first leg still completed, and the platform is left holding a reconciliation problem it cannot solve by retrying the payment.
That asymmetry defines the architecture. Payment and notification are two independent systems with two independent failure modes, and they must be reconciled rather than assumed to agree. The correct design treats the SMS as an outbox item with its own durable state, retries it on its own schedule, and escalates to a different channel when it cannot be delivered — rather than treating it as a fire-and-forget side effect of a successful transaction.
| Event | Payment rail | SMS rail | Reconciliation action |
|---|---|---|---|
| Settlement confirmed | Complete | Enqueue confirmation | Record the M-Pesa reference against the outbox item |
| SMS delivered | Complete | Handset DLR | Close the loop; no user action required |
| SMS not delivered | Complete | No DLR | Retry once, then surface the reference in-app and alert support |
| Duplicate confirmation | Complete | Re-sent | Suppress by idempotency key, not by timestamp comparison |
The fourth row is where naive retry logic creates its own incident. Idempotency keys derived from the payment reference make a duplicate send impossible rather than merely unlikely.
There is a second-order consequence for the sender ID decision. Because M-Pesa confirmations are transactional by nature, they belong on the transactional identity, and because they are the most valuable messages you send, they must never share an identity with a promotional campaign. The agritech platform's single identity meant a marketing schedule could degrade the delivery of payment confirmations — a coupling that is easy to create and expensive to unwind once a campaign calendar exists.
Data Protection Act 2019: consent, opt-out and the quiet-hours policy
Kenya's Data Protection Act of 2019 governs the processing of personal data, and a mobile number held to send messages is personal data. The regulator is the Office of the Data Protection Commissioner. The provisions that matter most for an SMS sender are the ones covering consent, purpose and direct marketing.
| Obligation | What it means for SMS | Implementation |
|---|---|---|
| Lawful basis | Consent, contract or another recognised basis must cover the processing | Record the basis alongside every number at capture time |
| Direct marketing | Marketing requires consent or an existing customer relationship, with an opt-out on every contact | Include the opt-out in the body; never rely on a settings page |
| Purpose limitation | Data collected for one purpose may not be silently repurposed | Separate consent records for transactional and marketing use |
| Data subject rights | Access, correction and deletion must be servable | A request channel with a tracked response time |
| Quiet hours | Not a statutory clock, but operator terms and consumer protection expectations both point to restraint outside daytime hours | Enforce 08:00–20:00 EAT for promotional sends; allow transactional at any hour |
This is an engineering summary rather than legal advice. Confirm your obligations with counsel before a promotional campaign to Kenyan numbers.
The quiet-hours row is deliberately framed as policy rather than statute, because that is what it is. There is no single published Kenyan clock that says promotional SMS must stop at eight in the evening. But there is a consumer protection expectation, there are operators with fair-use terms, and there is the plain fact that a promotional message delivered at 02:00 generates complaints — and complaints are the currency of every filtering decision an operator makes about your sender identity. Enforcing the window costs nothing and protects everything.
Kenya route telemetry: MCC 639
| Mobile network | MCC-MNC | Base rate | Expected transactional latency |
|---|---|---|---|
| Safaricom | 639-02 | $0.0120 / msg | 1.7 – 2.9 s P95 |
| Airtel Kenya | 639-03 | $0.0120 / msg | 2.1 – 3.6 s P95 |
| Telkom Kenya and other operators | 639-07 / 639-05 | $0.0120 / msg | 2.9 – 5.1 s P95 |
Rates are SMSRoute wholesale base rates per single-segment GSM-7 message. Latency windows are observed P95 handset-confirmed delivery with a registered transactional sender ID.
Safaricom's share of Kenyan mobile subscriptions makes it the network that defines your overall delivery rate, and its comparatively tight P95 reflects a short signalling path and a mature interconnect. Airtel is a genuine second network with a meaningful subscriber base, and the smaller operators matter less for volume but should still be routed so that no subscriber is unreachable.
One cost note that does not appear in the rate: Kenyan telecom services carry an excise duty that sits inside the retail pricing of airtime and telecom services, and it is embedded in wholesale arrangements in ways that vary between providers. That is a reason to compare total cost of ownership across providers rather than a headline rate per message, particularly at volumes where a percentage difference is material.
Sending M-Pesa confirmation SMS in Kenya: payload and outbox pattern
curl -X POST https://api.sendsmsnokyc.com/sms/send \
-H "Authorization: Bearer sr_live_sample_key" \
-H "Content-Type: application/json" \
-d '{
"to": "+254712345678",
"sender_id": "PAYCONFIRM",
"message": "Confirmed: KES 4,250.00 received. M-Pesa ref QK71B2X9. Thank you.",
"use_case": "transactional_payment_confirmation",
"network_hint": "639-02",
"idempotency_key": "mpesa:QK71B2X9"
}'
The idempotency key is derived from the M-Pesa transaction reference rather than from a timestamp, which makes a duplicate confirmation structurally impossible. That single design choice is what allows the outbox worker below to retry aggressively without any risk of double-notifying a customer.
const KE_MCC = "639";
const QUIET_START = 20; // 20:00 EAT
const QUIET_END = 7; // 07:00 EAT
// Kenyan MSISDN: country code 254, then 7 or 1, then 8 digits.
const toKenyanE164 = (raw) => {
const digits = raw.replace(/\D/g, "");
const local = digits.startsWith("254") ? digits.slice(3) : digits.replace(/^0/, "");
if (!/^[71]\d{8}$/.test(local)) throw new Error("not a Kenyan MSISDN");
return `+254${local}`;
};
const isQuietHour = (date) => {
const hour = Number(
new Intl.DateTimeFormat("en-GB", {
timeZone: "Africa/Nairobi",
hour: "2-digit",
hour12: false,
}).format(date),
);
return hour >= QUIET_START || hour < QUIET_END;
};
// Transactional confirmations ignore quiet hours; promotions respect them.
export async function deliver(item) {
const to = toKenyanE164(item.msisdn);
if (item.kind === "promotional" && isQuietHour(new Date())) {
return deferUntilMorning(item); // re-queued, not dropped
}
const res = await fetch("https://api.sendsmsnokyc.com/sms/send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.SMSROUTE_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
to,
sender_id:
item.kind === "promotional"
? process.env.KE_PROMO_SENDER_ID // separate Safaricom registration
: process.env.KE_TXN_SENDER_ID,
message: item.body,
use_case:
item.kind === "promotional"
? "promotional_marketing"
: "transactional_payment_confirmation",
network_hint: `${KE_MCC}-02`,
idempotency_key: item.idempotencyKey, // mpesa:<reference>
}),
});
return res.json();
}
Note the shape of the quiet-hours handling: a promotional item that lands inside the window is deferred, not discarded, and a transactional item is never deferred at all. That distinction is the entire policy expressed in a few lines of code, and it is far more reliable than a human remembering not to schedule a campaign at midnight.
The Kenya launch checklist
| Check | Failure it prevents |
|---|---|
| LOA issued on letterhead, stamped and signed | A registration rejected on a formatting technicality |
| Sender name matches ID initials or a trademark certificate | Rejection because the brand name appears on no official document |
| Separate Safaricom identities for transactional and promotional | Payment confirmations collapsing after a campaign ran |
| Previous aggregator has deregistered any migrated ID | An indefinite block on a sender ID you already own |
| Quiet-hours policy enforced in EAT for promotional sends | Night-time complaints that raise your filter risk |
| Outbox state persisted separately from the payment record | Reconciliation disputes that no retry can resolve |
| Idempotency key derived from the M-Pesa reference | Duplicate confirmations after a worker restart |
| Data Protection Act basis and opt-out recorded | A complaint under the 2019 Act |
| Handset-confirmed DLR alerting for the payment flow | A silent notification failure discovered by customers |
Frequently asked questions
Why can't I use one sender ID for OTP and marketing in Kenya?
Because Safaricom requires separate registrations for promotional and transactional traffic, and a single sender ID cannot carry both at the same time. The rule exists so that the operator can apply the right consent, filtering and scheduling policy to each category. In practice it means two LOAs, two registration timelines, and two configuration values in your application.
What is a Letter of Authorization and do I really need one?
It is the signed document in which your company authorises the registration of a sender ID and takes responsibility for the identity. It is mandatory for alphanumeric registration, and it must be on company letterhead, dated, signed and stamped, with the sender name traceable to your company or to a trademark you hold. Without it the identity cannot be registered and the traffic cannot be delivered.
How do I migrate a sender ID from another aggregator?
Ask the previous aggregator to deregister the sender ID with the operator first. A sender ID cannot be registered with two service providers simultaneously, so the new registration will stall until the old one is released. Plan the migration as a project with two parties rather than as a switch you can flip.
Are there quiet hours for SMS in Kenya?
There is no single published statutory clock, but operator fair-use terms and consumer protection expectations both point to restraint outside daytime hours. The defensible policy is to restrict promotional delivery to roughly 08:00 to 20:00 East Africa Time and to allow transactional messages at any hour. Enforce it in code, in Nairobi time, so a scheduled campaign cannot violate it.
Why do M-Pesa confirmations fail when the payment succeeded?
Because the payment rail and the SMS rail are independent systems. A successful settlement does not guarantee a successful notification, and the SMS can fail on the sender ID, the content or the interconnect. Treat the confirmation as an outbox item with its own durable state, retry it on its own schedule, and reconcile the two rails by transaction reference rather than assuming they agree.
Can I send bulk promotional SMS in Kenya?
Yes, from a sender ID registered for promotional traffic, to recipients with a recorded opt-in, with an opt-out in every body, and inside the daytime window. Read the bulk campaign architecture guide for the queueing and pacing design that keeps a large send inside operator tolerances.
The bottom line for Kenya
Kenya is a market where two decisions determine almost everything. The first is documentary: a correct Letter of Authorization, on letterhead, stamped, with a sender name that traces to your company or your trademark. The second is architectural: separate sender identities for transactional and promotional traffic, so that a campaign calendar can never degrade the payment confirmations your customers depend on.
Handle both and Kenya delivers reliably at $0.0120 per message, on an interconnect that produces one of the tightest P95 windows in the region. Handle neither and you join the list of operators who spent a launch week reconciling payments that had already succeeded. Start with the Kenya destination page for current rates, or read the emerging-markets latency guide for the signalling mechanics behind the delivery windows above.
Jacky Hossein
Verified AuthorPrincipal Telecommunications & Cryptographic Systems Architect at SMSRoute. Specializes in carrier-grade SS7/SMPP routing protocols, non-custodial cryptocurrency billing rails, and zero-knowledge telecommunications privacy.
Send Global SMS in Under 60 Seconds Without KYC
Sign up with email only. Top up with Bitcoin, USDT, Monero, or Ethereum. Instant carrier interconnects to 149 countries from $0.004/msg.