#Openclaw whatsapp self chat setup issue 400 bad request

1 messages · Page 1 of 1 (latest)

terse kernel
#

Hey everyone, I'm having trouble setting up WhatsApp self-chat mode with OpenClaw. My Flask webhook is sending a 400 Bad Request to /hooks/agent even after following the docs, and my Gateway logs aren't updating. My WhatsApp account is linked successfully. Any ideas or quick fixes?

I have a full detailed report with redacted config and logs if needed.

OpenClaw Version: 2026.5.7 (eeef486)

I would appreciate it greatly if anyone could help me.

spare portalBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

sage lilyBOT
#

A couple quick things to separate here:

  1. For WhatsApp self-chat mode, you normally don’t need a Flask webhook at all. Once WhatsApp Web is linked and channels.whatsapp.selfChatMode: true is set, OpenClaw should receive messages through the WhatsApp channel listener directly. /hooks/agent is for external systems that want to trigger an isolated agent turn.

  2. A 400 from /hooks/agent usually means the Gateway did receive the request but rejected the payload. The response body should say why, e.g. message required, channel must be ..., agentId is not allowed..., bad JSON/content-type, or sessionKey not allowed.

Minimal known-good hook test:

curl -i -X POST http://127.0.0.1:18789/hooks/agent \
  -H 'Authorization: Bearer YOUR_HOOK_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"message":"ping from hook","channel":"whatsapp","to":"+15551234567"}'

If that fails, paste the HTTP status + JSON response body from curl. That’s the fastest clue.

  1. If Gateway logs “aren’t updating”, you may be tailing the wrong process/log. Check:
#
openclaw status --all
openclaw gateway status
openclaw logs --follow

Fallback:

tail -f "$(ls -t /tmp/openclaw/openclaw-*.log | head -1)"
  1. For self-chat config, verify this shape, not old keys:
{
  channels: {
    whatsapp: {
      dmPolicy: "allowlist",