WhatsApp Webhooks: Receive Incoming Messages in Real Time

5 min readUpdated 11 July 2026

A webhook turns WhatsApp from send-only into a two-way integration: every incoming message is POSTed to your server as JSON. Here is the payload and how to set it up.

What the webhook does

When someone messages one of your connected WhatsApp numbers, App365 immediately POSTs a JSON payload to a URL you choose. Your server can then route the enquiry, update your CRM, trigger a bot flow or alert your team — in real time, without polling.

Webhooks are configured per device, so each number can notify a different system.

Setting it up

  • Open Device Management and choose Webhook settings on the device
  • Enter your HTTPS endpoint URL and save
  • Use the built-in test button — it sends an event: "webhook_test" payload so you can verify wiring
  • Check the webhook logs in the dashboard to debug deliveries

The incoming-message payload

Every incoming message posts an event of type message_received:

{
  "event": "message_received",
  "timestamp": 1752192000000,
  "device": {
    "id": "your-device-id",
    "name": "Sales Line",
    "phone_number": "60123456789"
  },
  "message": {
    "id": "ABCD1234",
    "from_me": false,
    "sender": {
      "jid": "60198765432@s.whatsapp.net",
      "phone": "60198765432",
      "name": "Aisyah"
    },
    "content": {
      "type": "text",
      "text": "Hi, is this still available?",
      "has_media": false,
      "media_type": null,
      "download_url": null
    },
    "timestamp": 1752192000,
    "group": null
  }
}

Media messages

When the incoming message carries media (image, video, audio, document), has_media is true and download_url gives you a link to fetch the file. Download links stay valid for 14 days (download_expires_at tells you exactly when).

Delivery and retries

Deliveries are retried automatically if your endpoint is temporarily down, and every attempt is visible in the device’s webhook logs. Respond with a 2xx quickly (do heavy processing async) so deliveries are marked successful.

What to build on it

  • Auto-create CRM leads from new WhatsApp enquiries
  • Route messages by keyword to the right department or bot
  • Log conversations into your own database or helpdesk
  • Combine with the send API to build a fully custom auto-responder

FAQ

Does the webhook fire for messages I send?

The payload includes a from_me flag, so your handler can distinguish incoming customer messages from your own outgoing ones and act only on what you need.

Do group messages trigger the webhook?

Yes — group messages include a group object with the group name and ID, so you can handle or ignore them.

What if my server is down when a message arrives?

Deliveries retry automatically, and the webhook logs in Device Management show each attempt so nothing fails silently.

Ready to put this into action?

App365 handles the blasting, warmup, auto-replies and opt-outs for you — built for Malaysian businesses.