Introduction
This API lets an authenticated application make requests to the Munshi Ji WhatsApp API service.
Before you start
- Obtain an API key from your account/dashboard.
- Have a WhatsApp session created and connected.
- Use HTTPS for requests.
- Keep your API key on your server. Never expose it in public browser JavaScript.
Authentication
Send your API key using either the x-api-key header or the Bearer authorization header.
Option A — API key header
x-api-key: YOUR_API_KEY
Option B — Bearer token
Authorization: Bearer YOUR_API_KEY
YOUR_API_KEY with your actual key.
Do not publish real keys in source code, screenshots or public repositories.
Send a WhatsApp Message
/api/messages
Send a JSON request containing the session ID, destination phone number and message text.
Request body
{
"session_id": "YOUR_LINKED_SESSION_ID",
"to": "923001234567",
"message": "Hello! This message was sent using the API."
}
Use the destination number in international format. Confirm the accepted number format for your deployment before production use.
cURL
curl -X POST "https://api.notivo.link/api/messages" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"session_id": "YOUR_LINKED_SESSION_ID",
"to": "923001234567",
"message": "Hello from Munshi Ji API"
}'
Sessions
These session endpoints require API-key authentication.
/api/sessionsList sessions available to the authenticated customer.
/api/sessionsCreate a session. Check the response for the assigned session ID and follow the session connection flow.
/api/sessions/{sessionId}Retrieve details for a session accessible to the authenticated customer.
/api/sessions/{sessionId}/initializeRequest session initialization.
/api/sessions/{sessionId}/reconnectRequest a reconnect for a session.
/api/sessions/{sessionId}/disconnectRequest disconnection of a session.
Session Status
/api/session/status
Check the status of the session linked to your API key.
curl "https://api.notivo.link/api/session/status" \
-H "x-api-key: YOUR_API_KEY"
QR Code
/api/session/qr
Request QR information for the session linked to your API key. The session may need initialization first.
curl "https://api.notivo.link/api/session/qr" \
-H "x-api-key: YOUR_API_KEY"
QR response format and availability depend on the current session state. Scan a valid QR using the WhatsApp account you intend to connect.
PHP Example
Example request using PHP cURL:
<?php
$apiKey = getenv('MUNSHI_API_KEY');
$payload = [
'session_id' => 'YOUR_LINKED_SESSION_ID',
'to' => '923001234567',
'message' => 'Hello from PHP'
];
$ch = curl_init('https://api.notivo.link/api/messages');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'x-api-key: ' . $apiKey
],
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_TIMEOUT => 20
]);
$response = curl_exec($ch);
if ($response === false) {
error_log(curl_error($ch));
} else {
echo $response;
}
curl_close($ch);
?>
Server-side JavaScript Example
Use this example in a trusted Node.js backend, not in public frontend code.
const response = await fetch(
'https://api.notivo.link/api/messages',
{
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': process.env.MUNSHI_API_KEY
},
body: JSON.stringify({
session_id: 'YOUR_LINKED_SESSION_ID',
to: '923001234567',
message: 'Hello from Node.js'
})
}
);
const result = await response.json();
console.log(response.status, result);
Errors & Troubleshooting
401 — Authentication required or invalid
Check that the API key is present and copied correctly.
403 — Access denied
Check API-key permissions, customer status and whether the requested session belongs to that key.
Session not connected
Open your dashboard, check the session state, and complete the QR connection flow if required.
404 — Endpoint not found
Verify the path and HTTP method. The send-message endpoint is POST /api/messages, not a random test path.
5xx — Server error
Check the server logs and session state. Retry only after confirming whether the original message was sent.