Going-live checklist
Your code works in the sandbox. Before the first real message, go through this list. Most of it takes minutes; the sender ID takes a few days, so ask for it early.
Your account
- Your business is verified and the account is active. The dashboard shows where you are.
GET /v1/accountwith any key showsreadiness.account_active. - A sender ID is approved, on every network you send to. Approval usually takes 4 to 5 days. See Sender IDs.
- Your balance is topped up with M-Pesa. Keep enough for a few days of sending, so a busy day doesn't stop you with
402.
Your live key
- Create a live key (
sk_live_...) in Developer, API keys. Live keys can be made once the account is active. - Only the scopes you need. A sending server needs
messages:send, andmessages:readif it checks statuses. - Allowed addresses set to your servers' IP addresses, if they're fixed.
- Stored as a secret: an environment variable or secret manager, never in code or a repository.
- Server-side only. Never in a web page or mobile app.
Your code
fromis your approved sender ID (its name orsnd_ID), notSANDBOX.- Marketing is sent as
promotional, only between 07:00 and 19:00 in Kenya, with room for the 14-character opt-out line. - Every
POSTsends anIdempotency-Key, and retries reuse it. See Idempotency. - Errors are handled by
code: at leastinsufficient_balance,message_too_long,unsupported_characters,opted_out,daily_limit_reachedandrate_limited. See Errors. 429,500and503are retried with a wait and the sameIdempotency-Key, and other4xxerrors are not.- Message IDs and references are stored, so you can find any message later.
request_idis logged on failures.
Your webhooks
- A live endpoint is added, separate from your test endpoint.
- Signatures are verified, with the 5-minute timestamp check, using the live endpoint's own secret. See Verify signatures.
- Your endpoint answers within 10 seconds and does slow work afterwards.
- Duplicate events are ignored, using the event
id.
The switch
- Put the live key where the test key was, in your production configuration only.
- Send one message to your own phone and check it arrives, from your sender ID.
- Check the
message.deliveredevent reached your live endpoint. GET /v1/accountwith the live key shows all fourreadinesschecks astrue.- Check Developer in the dashboard: you'll see the request in your key's log.
Then you're live. Each SMS in Kenya costs KES 0.80 on Safaricom, Airtel and Telkom.
Keep the sandbox
Keep your test key for development and automated tests. The two never mix: test keys can't send real messages and live keys can't see sandbox data.