Working with webhooks
Webhooks are a powerful way to integrate your applications and services with Webflow, allowing you to receive real-time updates whenever specific events occur on your site. By setting up webhooks, you can automate workflows, trigger external processes, and synchronize data across different platforms without any manual intervention.
Webhook requests
When an event occurs, Webflow will send a POST request to a specified URL.
The webhook body will be a JSON resource object that relates to the event. The request headers will include:
- A
Content-Typeheader set toapplication/json - A
x-webflow-timestampwith the time the webhook was sent - A
x-webflow-signatureheader containing the request signature. Read on for information about validating request signatures.
Below is an example of webhook event data.
JSON Example
Properties
Creating a webhook
In this tutorial, we’ll walk through creating a webhook to listen for new submissions to a contact form on a site. Whenever someone submits this form, Webflow will send a notification to the specified destination. Additionally, we’ll cover how to verify that the webhook requests you’re receiving are genuinely from Webflow, ensuring secure and reliable communication with your application.
Looking for a simpler setup?
If you’d prefer a way to set up webhooks without using the API, you can easily configure them through the Webflow dashboard. Please note, that webhooks created through the dashboard will not include the request headers needed to validate request signatures.
Prerequisites
- A site token or bearer token from a Webflow Data Client App with the
forms:readscope. - A Webflow test site. You can use the Biznus template to quickly set up a site equipped with a contact form.
- A service to accept an HTTPS request. While we’ll be using https://webhook.site in this tutorial, you’re free to choose any platform.
Step 1. Create a form
Before we get started working with the API, we’ll first need to create a form and publish our site. If you already have a working form on your site, you can skip this step. To create a site with a form, we’ll use the Biznus template, which already has a form on its contact page.
-
Clone the Biznus template to your development Workspace.
-
Go to the Contact Page to view your form. Here, you can review your form’s fields. Ensure each field has a unique name. These field names will be used as keys in the webhook’s payload.