Developers

A small API you can read in one sitting.

Everything the dashboard does, your software can do with one key: send texts, place calls, deliver and verify codes, read balances. Full reference, your keys and live examples live in the dashboard once you sign up; this page is the map.

Basics

Auth, base URL, errors.

Keys are created in the dashboard under Developers, with the permissions you choose: send SMS, send voice, OTP, read balance. Revoke one at any time.

  • Base URL https://sms-api.sankofa.dev/v1
  • Header Authorization: Bearer sk_live_…
  • Phone numbers as digits in international form: 233241234567. A leading + is fine.
  • Errors are JSON with an error sentence. 401 bad key, 403 missing permission, 409 your request was understood but cannot be done (such as an insufficient balance), 429 slow down.
balance
GET /v1/balance
Authorization: Bearer sk_live_…
→ {
→ "balance": "1240", "currency": "SMS credits",
→ "voiceSeconds": 7505, "voiceDisplay": "2h 5m 5s",
→ "voiceCurrency": "voice seconds"
→ }

SMS

Send a text.

Up to 500 numbers per request. The response lists every recipient and the credits charged. Failed numbers are refunded automatically.

POST /sms/send

sender_id, phone[], message. The response lists each recipient with its status.

GET /messages

Your message log with per-recipient status. Filter by channel, status and date.

GET /messages/{id}

One message with every recipient, its status and the network reference.

send
POST /v1/sms/send
{
"sender_id": "SANKOFA",
"phone": ["233241234567", "233201234567"],
"message": "Fees for Term 2 are due Friday. Pay by MoMo to 024…"
}
→ {
→ "id": "6f1c…", "status": "sent", "channel": "sms",
→ "encoding": "gsm7", "segments": 1,
→ "recipients": [
→ { "phone": "233241234567", "status": "processed" },
→ { "phone": "233201234567", "status": "processed" }
→ ],
→ "cost": { "per_segment": "1.000000", "total": "2",
→ "currency": "SMS credits" }
→ }

OTP

Deliver and verify a code.

Two endpoints. We generate, hash and expire the code; you only ever pass the phone number and, later, what the user typed.

POST /otp/send

phone; channel sms (default), whatsapp or voice. Optional sender_id, template with {code}, ttl in seconds (60–1800), length (4–8), or code to deliver your own.

POST /otp/verify

phone, code. Returns verified true or false; five wrong tries void the code.

otp
POST /v1/otp/send
{ "phone": "233241234567", "channel": "voice" }
→ {
→ "id": "0b7a…", "phone": "233241234567", "channel": "voice",
→ "status": "sent", "expires_in": 300,
→ "cost": { "seconds_per_call": 15, "calls": 1, "total_seconds": 15,
→ "total": "15s", "currency": "voice seconds" }
→ }
POST /v1/otp/verify
{ "phone": "233241234567", "code": "482913" }
→ { "verified": true }

Voice

Call a list with a recording.

Upload an MP3 once, then send it to any set of numbers. Ask for a quote first if you want to show the cost to a user.

POST /voice/audio

multipart upload: audio (MP3, up to 5 MB), name. Returns the id and measured seconds.

GET /voice/quote

?audio_id=…&recipients=N → seconds per call and the total that would be charged.

POST /voice/send

audio_id, phone[] or group_ids[]. Up to 500 numbers. Charged at the quoted cap when placed.

GET /messages/{id}

Each call's outcome (connected, not answered) and the seconds the carrier billed, within minutes.

voice
POST /v1/voice/audio (multipart: audio=@notice.mp3, name="Term notice")
→ { "audio": { "id": "a1f3…", "name": "Term notice", "seconds": 38, "duration": "38s" },
→ "seconds_per_call": 40 }
GET /v1/voice/quote?audio_id=a1f3…&recipients=1180
→ { "seconds_per_call": 40, "calls": 1180, "total_seconds": 47200,
→ "total": "13h 6m 40s", "balance_seconds": 54000, "balance": "15h 0m 0s" }
POST /v1/voice/send
{ "audio_id": "a1f3…", "group_ids": ["parents-2026"] }
→ { "id": "9c2e…", "status": "sent", "channel": "voice",
→ "cost": { "seconds_per_call": 40, "calls": 1180, "total_seconds": 47200,
→ "total": "13h 6m 40s", "currency": "voice seconds" } }

Full reference lives next to your keys

Every field, every status, every error, with your own key filled in.

The dashboard's Developers page holds the complete reference, example requests you can copy with your key already in place, and the log of every API call your software has made.

Ship it this week.

A key takes a minute to create. The first request takes less.