This project is part of the content-maestro repository. If you want WhatsApp integration and automatic publishing of posts there as well, you need to deploy this app.
Warning
This integration relies on unofficial WhatsApp APIs and may lead to a permanent ban of the account. Proceed only if you fully accept that risk.
The app runs an Express.js server that shares a single WhatsApp session via HTTP endpoints. It authenticates requests using a shared bearer token, exposes utilities for updating the WhatsApp status, and sends individual or channel messages. When the service starts, it prints a QR code to the console that must be scanned with the WhatsApp account that will own the session.
- Node.js 20+
-
Clone the repository
-
Install dependencies
npm install
-
Create a
.envfile in the project root with the required variablesAUTH_TOKEN=your_shared_bearer_token PORT=3000
Leaving
PORTempty defaults the server to port3000. -
Run the server
npm start
The first launch displays a QR code in the console—scan it with the WhatsApp account you plan to automate.
All endpoints live under the same bearer-protected server and return JSON payloads.
| Header | Type | Required | Description |
|---|---|---|---|
Authorization |
string | Yes | Bearer <AUTH_TOKEN> value from .env |
Error Response (401 Unauthorized):
{
"success": false,
"error": "Invalid or missing bearer token"
}Updates the WhatsApp account status text.
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
text |
string | Yes | The new status message to publish |
Success (200 OK):
{
"success": true,
"message": "Status updated successfully"
}Error (400 Bad Request):
{
"success": false,
"error": "Status text is required"
}curl -X POST "http://localhost:3000/wapp/update-status" \
-H "Authorization: Bearer your_auth_token" \
-H "Content-Type: application/json" \
-d '{"text": "Available now!"}'Sends a message to a WhatsApp user chat or channel.
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
type |
string | Yes | Either chat (direct message) or channel |
jid |
string | Yes | The recipient JID (e.g., 1234567890@s.whatsapp.net) |
text |
string | Yes | Message body to send |
Success (200 OK):
{
"success": true,
"message": "Message sent successfully"
}Error (400 Bad Request):
{
"success": false,
"error": "Valid message type is required (chat or channel)"
}{
"success": false,
"error": "Both JID and text are required"
}curl -X POST "http://localhost:3000/wapp/send-message" \
-H "Authorization: Bearer your_auth_token" \
-H "Content-Type: application/json" \
-d '{
"type": "chat",
"jid": "1234567890@s.whatsapp.net",
"text": "Hello from the API!"
}'This project is licensed under the MIT License. See the LICENSE file for details.