Guides & tools
WhatsApp webhooks for automation
Webhooks are how Meta tells your system that a message arrived or a status changed. Get verification and signatures right and everything else is ordinary event handling.
Create account
How it works
Webhook lifecycle
- 01
Register a callback URL and verify token in your Meta app
- 02
Meta sends a GET with hub.mode, hub.verify_token and hub.challenge; return the challenge as plain text with status 200
- 03
Meta sends POST events; verify X-Hub-Signature-256 over the raw body with your app secret
- 04
Return 200 quickly, then process the event
Verification step
Compare hub.verify_token with your own secret value. If it matches and hub.mode is “subscribe”, respond with the hub.challenge value as the body. Anything else should return 403.
Event flow in Samvadify
When you connect a number through Samvadify, its webhook receives your messages and statuses, rejects requests with an invalid signature, and routes them to the inbox, automations and campaign results. Developers can then use the Samvadify API (API key, Bearer auth) to read leads, appointments and messages, manage WhatsApp automation rules, or send text to existing contacts inside the window.
Troubleshooting
Most failures are one of these:
- Verification fails: token mismatch, or you returned JSON instead of the plain challenge.
- Signature fails: you parsed and re-serialised the body before hashing. Hash the raw bytes.
- No events: the app is not subscribed to the messages field, or the number is on another app.
- Duplicates: Meta retries on slow or non-200 responses — make handlers idempotent by message ID.
Security basics
Keep the app secret, verify token and API keys server-side. Rotate keys you suspect leaked. Never log full access tokens.
Common questions
Do I need my own webhook to use Samvadify?
No. Connecting your number through Samvadify sets up message handling for you. Your own webhook is only for custom systems.
Can the API send templates?
The API send endpoint sends free-form text to existing contacts within the service window. Use the workspace for template campaigns.