Skip to content

Webhook/event missing for messages sent manually from linked mobile device #195

@nalmeida84

Description

@nalmeida84

Summary

When the WhatsApp session owner sends a message manually from the linked mobile WhatsApp app to an existing customer chat, OpenWA does not emit
any webhook event for that message.

The message is visible in WhatsApp, but it never reaches the webhook receiver, so the consuming application cannot record it in the conversation
history.

Environment

  • OpenWA image/API: ghcr.io/rmyndharis/openwa
  • Webhook transport: HTTP POST
  • Registered webhook events: message.received, message.sent, session.status
  • Swagger/OpenAPI available event enum includes: message.received, message.sent, message.ack, message.revoked, session.status,
    session.qr, session.authenticated, session.disconnected, group.join, group.leave, group.update
  • OS: Linux / Docker Compose

Steps to Reproduce

  1. Start an OpenWA session connected to WhatsApp number A.
  2. Register a webhook with message.received, message.sent, and session.status.
  3. Receive or open an existing customer conversation in WhatsApp.
  4. From the linked mobile WhatsApp app using number A, manually send a message to that customer chat, for example: OPERADOR.
  5. Check the webhook receiver logs and the OpenWA message/audit endpoints.

Expected Behaviour

OpenWA should emit a webhook event for the manually sent message, ideally with a flag such as fromMe: true, direction: outgoing, or
equivalent metadata.

This would allow the consuming application to distinguish between:

  • inbound customer messages
  • outbound messages sent by the bot/API
  • outbound messages manually written by the human operator from WhatsApp mobile

Actual Behaviour

No webhook event is fired for the manually sent mobile WhatsApp message.

The webhook receiver receives nothing at all for that message, not even a raw payload. The message also does not appear in the API data checked
by the consuming application.

What Does Work

  • message.received webhooks fire correctly for customer messages.
  • session.status webhooks fire correctly.
  • Messages sent through the API can be tracked by the application.
  • The webhook registration is active and contains the configured supported events.

Use Case

This is needed for operator handoff workflows.

For example, an appointment bot manages a customer conversation automatically, but when a human operator replies manually from the same WhatsApp
mobile app, that reply should also appear in the bot/operator conversation timeline.

Without this event, the conversation history becomes incomplete: the customer sees the operator’s WhatsApp message, but the bot/backend does not
know it happened.

Workaround Attempted

We tried registering the available REST webhook events exposed by the OpenAPI/Swagger schema, especially message.sent, but manually sent
messages from the linked mobile WhatsApp app still do not trigger any webhook.

The OpenWA library documentation appears to expose lower-level listener concepts such as onAnyMessage / self-message handling, but these do not
seem to be available as supported webhook events in the REST/OpenAPI wrapper.

Request

Please either:

  1. Emit a webhook event for messages manually sent from the linked WhatsApp mobile app, including metadata such as fromMe: true, or
  2. Expose an API/webhook event equivalent to onAnyMessage in the REST/OpenAPI wrapper, or
  3. Document whether this is unsupported/impossible with the current REST gateway and what the recommended alternative is.

This would make OpenWA usable for operator handoff and conversation history synchronization scenarios.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions