How do I use Dispatch with webhooks?

Dispatch webhooks are a powerful and easy way to send on-chain activity data to apps and dApps you're using and building.

Webhooks deliver data to your apps as they happen; you get the data you want immediately (depending on your plan) instead of having to poll (look) for changes to data. For example, we can send your app a notification when the balance of any of the wallets you're watching changes.

Event types 

Dispatch webhooks can be triggered by on-chain activity, such as:

  • Address activity: wallet balance changes or crosses a threshold
  • Smart contract activity: events emitted or functions called by smart contracts

Examples of what you can do with Dispatch webhooks and Zapier - using on-chain activity to trigger workflows in Slack and Google Sheets

Webhook format 

All Dispatch webhooks use the same format, regardless of the event type. The webhook request is an HTTP POST with a JSON payload containing:

  • patch : information about the associated Patch and Trigger
  • details : information about the actual event that occurred (varies based on Trigger type)

Important security Note 

Always verify that webhook requests originate from the api.dispatch.esprezzo.io domain. Any other origin is not a legitimate Dispatch webhook request and could pose a security risk.

Steps to create a webhook:

  1. Log in to Dispatch
  2. From the Dashboard, select a Trigger from the Trigger dropdown (event you want Dispatch to listen for, i.e. when a wallet balance changes or goes above or below a threshold, a smart contract emits certain events, etc.)
  3. Select Webhook as the Action
  4. Click the Complete Patch button, which takes you to the Patch Creator
  5. Configure Trigger settings
  6. Create a new webhook in step 4, Action details: from the Webhook dropdown menu, select "Click here to add a new webhook"
  7. In the "Create webhook" modal, add a descriptive name for your webhook — this is recommended especially if you plan to use multiple webhooks. Provide the webhook endpoint URL — the callback URL your app will use to accept the incoming webhook
  8. Test to make sure Dispatch is able to send to your URL
  9. Click the "Turn Patch On" button 🎉

Tip

For quick testing, get a unique webhook URL via webhook.site, paste the URL into Dispatch, and see webhook notifications as they come in.

Using a webhook in multiple Patches

Once you've created a webhook, you can select it as the output for any other Patches you create by selecting the webhook by name in the Patch Creator and repeating the other steps above.

Viewing and managing your webhooks

You can see all your Dispatch webhooks by visiting Connected Apps under your account settings.

From Connected Apps, you can

  1. Delete webhooks
  2. Create Patches using a specific webhook

Still need help? Contact Us Contact Us