Authentication
Include your API key on every request:
Authorization: Bearer sk_live_xxxxxxxx
Key types
- Live keys (
sk_live_) — real WhatsApp delivery; instance must be connected. - Test keys (
sk_test_) — simulated responses for development.
Rate limits
120 requests per minute per API key. Response headers: X-RateLimit-Limit, X-RateLimit-Remaining.
Examples
JavaScript
const res = await fetch('https://whatsapp.s.co.tz/api/v1/messages/text', {
method: 'POST',
headers: {
Authorization: 'Bearer sk_live_xxx',
'Content-Type': 'application/json',
},
body: JSON.stringify({
instance_id: 'inst_xxx',
to: '+255712345678',
text: 'Hello',
}),
});
const json = await res.json();Python
import requests
r = requests.post(
'https://whatsapp.s.co.tz/api/v1/messages/text',
headers={'Authorization': 'Bearer sk_live_xxx'},
json={
'instance_id': 'inst_xxx',
'to': '+255712345678',
'text': 'Hello',
},
)
print(r.json())PHP
$ch = curl_init('https://whatsapp.s.co.tz/api/v1/messages/text');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer sk_live_xxx',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'instance_id' => 'inst_xxx',
'to' => '+255712345678',
'text' => 'Hello',
]),
CURLOPT_RETURNTRANSFER => true,
]);
echo curl_exec($ch);