Quick Start
Send Messages
Send WhatsApp messages through the API
Send text messages to any WhatsApp contact or group through a connected number.
Send a message
const result = await client.sendMessage(
connectionId,
'1234567890@s.whatsapp.net',
'Hello from WAHooks!'
);
console.log(result.id); // message IDresult = client.send_message(
connection_id,
chat_id="1234567890@s.whatsapp.net",
text="Hello from WAHooks!",
)
print(result["id"])wahooks connections send CONNECTION_ID 1234567890@s.whatsapp.net "Hello from WAHooks!"curl -X POST https://api.wahooks.com/api/connections/CONNECTION_ID/send \
-H "Authorization: Bearer wh_..." \
-H "Content-Type: application/json" \
-d '{"chatId": "1234567890@s.whatsapp.net", "text": "Hello from WAHooks!"}'Chat ID format
| Type | Format | Example |
|---|---|---|
| Individual | {phone}@s.whatsapp.net | 1234567890@s.whatsapp.net |
| Group | {id}@g.us | 120363419246216126@g.us |
Use the chats endpoint to discover chat IDs for existing conversations.
Anti-spam protection
WAHooks automatically follows WhatsApp anti-blocking best practices when sending messages:
- Mark as seen — acknowledges the conversation
- Start typing — shows typing indicator
- Random delay — 1-3s base + ~50ms per character (max 8s)
- Stop typing — clears indicator
- Send message — delivers the text
This happens transparently — you just call sendMessage and the delay is handled server-side.
WhatsApp may block numbers that send too many messages too quickly or send unsolicited messages. Always respect WhatsApp's terms of service.