Send an SMS
POST
/api/v3/sms/sendSends a text message to one or more numbers. You are charged one unit per SMS part for each number.
Body parameters
| Parameter | Required | Description |
|---|---|---|
recipientstring | Required | Phone number in international format without +, for example 233552690110. Separate several numbers with commas: 233552690110,233201234567. |
sender_idstring | Required | Your approved Sender ID, up to 11 characters. This is the name people see. How to get a Sender ID. |
typestring | Required | Use plain for a normal text message. |
messagestring | Required | The text of your message. |
schedule_timedatetime | Optional | Send later instead of now. Format Y-m-d H:i, for example 2026-12-24 08:00, in the time zone set on your account. |
Example request
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": "Your order #2041 has been dispatched."
}'<?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' => 'Your order #2041 has been dispatched.',
]),
]);
$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": "Your order #2041 has been dispatched."
}),
});
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": "Your order #2041 has been dispatched."
},
timeout=30,
)
result = response.json()
if result["status"] == "success":
print(result["data"])
else:
print(result["message"])Response
{
"status": "success",
"message": "Your message was successfully delivered",
"data": "…"
}Error response
{
"status": "error",
"message": "A human-readable description of the error."
}The response
data holds the message details, including its uid. Save the uid if you want to check the message later.Send to many numbers or schedule
POST
/api/v3/sms/sendPut several numbers in recipient, separated by commas. Add schedule_time to send at a set time.
Example request
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,233201234567",
"sender_id": "YourBrand",
"type": "plain",
"message": "Reminder: our PTA meeting is on Saturday at 9:00am.",
"schedule_time": "2026-12-05 07:00"
}'<?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,233201234567',
'sender_id' => 'YourBrand',
'type' => 'plain',
'message' => 'Reminder: our PTA meeting is on Saturday at 9:00am.',
'schedule_time' => '2026-12-05 07:00',
]),
]);
$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,233201234567",
"sender_id": "YourBrand",
"type": "plain",
"message": "Reminder: our PTA meeting is on Saturday at 9:00am.",
"schedule_time": "2026-12-05 07:00"
}),
});
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,233201234567",
"sender_id": "YourBrand",
"type": "plain",
"message": "Reminder: our PTA meeting is on Saturday at 9:00am.",
"schedule_time": "2026-12-05 07:00"
},
timeout=30,
)
result = response.json()
if result["status"] == "success":
print(result["data"])
else:
print(result["message"])Response
{
"status": "success",
"data": "…"
}Error response
{
"status": "error",
"message": "A human-readable description of the error."
}View an SMS
GET
/api/v3/sms/{uid}Returns one message you sent, including its delivery status.
Path parameters
| Parameter | Required | Description |
|---|---|---|
uidstring | Required | The message uid returned when the message was sent. |
Example request
curl -X GET "https://app.nkomosms.com/api/v3/sms/606812e63f78b" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"<?php
$ch = curl_init('https://app.nkomosms.com/api/v3/sms/606812e63f78b');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
],
]);
$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/606812e63f78b', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
},
});
const result = await res.json();
if (result.status === 'success') {
console.log(result.data);
} else {
console.error(result.message);
}import requests
response = requests.get(
"https://app.nkomosms.com/api/v3/sms/606812e63f78b",
headers={"Authorization": "Bearer YOUR_API_TOKEN", "Accept": "application/json"},
timeout=30,
)
result = response.json()
if result["status"] == "success":
print(result["data"])
else:
print(result["message"])Response
{
"status": "success",
"data": "…"
}Error response
{
"status": "error",
"message": "A human-readable description of the error."
}List your messages
GET
/api/v3/smsReturns the messages on your account, newest first, in pages.
Example request
curl -X GET "https://app.nkomosms.com/api/v3/sms" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Accept: application/json"<?php
$ch = curl_init('https://app.nkomosms.com/api/v3/sms');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_API_TOKEN',
'Accept: application/json',
],
]);
$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', {
method: 'GET',
headers: {
Authorization: 'Bearer YOUR_API_TOKEN',
Accept: 'application/json',
},
});
const result = await res.json();
if (result.status === 'success') {
console.log(result.data);
} else {
console.error(result.message);
}import requests
response = requests.get(
"https://app.nkomosms.com/api/v3/sms",
headers={"Authorization": "Bearer YOUR_API_TOKEN", "Accept": "application/json"},
timeout=30,
)
result = response.json()
if result["status"] == "success":
print(result["data"])
else:
print(result["message"])Response
{
"status": "success",
"data": "… messages with pagination"
}Error response
{
"status": "error",
"message": "A human-readable description of the error."
}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.