Overview
All Moralis webhooks are cryptographically signed to ensure authenticity and integrity. By verifying each webhook signature, you can be confident that:- The request was sent by Moralis
- The payload was not tampered with
- Your application is protected against spoofed requests
How Webhook Signing Works
Every webhook request includes a signature in the HTTP headers:- Serializing the webhook payload
- Appending your account’s secret
- Computing a Keccak-256 hash (via
web3.utils.sha3)
What Is the Secret Key?
The secret key is a Streams-specific credential associated with your Moralis account.- It is not your API key
- It is used only for webhook verification
- It can be retrieved via the Streams settings endpoint
Verifying Webhook Signatures
To verify a webhook:- Read the
x-signatureheader - Recompute the signature using the request body and your secret
- Compare the two values
- Reject the request if they do not match
Example: Node.js (Express)
Security Best Practices
Always verify signatures
Do not trust:- Source IP
- User-Agent headers
- Payload structure alone
Use HTTPS
Webhook endpoints must be served over HTTPS to prevent interception or replay.Keep handlers lightweight
Slow responses can cause retries or queue buildup. Explore Webhook Delivery to learn how to handle this.Make handlers idempotent
Retries may result in duplicate payloads. Read more about Retries & Replays.What Happens If Verification Fails?
If your endpoint:- Rejects the request (non-2xx)
- Throws an error
- Times out
- The webhook is considered failed
- Automatic retries will occur
- The stream’s success rate may drop
Relationship to Other Webhook Concepts
| Topic | Page |
|---|---|
| Delivery guarantees | Webhook Delivery |
| Confirmed vs unconfirmed | Confirmation & Finality |
| Test requests | Test Webhooks |
| Retries & recovery | Retries & Replays |
| Failure states | Error Handling |

