Verify Webhook HMAC Signatures
mainWhen HMAC is configured, WuzAPI includes an x-hmac-signature header (SHA-256) in all webhooks. You should always verify this signature before processing the payload.
Signature Generation Rules:
| Content-Type | Signed Data | Verification Method |
|---|---|---|
application/json | Raw JSON request body | Use the exact JSON received |
application/x-www-form-urlencoded | URL-encoded form string | Reconstruct the form string from parameters |
multipart/form-data | JSON of form fields (excluding files) | Create JSON from non-file form fields |
HMAC Priority:
- Per-instance HMAC (configured via API/Dashboard)
- Global HMAC (
WUZAPI_GLOBAL_HMAC_KEY) - No signature