Webhooks
Receive WhatsApp messages via HTTP POST to your server.
PipesBot can deliver incoming WhatsApp messages to your server as HTTP webhooks. Instead of maintaining a persistent WebSocket connection, your server receives a POST request for each message — including text, images, audio, video, documents, and more.
App webhooks
A BYON App has one webhook URL for all of its numbers. Every message, status and template update on any number your customers connect is POSTed to that URL, and each delivery names the number it belongs to (pipes.poolNumberId on API v2). You don't create an endpoint per customer.
- Set a Webhook URL in your App's settings (an HTTPS endpoint)
- PipesBot POSTs each event to it, signed with Standard Webhooks using your App's
whsec_secret - Your server verifies the signature, processes the payload and responds with a
2xxstatus code
Messages are also pushed to any WebSocket client connected with your App key, in parallel. Use the Send Test button in your App's settings to check your endpoint before going live. Full details: Webhook Delivery. To route deliveries to the right customer, see Build a platform.
Media files (images, audio, video, documents, stickers) are automatically downloaded from WhatsApp and stored temporarily. The webhook payload includes a download URL you can use to fetch the file. See Media Handling.
If your endpoint is unreachable, PipesBot makes 3 delivery attempts. If they all fail, the delivery is marked failed and kept for 7 days. You can see it and retry it from your App's Webhooks tab in the dashboard (see Retries & Error Handling).
Choosing between WebSocket and Webhook
| WebSocket | Webhook | |
|---|---|---|
| Connection | Persistent, bidirectional | Stateless HTTP POST |
| Best for | Real-time apps, bots with instant replies | Serverless functions, background processing |
| Requires | Long-lived process | Publicly accessible URL |
| Offline handling | Messages queued until reconnect | 3 attempts, then kept for manual retry |
Sandbox numbers
A sandbox number is a shared WhatsApp number managed by PipesBot. When you activate one, every time someone messages it, the message is proxied to your endpoint (until you deactivate it).
- You provide a publicly accessible HTTPS endpoint when activating your sandbox number
- When a WhatsApp message arrives on your sandbox number, PipesBot sends a POST request to your endpoint
- Your server processes the payload and responds with a
2xxstatus code
Sandbox webhooks use the legacy payload and are signed with X-Pipes-Signature (see Sandbox number webhooks).
During activation
When activating a sandbox number, select Webhook as your delivery method and provide:
- Webhook URL -- your HTTPS endpoint (e.g.
https://api.example.com/pipes/webhook) - Webhook Secret (optional) -- a shared secret for HMAC signature verification
You can generate a random secret or provide your own (16-256 characters).
Testing your endpoint
Before completing activation, use the Test Connection button to verify your endpoint is reachable. PipesBot sends a small JSON body { "test": true, "source": "pipes.bot" } (signed with X-Pipes-Signature if you set a secret) so your server can identify and ignore test deliveries. See Test payloads.
Changing delivery method
Open the settings for any active sandbox number and switch between WebSocket and Webhook without losing messages. Your existing secret is preserved when switching back.