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.ai

Messages

POST/api/send

Send 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/media

Send 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/template

Send 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/templates

List 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())

Ready to integrate?

Sign up, generate your API token, and start sending.

Get Started Free