Skip to main content
All CollectionsProduct Support and How to?
How to Set and View Webhooks
How to Set and View Webhooks

Set up a webhook to turn payments in LeanLaw into alerts on compatible applications

Doug Schmierer avatar
Written by Doug Schmierer
Updated over a year ago

A webhook gives you a way for LeanLaw to inform another application of events happening within our application. For example, if you have a payment webhook set up for your firm, and you've enabled for the events "Create," "Update," and "Delete," then whenever a payment in your firm is created, edited, or deleted, LeanLaw will broadcast that event to a URL which you configure.

One way to use our webhooks is in combination of an API automation application, such as Zapier. Such applications can convert the raw data from our webhook and post it elsewhere, turning a recorded payment in LeanLaw into a message in a Slack channel.

This article will show you how to set up a webhook in LeanLaw. Like all of our API-related tools, setting up a webhook is recommended for users with mid-to-high technical skills.


How to set a webhook (UI)


The simplest way to set up a webhook is done through the user interface (UI) on our API Settings page.

1. Open the API Settings page

In LeanLaw, navigate to the API Settings page, located here.

2. Enable webhooks

On the API settings page, locate the Event Webhooks switch. Click this switch so that it is green (enabled).

3. Paste the recipient URL

Once enabled, you should see that the URL field has gone from grey and disabled to a white field into which you can enter text. Click this field and paste the URL you wish to be able to read our webhooks.

4. Select trigger events

Select any or all of the checkboxes, such as payments' Create, Update, and Delete. These checkboxes determine which events will be viewable from your webhook.

A screenshot of the webhook UI with a sample URL entered

5. Save Changes

Once finished, save your changes. You now have a webhook enabled that will post your selected events to your destination URL in real time.


How to set a webhook (API)


Alternatively to the above method, LeanLaw also supports configuring our webhooks via API. This method requires authentication with an API key so, if you haven't already done so, consider viewing our article, How To Use LeanLaw's Public API.

1. Create an API key with access to Webhook Settings

Webhooks require an API keys that has been given permission to do through your firm's API Settings page. Refer to How to Generate an API Key for instructions on configuring an API key.

2. Authenticate with the API Explorer

Once you have an API key, use it to authenticate yourself for API requests. Refer to How to Authenticate with the API Explorer for instructions on how to authenticate while using our API explorer.

3. Input a recipient url for your webhook

Send an API request to set your firm's webhook url. Below is an example mutation for setting up a payment webhook. You can copy and paste it into your API Explorer, replacing the text your url here with the address of your webhook.

mutation { 
updateWebhookSetting
(webhookSetting: {
url: "your url here",
enabled: true
entities: {
payment: {
create: true
update: true
delete: true
}
}
})
{ id }
}
A screenshot of the API Explorer with an example update entered

Your webhook is now set up and will allow the url which you entered to view your firm's payment events in real time. If you wish to make sure the webhook was set up successfully, consider following the steps for how to view your webhook configuration, below.


How to view your webhook configuration (API)


Our public API supports a query for webhookSetting, to help with troubleshooting and configuration. If you're ever uncertain whether your webhook is configured to the right url, or if you need to know your webhook's id, consider sending the following API request.

query {
webhookSetting {id, companyId, enabled, url}
}

What's next?


Did this answer your question?