Switch Channel
Developer Hub
API Documentation
Integrate the WA Pro Hub into your applications using our high-performance REST API. Every request requires an x-api-key header for security.
1. Authentication
Required Header
x-api-key: YOUR_TOKEN_HERE
Get Token →
2. Core Endpoints
POST
Send Text Message
/api/:tenantId/message
const axios = require('axios');
const sendMessage = async () => {
const response = await axios.post('http://localhost:3001/api/algo/message', {
to: '919876543210',
message: 'Hello from Node.js!'
}, {
headers: { 'x-api-key': 'YOUR_TOKEN' }
});
console.log(response.data);
};
import requests
url = "http://localhost:3001/api/algo/message"
payload = {
"to": "919876543210",
"message": "Hello from Python!"
}
headers = {
"x-api-key": "YOUR_TOKEN"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "http://localhost:3001/api/algo/message",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => json_encode([
"to" => "919876543210",
"message" => "Hello from PHP!"
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: YOUR_TOKEN"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
POST
Send Image/PDF/Audio
/api/:tenantId/media
const axios = require('axios');
const sendMedia = async () => {
const response = await axios.post('http://localhost:3001/api/algo/media', {
to: '919876543210',
message: 'Check out this document!',
media: {
mimetype: 'application/pdf',
data: 'BASE64_STRING_HERE', // The base64 data without prefix
filename: 'invoice.pdf'
}
}, {
headers: { 'x-api-key': 'YOUR_TOKEN' }
});
};
import requests
import base64
# Convert file to base64
with open("file.pdf", "rb") as f:
encoded_string = base64.b64encode(f.read()).decode('utf-8')
payload = {
"to": "919876543210",
"message": "Here is the file",
"media": {
"mimetype": "application/pdf",
"data": encoded_string,
"filename": "document.pdf"
}
}
headers = { "x-api-key": "YOUR_TOKEN" }
response = requests.post("http://localhost:3001/api/algo/media", json=payload, headers=headers)
<?php
$b64 = base64_encode(file_get_contents("file.jpg"));
$payload = [
"to" => "919876543210",
"message" => "Image from PHP",
"media" => [
"mimetype" => "image/jpeg",
"data" => $b64,
"filename" => "photo.jpg"
]
];
// ... standard curl execution as shown in the Text Message section