# Receive WhatsApp Web events

Configure an HTTPS receiver on your server and a dedicated webhook key. Persist before acknowledging and deduplicate the delivery ID.

Authorization: Bearer <webhook key> or X-API-Key: <webhook key>. This is the dedicated webhook key, not the Rasel send API key.

1. Configure an HTTPS URL and webhook key in developer settings.

2. Verify Bearer or X-API-Key and return 2xx within 10 seconds.

3. Use accountId and remoteChatId to reply via messages/send.

## Request preview

```bash
curl --request POST 'https://receiver.example/webhooks/your-whatsapp-web-endpoint' \
  -H "X-API-Key: $RASEL_WEBHOOK_KEY" \
  -H 'Content-Type: application/json' \
  -H 'X-Rasel-Event: whatsapp_web.message.received' \
  -H 'X-Rasel-Delivery-Id: 6800del123def4567890aaaa' \
  --data-binary @- <<'RASEL_JSON'
{
  "event": "whatsapp_web.message.received",
  "timestamp": "2026-09-05T10:04:00.000Z",
  "data": {
    "accountId": "session-user-whatsapp-1",
    "conversationKey": "whatsapp_web:session-user-whatsapp-1:963912345678@s.whatsapp.net",
    "remoteChatId": "963912345678@s.whatsapp.net",
    "remoteMessageId": "3EB0AABBCCDDEEFF",
    "from": {
      "jid": "963912345678@s.whatsapp.net",
      "phone": "+963912345678",
      "displayName": "Ali"
    },
    "isGroup": false,
    "text": "مرحباً، أريد تتبع طلبي",
    "messageType": "text",
    "timestamp": "2026-09-05T10:04:00.000Z",
    "hasMedia": false,
    "mediaType": null,
    "mimetype": null,
    "fileName": null
  }
}
RASEL_JSON
```

## HTTP 200

```json
{
  "ok": true
}
```

Test locally with a mock response first. Confirm the recipient and cost before sending a live request.

- [POST /webhooks/your-whatsapp-web-endpoint](https://raselsms.com/api-docs/markdown/webhooks/whatsapp-web-inbound.md)

## HTTP 500

Rasel will retry. Return 2xx even if you process later.

```json
{
  "error": "internal"
}
```

[API reference](https://raselsms.com/api-docs/markdown/webhooks/whatsapp-web-inbound.md)

[OpenAPI](https://raselsms.com/api-docs/openapi.json)

[Receiver (mjs)](https://raselsms.com/api-examples/rasel-webhook/receiver.mjs)

[Receiver (py)](https://raselsms.com/api-examples/rasel-webhook/receiver.py)

[Receiver (php)](https://raselsms.com/api-examples/rasel-webhook/receiver.php)
