Integrate powerful bulk SMS capabilities into your applications with our simple, RESTful API. Send messages, track delivery, and manage your account programmatically.
Base URL: https://sms.macrasms.com/api/v1/
/api/v1/.
This API allows you to send single or bulk SMS messages using your Macra SMS account. Authentication is done via sender_id and api_key passed in the JSON body.
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
sender_id |
string | Yes | Your approved Sender ID | "MACRASMS" |
api_key |
string | Yes | Your API key from the dashboard | "6bd654a1ed437c7d0d60a48c2d3b4911de..." |
message_text |
string | Yes | The message content (max 1600 characters) | "Your order #123 has shipped!" |
recipients |
string | Yes | Comma-separated phone numbers (will be normalized to +254... format) | "+254712345678,0712345678,254723456789" |
scheduled_at |
string | No | Optional scheduled time (MySQL format: YYYY-MM-DD HH:MM:SS) | "2026-03-01 14:30:00" |
{
"sender_id": "MACRASMS",
"api_key": "6bd654a1ed437c7d0d60a48c2d3b4911de685cfad68aff35a531b3f7491835fa",
"message_text": "Hello! Your verification code is 48291.",
"recipients": "+254712345678,0712345678",
"scheduled_at": "2026-02-15 10:00:00"
}
The API always returns HTTP 200 OK with JSON content.
{
"success": true,
"message_ids": [1456, 1457],
"credits_used": 2,
"recipients_count": 2,
"new_balance": 1247,
"message_length": 68,
"credits_per_message": 1,
"transaction_id": 8923
}
{
"success": false,
"error": "Invalid sender_id or api_key"
}
ceil(message_length / 160) credits per recipient+254... format<?php
$payload = [
'sender_id' => 'MACRASMS',
'api_key' => 'your-api-key-here',
'message_text' => 'Test message from PHP',
'recipients' => '+254712345678,0712345678'
];
$ch = curl_init('https://sms.macrasms.com/api/v1/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
if ($data['success'] ?? false) {
echo "Success! Sent to {$data['recipients_count']} recipients.\n";
} else {
echo "Error: " . ($data['error'] ?? 'Unknown') . "\n";
}
?>
import requests
payload = {
"sender_id": "MACRASMS",
"api_key": "your-api-key-here",
"message_text": "Hello from Python!",
"recipients": "+254712345678,0712345678"
}
response = requests.post(
"https://sms.macrasms.com/api/v1/",
json=payload
)
data = response.json()
if data.get("success"):
print(f"Success → {data['recipients_count']} sent")
else:
print(f"Failed: {data.get('error')}")
const payload = {
sender_id: "MACRASMS",
api_key: "your-api-key-here",
message_text: "Test from JS",
recipients: "+254712345678,+254723456789"
};
fetch("https://sms.macrasms.com/api/v1/", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(payload)
})
.then(res => res.json())
.then(data => {
if (data.success) {
console.log(`Sent to ${data.recipients_count} numbers`);
} else {
console.error("Error:", data.error);
}
})
.catch(err => console.error(err));