Webhook Overview
Mobula provides Webhook support to receive blockchain events in real-time. Currently, you can capture curated events like Swaps and Transfers across EVM, Solana, and SVM chains.Endpoint Details
- URL:
https://api.mobula.io/api/1/webhook - Method:
POST - Body (JSON): Same as the Webhook example
Parameters
Create a webhook
First we need to create a webhook:Your webhook is now active and will start sending events to the specified server URL.If you receive data from your webhook in response, then your webhook is functional and will start receiving events.
List out Registered Webhooks
You can retrieve all registered webhooks using your API key:Update a Webhook
No need to keep creating new webhooks every time — just update your existing one! Perfect for tracking new wallets, pools, or other events without the extra hassle. Think of it as giving your webhook a little upgrade — keeping it fresh, smart, and in sync with your latest needs. Webhooks support two modes for updating filters:merge: Appends your new filters to the existing ones. Great for adding without losing what you already track.replace: Completely replaces all existing filters with your new configuration. This is the default mode.
Required Parameters for Update
To update a webhook, you need:streamId: The ID of the webhook. If you don’t remember it, you can retrieve it by listing your webhooks.apiKey: The same API key used when creating the webhook.filters: Your updated filter configuration.mode: Optional. Use"merge"to append filters;"replace"(default) to overwrite existing filters.
Delete a webhook
To delete a webhook, use the webhook ID:Webhook Signature Verification
Mobula webhooks include cryptographic signatures to ensure the authenticity and integrity of the data you receive. Every webhook request includes two headers:X-Signature: HMAC-SHA256 signature of the request bodyX-Timestamp: Unix timestamp (seconds) when the request was created
How It Works
- Signature Generation: Mobula generates a signature using HMAC-SHA256 with your webhook secret
- Signature Format: The signature is sent as
sha256=<hex_digest>in theX-Signatureheader - Verification: You should verify the signature on your server to ensure the request is authentic
Signature Algorithm
The signature is computed as follows:secretis yourwebhookSecret(starts withwhsec_)payload_bodyis the raw JSON string of the request body
Example: Verifying Webhook Signatures
Here’s a complete example of how to verify webhook signatures in different languages:Example
Example Webhook Request
When Mobula sends a webhook, the request looks like this: Headers:Testing Webhook Signatures
You can test your webhook signature verification with this example:Security Best Practices
- Always verify signatures: Never process webhook data without verifying the signature
- Store secrets securely: Keep your
webhookSecretin environment variables, never in code - Implement replay protection: Check the
X-Timestampheader to prevent replay attacks (recommended: reject requests older than 5 minutes) - Use HTTPS: Always use HTTPS endpoints for webhook receivers
- Handle errors gracefully: Return appropriate HTTP status codes (200 for success, 401 for invalid signature, 400 for missing headers)
Backward Compatibility
Note: Older webhooks created before signature support was added may not have a
webhookSecret. These webhooks will be sent without signature headers. If you need signature verification, create a new webhook to receive a secret.Usage Examples
Before diving into the examples, make sure to check the data models for both EVM and SVM chains for swaps and transfers. Pro Tip for Devs: Dive into these data models and experiment with filters — your imagination is the only limit! Mix
and / or, combine keys, and watch your streams come alive!- Explore
poolType,poolAddress,transactionFrom,transactionTo, and other keys in the data models. - Combine multiple conditions using
and/oroperators to capture exactly the events you want. - Mix and match filters across swaps and transfers to suit your application needs.
Sample Swap Filters
The filter logic and data model are the same for SVM and EVM swaps.
Check out the curated swap model: EVM transfers model.
Check out the curated swap model: EVM transfers model.
Filter Swaps by Token Address
This example captures all swaps involving the$SPARK token 5zCETicUCJqJ5Z3wbfFPZqtSpHPYqnggs1wX7ZRpump from all supported pools on Solana:
Filter Swaps by Minimum USD Value
This example captures all large swaps of the$SPARK token worth more than $25 USD:
Track Multiple Whales swaps by Single Webhook
This example captures all swaps from specific wallet addresses:Track Multiple Whales by Token or Swap Amount
This example captures swaps from specific wallet addresses and filters by swap amount in USD:Sample Transfer Filters
The filter logic is the same for both SVM and EVM transfers
For EVM transfers, just update the identifiers according to the EVM transfers model.
For EVM transfers, just update the identifiers according to the EVM transfers model.
Filter Transfer by Multiple Wallets
This example captures all transfers from multiple wallets, with some conditions on the transfer amount (e.g.,amountUSD greater than 200 or 300):
Filter Transfers by Sender
This stream captures all transfers sent to a specificaddress:
Filter Transfers From Sender and Receiver (End-to-End)
This example demonstrates how to capture all transfers sent from or received by specific addresses, combining multiple conditions in a single webhook.Support
Telegram
Support
Slack
Need help?
Email