#Sending a WhatsApp message to a contact who has never messaged the bot

1 messages · Page 1 of 1 (latest)

warm bay
#

Hi all,
I'm running Hermes on EC2 (Ubuntu) with the Baileys-based WhatsApp bridge, and I'd like to know whether outbound-only messaging is possible.
What I want: have the agent send a WhatsApp message to a contact (I have their phone number) when that contact has never interacted with the bot (no prior message, no existing chat).

What I've found so far:

send_message(action='list') only returns existing conversations as targets (format whatsapp:<Display Name>). New numbers don't appear there.
Sending to a raw JID fails. 5[phone number]9@s.whatsapp.net returns Could not resolve ... Use send_message(action='list'). I also tested a variant with an extra 9 in the phone number, which returned a 500 from the bridge: Cannot destructure property 'user' of 'jidDecode(...)' as it is undefined.
I understand WHATSAPP_ALLOWED_USERS is inbound-only and doesn't affect outbound.

My questions:

(1) Is there a supported way to make the agent send the first message to a number with no prior chat? A different target format, a config option, or a way to register a contact so it shows up in action='list'?
(2) If not currently supported, does the underlying Baileys bridge have the capability (e.g. via onWhatsApp() to resolve the JID first), and would exposing it through the send_message adapter be feasible? Happy to look at the adapter code if someone can point me to the relevant file.
(3) Is the only intended path really "the contact must message the bot first, or I manually open the chat from the bot account once"?

I'm aware of the ban-risk caveat around cold outbound messaging, but I'm not looking to do bulk/spam, just occasional one-to-one messages to known contacts. Any guidance appreciated.
Thanks!

lethal imp
#

There is not currently a supported Hermes path for cold outbound WhatsApp sends to a number that has never appeared as a chat target.

send_message(action='list') is showing the gateway's known conversation targets. For WhatsApp, the current send path expects a resolvable existing target/chat id. Raw ...@s.whatsapp.net JIDs are not accepted as a supported send_message target format, and WHATSAPP_ALLOWED_USERS is only inbound allow-listing.

So for (1): no supported config option or contact-registration step exists today that makes a never-seen phone number appear in send_message(action='list').

For (2): yes, this looks feasible as a product change. The bridge would need to accept a supported phone-number target, resolve it through Baileys before sending, and return a clean error when the number is not on WhatsApp or cannot be resolved. The relevant code paths are tools/send_message_tool.py, scripts/whatsapp-bridge/bridge.js, and gateway/platforms/whatsapp.py.

For (3): the current reliable path is that the contact messages the bot first, or the bot account already has an existing chat/contact that Hermes can list and resolve.

One caveat: the WhatsApp docs intentionally warn against automating outbound messages to people who have not messaged first. Even if we expose this later, it should probably be treated as a careful explicit feature rather than the default behavior of send_message.