How to set up webhooks in Baserow for real-time data updates

Banner image: configure a webhook in Baserow

Webhooks in Baserow offer an efficient way to stay on top of changes in your tables by pushing notifications in real-time to external systems. Let’s say you have a new client form in Baserow. Every time a new entry is submitted, you could use a webhook to automatically send that information to another app.

In this tutorial, we’ll walk through a step-by-step guide on how to set up a webhook in Baserow to notify an external app when rows in a specific table are updated. This method can be used to automate tasks such as notifying team members when a new row is added or when an existing one is modified.

Let’s dive in and set up our webhook!

Prerequisites

Before we begin, ensure you have:

  • A Baserow account with access to at least one table.
  • An internet browser for accessing webhook.site and Baserow.

webhook.site is a free tool that provides a temporary URL to capture incoming webhook data. This allows us to test and inspect the payloads that Baserow sends whenever a webhook is triggered. It’s ideal for debugging webhooks in real-time.

Configure a webhook in Baserow

Step 1: Create a webhook URL using webhook.site

Let’s set up a temporary webhook to see how it works with Baserow.

Head over to webhook.site in your browser. As soon as the website loads, you’ll see a unique URL generated at the top of the page. This URL will look something like this: https://webhook.site/unique-id.

This URL is what we’ll need to configure the webhook later in Baserow. We’ll also be able to see any incoming webhook requests sent from Baserow, allowing us to inspect what kind of information gets sent through.

Step 2: Access your Baserow table

Let’s jump into Baserow and find the table we want to keep an eye on.

Log in to your Baserow account and navigate to the specific database where your table lives. Now, within that database, we’ll find all the individual tables you’ve created. Here’s where you get to choose the table you want to monitor.

For this tutorial, let’s say we’re tracking companies, so we’d select the Companies table within the Lightweight CRM database. This could come in handy for all sorts of reasons – maybe you want to stay on top of new leads, track customer interactions, or analyze sales performance.

Screenshot showing the Baserow Lightweight CRM template

Step 3: Create a webhook in Baserow

We’re right where we need to be to start working with that table’s data. Now that we have the webhook URL, let’s set up the webhook in Baserow.

  1. Click on the ••• beside the Companies table to open the dropdown menu.

  2. Select “Webhooks” from the options.

    Image: Webhook Option in Baserow

  3. Click Create Webhook + to start configuring your webhook.

  4. Give your webhook a meaningful name like “New Sales Lead Notification.”

  5. Choose POST as the HTTP method, as this is the typical method used for sending webhook data.

  6. Paste the webhook.site URL copied earlier into the URL field. This tells Baserow where to send the webhook notifications.

  7. Choose the events to trigger the webhook. In this case, we want the webhook to trigger whenever a row is created in the Companies table. Select “Rows are created” from the events list. You can also select other events like Rows are updated or Rows are deleted, depending on what you want to track.

    Image: Event Trigger Setup in Baserow

  8. Optionally, you can add headers if the receiving system requires additional information like an API key, but for this tutorial, we’ll leave it empty.

Example payload:

{
    "table_id": 376000,
    "database_id": 148000,
    "workspace_id": 31000,
    "event_id": "00000000-0000-0000-0000-000000000000",
    "event_type": "rows.created",
    "items": [
        {
            "id": 0,
            "order": "1.00000000000000000000",
            "Name": "",
            "Address": "",
            "Industry": null,
            "Pipelines": [],
            "Website": "",
            "Contacts": [],
            "Notes": "",
            "Size": null,
            "Total contract value": null,
            "Total closed won": null,
            "Total closed lost": null,
            "Total in progress": null,
            "Pipelines count": null,
            "Active pipelines count": null,
            "Pipeline owner": null
        }
    ]
}

Step 4: Trigger test the webhook

We’ve configured our Baserow webhook, but before we trust it to handle our data, let’s test it to ensure it works correctly and avoid any surprises down the line.

In the Baserow webhook settings page, click “Trigger test webhook.” This button sends a sample message, mimicking the kind of data Baserow will send whenever a new row is created.

If everything’s set up perfectly, you should see a new request pop up on webhook.site, or your chosen webhook receiving platform. By testing the webhook, we can be confident that it’s receiving data from Baserow and that the receiving platform understands the information being sent.

Click Save to finalize the webhook setup.

Step 5: Verify webhook works with actual data

We’ve configured our webhook and we need to trigger an event in Baserow that should send data to our webhook URL. This will help us verify if the connection is established and if the receiving platform is receiving the data properly.

So, let’s jump back to the Baserow table. Since we configured the webhook to trigger on “Rows created” events, adding a new row will simulate this event and send data to the webhook.

Add a new row to your table, and switch back to the webhook.site tab. If everything is working as planned, you should see a new request appear in the log. This request will contain the information Baserow sent about the newly created row, including details like the table id, event id and workspace id.

Image: New Baserow request in webhook.site

Step 6: Viewing webhook logs in Baserow

If something goes wrong, Baserow provides a way to review your webhook calls.

Click the •• beside your table again and select “Webhooks”.

Click on Details next to your webhook to view its activity.

Navigate to the Call Log tab to see a log of all webhook events, including any failed attempts. This will show the request and response for each webhook call, allowing you to debug if necessary.

Step 7: Error handling and retrying webhooks

If something doesn’t look right or the webhook didn’t trigger:

  • Ensure your receiving system is available and can handle the request load.
  • Make sure the webhook returns a 200 OK status code to avoid unnecessary retries.
  • Ensure that the correct events are selected for the webhook in Baserow. For instance, if you selected “Rows updated” but added a row instead, the webhook won’t trigger.
  • Inspect the payload to confirm that the data sent in the payload matches what you expect. If there are missing fields, check how your table in Baserow is set up.
  • Perform different actions in Baserow (like updating a row) to trigger other events and test their payloads.

Conclusion

That’s it! You’ve successfully set up a webhook in Baserow. Using webhook.site provides a simple solution to visualize and debug webhook data in real-time. This allows you to verify the payload and ensure your webhooks are working correctly before integrating them with other applications.

By leveraging webhooks, you can automate notifications, data syncing, and workflows, making Baserow even more powerful for managing your data.