Quickstart
Send your first message in about five minutes.
1. Get your credentials
In the dashboard, go to API keys and create a key. Start with a Test key — it exercises the full pipeline without sending to a handset or charging you.
You will be shown the secret exactly once. It is hashed at rest and cannot be recovered; if you lose it, revoke the key and create another.
JKASMS_ORG_ID=ORG_XXXXXXXXXXXX
JKASMS_SECRET_KEY=sk_test_xxxxxxxxxxxxxxxxxxxxxxxx
JKASMS_WEBHOOK_SECRET=whsec_xxxxxxxxxxxxxxxxxxxxxxxx2. Register a sender ID
The sender ID is the name recipients see instead of a phone number. Go to Sender IDs and request one — up to 11 characters, and subject to network approval, which usually takes 1–2 business days.
3. Check what it will cost
Optional, but worth doing once so you understand how segments are counted. This charges nothing.
curl -X POST https://api.jkasms.com/api/v1/sms/quote \
-H "Authorization: Bearer $JKASMS_SECRET_KEY" \
-H "X-JKASMS-Org-Id: $JKASMS_ORG_ID" \
-H "Content-Type: application/json" \
-d '{
"message": "Your order is on the way.",
"recipients": ["0241234567", "0551234567"]
}'{
"success": true,
"data": {
"recipients": 2,
"invalid_recipients": 0,
"duplicates_removed": 0,
"segments_per_message": 1,
"total_segments": 2,
"encoding": "GSM7",
"total_cost": "0.12",
"balance_after": "99.88",
"sufficient_balance": true,
"currency": "GHS",
"paid_with": "credits",
"credits_required": 2,
"credits_available": 4814,
"credits_after": 4812
}
}4. Send
curl -X POST https://api.jkasms.com/api/v1/sms/send \
-H "Authorization: Bearer $JKASMS_SECRET_KEY" \
-H "X-JKASMS-Org-Id: $JKASMS_ORG_ID" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-4471-confirmation" \
-d '{
"sender": "JKASMS",
"message": "Your order is on the way.",
"recipients": ["0241234567"]
}'const res = await fetch("https://api.jkasms.com/api/v1/sms/send", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.JKASMS_SECRET_KEY}`,
"X-JKASMS-Org-Id": process.env.JKASMS_ORG_ID,
"Content-Type": "application/json",
// Safe to retry: the same key returns the original result
// instead of sending a second time.
"Idempotency-Key": `order-${orderId}-confirmation`,
},
body: JSON.stringify({
sender: "JKASMS",
message: "Your order is on the way.",
recipients: ["0241234567"],
}),
});
const { data } = await res.json();
console.log(data.messages[0].message_id);import os, requests
res = requests.post(
"https://api.jkasms.com/api/v1/sms/send",
headers={
"Authorization": f"Bearer {os.environ['JKASMS_SECRET_KEY']}",
"X-JKASMS-Org-Id": os.environ["JKASMS_ORG_ID"],
"Idempotency-Key": f"order-{order_id}-confirmation",
},
json={
"sender": "JKASMS",
"message": "Your order is on the way.",
"recipients": ["0241234567"],
},
timeout=20,
)
data = res.json()["data"]
print(data["messages"][0]["message_id"])<?php
$ch = curl_init("https://api.jkasms.com/api/v1/sms/send");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("JKASMS_SECRET_KEY"),
"X-JKASMS-Org-Id: " . getenv("JKASMS_ORG_ID"),
"Content-Type: application/json",
"Idempotency-Key: order-{$orderId}-confirmation",
],
CURLOPT_POSTFIELDS => json_encode([
"sender" => "JKASMS",
"message" => "Your order is on the way.",
"recipients" => ["0241234567"],
]),
]);
$response = json_decode(curl_exec($ch), true);
echo $response["data"]["messages"][0]["message_id"];5. Receive the delivery receipt
The send returns 202 Accepted — the message is queued, not yet delivered. Set a notification URL in Settings and we will POST a signed update when the message reaches its final state.
Verify the signature before trusting the payload.
Next
- How segments are counted — and why a curly apostrophe can double your bill
- Send and verify one-time codes
- Test mode, including the magic numbers that force a given outcome