This endpoint is only available to Growth and Enterprise plans.

Webhook

Mobula provides Webhook support for retrieving any raw events and curated events like Swaps or Liquidity.

Product demo

Coming soon.

Endpoint details

{
    "name": "MyFirstWebhook",
    "chainIds": ["evm:1", "evm:56"],
    "events": ["trace", "log", "trasaction", "block", "swap"],
    "apiKey": "xxxxxxxxxx",
    "url": "https://webhook.com/xxxxxxxxxxx",
};

Parameters

  • chainIds: details here
  • events: transactions, traces, logs, blocks, swaps
  • filters: details here
  • webhookUrl: URL to send the data

Create a webhook

First we need to create a webhook:

await fetch(url, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      body: {
  "name": "FirstWebhook",
  "chainIds": ["evm:1"],
  "events": ["trace"],
  "apiKey": "xxxxx",
  "filters": {
    "eq": ["action.input", "0xd55ec697"]
  },
  "url": "https://webhook.com/xxxxx"
  }
});
The API key is mandatory to create a webhook.

If you receive data from your webhook in response, then your webhook is functional and will start receiving events.

Delete a webhook

To delete a webhook:

await fetch(url + `/${webhook_id}`, {
      method: 'DELETE',
      headers: {
        'Content-Type': 'application/json',
      },
    });

If you receive:

{
    "message": "Webhook deleted successfully"
}

Then your webhook is deleted.

Can’t find what you’re looking for? Reach out to us, response times < 1h.