API Reference
Built for Developers
Integrate WhatsApp messaging into your product with our simple REST API. Authenticate with a Bearer token, send a POST, and you're done.
Authentication
All requests require a Bearer token in the Authorization header. Generate your token from the dashboard under Developer Tools → Access Tokens.
Authorization: Bearer YOUR_TOKEN
Base URL:
https://api.zaptilo.aiMessages
POST
/api/sendSend text message
Send a plain text message to a WhatsApp number.
Request Body
{
"number": "919876543210",
"message": "Hello from Zaptilo!"
}Response
{
"status": true,
"message": "Message sent successfully"
}POST
/api/send/mediaSend media message
Send an image, video, or document with an optional caption.
Request Body
{
"number": "919876543210",
"media_url": "https://example.com/image.jpg",
"media_type": "image",
"caption": "Check this out!"
}Response
{
"status": true,
"message": "Media message sent successfully"
}POST
/api/send/templateSend template message
Send a pre-approved WhatsApp template message with dynamic parameters.
Request Body
{
"number": "919876543210",
"template_name": "order_update",
"language": "en",
"header_values": ["#1234"],
"body_values": ["John", "Shipped"]
}Response
{
"status": true,
"message": "Template message sent successfully"
}Templates
GET
/api/templatesList templates
Retrieve all approved message templates for your account.
Response
{
"status": true,
"data": [
{
"name": "order_update",
"language": "en",
"status": "APPROVED",
"category": "UTILITY"
}
]
}Code Examples
cURL
curl -X POST https://api.zaptilo.ai/api/send \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"number":"919876543210","message":"Hello!"}'PHP
$ch = curl_init('https://api.zaptilo.ai/api/send');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_TOKEN',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'number' => '919876543210',
'message' => 'Hello!',
]),
]);
$response = curl_exec($ch);Node.js
const res = await fetch('https://api.zaptilo.ai/api/send', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
number: '919876543210',
message: 'Hello!',
}),
});
const data = await res.json();Python
import requests
res = requests.post(
'https://api.zaptilo.ai/api/send',
headers={
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
},
json={
'number': '919876543210',
'message': 'Hello!',
},
)
print(res.json())