Quick start
Create an account
Sign up free with your name, email and phone number, then top up from GH₵10.
Get your API token
In your dashboard, open Developers and generate your API token.
Get a Sender ID
Request the name your messages come from. Read the Sender ID guide.
Send your first SMS
Replace the token and number below and run it.
curl -X POST "https://app.nkomosms.com/api/v3/sms/send" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"recipient": "233552690110",
"sender_id": "YourBrand",
"type": "plain",
"message": "Hello from Nkomo SMS"
}'<?php
$ch = curl_init('https://app.nkomosms.com/api/v3/sms/send');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Content-Type: application/json',
'Accept: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'recipient' => '233552690110',
'sender_id' => 'YourBrand',
'type' => 'plain',
'message' => 'Hello from Nkomo SMS',
]),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);
if (($response['status'] ?? '') === 'success') {
print_r($response['data']);
} else {
echo $response['message'] ?? 'Request failed';
}// Node.js 18 or newer (fetch is built in)
const res = await fetch('https://app.nkomosms.com/api/v3/sms/send', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json',
Accept: 'application/json',
},
body: JSON.stringify({
"recipient": "233552690110",
"sender_id": "YourBrand",
"type": "plain",
"message": "Hello from Nkomo SMS"
}),
});
const result = await res.json();
if (result.status === 'success') {
console.log(result.data);
} else {
console.error(result.message);
}import requests
response = requests.post(
"https://app.nkomosms.com/api/v3/sms/send",
headers={"Authorization": "Bearer YOUR_API_TOKEN", "Accept": "application/json"},
json={
"recipient": "233552690110",
"sender_id": "YourBrand",
"type": "plain",
"message": "Hello from Nkomo SMS"
},
timeout=30,
)
result = response.json()
if result["status"] == "success":
print(result["data"])
else:
print(result["message"])Authentication
Every request needs your API token. Send it in the Authorization header as a Bearer token, and ask for JSON with the Accept header.
Headers
| Parameter | Required | Description |
|---|---|---|
Authorizationheader | Required | Bearer YOUR_API_TOKEN |
Acceptheader | Required | application/json |
Content-Typeheader | Optional | application/json when you send a request body. |
If your system cannot set headers, use the HTTP API, which takes the token as an api_token field instead.
Phone numbers and message length
Write numbers in international format without + or spaces: 233552690110, not 055 269 0110. You can send to MTN, Telecel and AirtelTigo numbers.
One SMS holds 160 standard characters. Longer messages are split into parts of 153 characters, and each part uses one unit. Messages with emoji or special characters hold 70 characters, or 67 per part.
Responses and errors
Every response is JSON with a status field. Check it before you use data.
{
"status": "success",
"data": "…"
}{
"status": "error",
"message": "A human-readable description of the error."
}Common reasons for an error
| Problem | What to do |
|---|---|
| Missing or wrong API token | Check the Authorization header, or generate a new token in Developers. |
| Not enough SMS units | Top up your account, or check your balance first with the balance endpoint. |
| Sender ID not approved | Use a Sender ID that shows as active in your dashboard. |
| Invalid phone number | Use international format without +, for example 233552690110. |
| A required field is missing | Compare your request with the parameter table for that endpoint. The message field tells you which one. |
API reference
SMS API
Send SMS to one or many numbers, schedule messages and check delivery.
OTP API
Send a 6-digit code and verify it. We generate and check the code for you.
Voice API
Have a text message read out as a voice call.
Contacts API
Create contact groups and add, update or remove contacts.
Balance and profile
Check your SMS units and account details before you send.
HTTP API
Put the token in the request instead of a header, for systems that cannot set headers.
Need help with your integration?
Message us on WhatsApp, call +233 55 269 0110 or email support@nkomosms.com. Send us the request you made and the response you got, but never your API token.