What are webhooks? And how can they support your integrations?

Certain business events, such as a new lead coming in or an order getting submitted, require a swift response from your team in order to have the desired outcome. 

Polling, which consists of recurring, time-based calls to an API endpoint, may not suffice in these cases, as the method can take too long to collect time-sensitive data.

Instead, you’ll likely need to use webhooks, or event-driven integrations. 

To help you leverage webhooks effectively, we’ll cover how they work, common use cases they support, and how you can, generally speaking, set them up.

What is a webhook?

A webhook is a specific approach to sharing real-time information across applications over the internet. More specifically, once an event occurs in the source application, the application makes a POST request to a specific URL endpoint. The application on the receiving end (i.e. the destination application) is then able to process the data.

Illustration of how webhooks work

Webhooks vs APIs

Webhooks are, at least by many, considered to be a subset of APIs, but they operate differently than other forms of APIs. 

A webhook shares data in real-time and only provides information in one direction. Traditional APIs, on the other hand, allow you to share data bidirectionally and typically require you to make requests through polling. In other words, most APIs allow applications to receive, post, or edit data frequently (e.g. every hour), but not in, or near, real-time.

Related: Webhooks vs polling

Examples of using webhooks to power integrations

To get a better sense of how your team can use webhooks, let’s cover a few use cases for internal and customer-facing scenarios.

Note: The first two examples apply to internal integration use cases, while the following two apply to customer-facing use cases.

Message your sales reps when leads submit demo requests

Research proves that the faster your team responds to a warm lead, the more likely your team is to qualify and convert that lead to a client. 

To enable your reps to do just that, you can use a webhook to facilitate the following workflow: Once a lead reaches a certain score in your marketing automation platform (e.g. Marketo), a notification gets sent to the assigned sales rep in your business communications platform (e.g. Slack). 

Within the message, the rep can learn key information on the lead—such as the marketing campaigns they’ve participated in and the marketing content they’ve downloaded and read—allowing the sales rep to respond thoughtfully and successfully.

Webhook example for routing leads

Related: Common webhook examples

Update your inventory when a client makes a purchase

Say you have an online store and, to ensure that any out-of-stock products aren’t shown, you need your ecommerce store to update its inventory count after every purchase.

Here’s how a webhook can help you accomplish this successfully: Once a client makes a purchase through your payment tool (e.g. Stripe), the payment tool makes a POST request that details the purchase within the registered webhook. Your ecommerce platform (e.g. Shopify) receives this purchase information and updates its inventory count accordingly. 

Webhook example for updating inventory

Create a ticket in your client’s ticketing tool once your product identifies an issue

Say you offer a product that helps clients pinpoint security concerns in their code base.

To help your clients act on any issue your product spots quickly and successfully, you can integrate your product with your clients’ ticketing applications and build the following flow: Once an issue is identified in your product, a ticket gets created in the client’s ticketing tool in real-time. Certain fields are also populated from your product (e.g. details on the issue) to ensure that your client has all the context they need to begin resolving it.

Webhook example for creating tickets

 

Related: Examples of REST API authentication

Send employees the appropriate gifts for specific milestone events

Now, let’s imagine that you provide a gift-giving solution for HR teams.

To ensure that your product is able to deliver the right gifts to the right employees on time, you can integrate your clients’ HRIS solutions with your product and build the following workflow: Once a specific milestone event occurs in a client’s HRIS, your product gets notified and can kick off the relevant gift-delivery process for that employee.

Webhook example for automating employee gift-giving

How to set up webhooks

Here’s how the process of registering webhooks generally works for internal use cases (we’ll cover how you can leverage them for customer-facing scenarios at the end of this article).

Note: The steps you’ll need to follow naturally vary depending on the specific applications and data you’re looking to use.

1. Pinpoint the event you care about

This is probably the easiest step; you likely have the answer already. That said, having a clearly-defined event allows you to reverse engineer the applications and teams that need to be involved.

2. Configure the webhook in the source application

Through an admin account, you can likely access a section on adding webhooks in the source application (this might be in the application’s settings or developer console). 

Once you’ve navigated to this section, you should be able to pick the event you care about, add the callback URL for the destination application, give the webhook a description and/or name, add a supported type of authentication, and then go ahead and create the webhook. 

3. Test the webhook to confirm it works as expected

There’s no way to know how the webhook performs until you’ve tested it out. To do this, simply trigger the event in the source application and verify that the destination application has received the data successfully.

4. Document the webhook for colleagues 

In case your colleagues have any questions or concerns about the webhook configuration, you can provide documentation on it (perhaps via your company’s internal wiki) that outlines why it was built, how it was built, who built it, etc.

This step is especially important to follow when only you and a few of your colleagues are familiar with its setup. After all, if you and these colleagues leave and there’s no documentation, your organization can be left poorly-prepared to maintain and improve the webhook-based integration over time.

Related: Tips for reading API documentation 

Looking to retrieve fresh data for your product with ease?

Merge, which offers a single API to add hundreds of integrations to your product, lets you use webhooks in multiple ways so that you can leverage them across countless integration scenarios. 

More specifically, you can take advantage of Merge webhooks, which send data payloads directly to your app; or configure the webhooks in the 3rd-party applications (assuming they support webhooks) to deliver data payloads to Merge. 

To learn more about using webhooks with Merge, you can schedule a demo with one of our integration experts.

Email Updates

Subscribe to the Merge Blog

Get stories from Merge straight to your inbox