Manage data /Connect /Manage data layers /

Manage webhooks in Netlify Connect

This feature is available on Connect Enterprise plans.

After you create and configure a data layer, you can generate a webhook for your data layer and use it to trigger a data layer sync from an external system.

For most data sources, you need to generate an authenticated webhook and add it to your data source instance to notify Netlify when data changes. Once notified, Netlify will kick off a new data sync for your data layer.

Keep in mind the following before you set up your webhook:

  • Webhooks should act only as notifications to let Connect know that content updates are available and that Connect should start a new sync to get the latest data.
  • Webhooks should be stateless and they should not contain information about what needs to be updated.
  • If multiple webhook notifications come in at the same time, the newest one will take precedence and all others will be dropped.
  • If a new webhook notification comes in while a sync is in progress, Connect will process that webhook immediately after the current sync finishes.

Team Owners and Developers can add or delete webhooks at any time. Netlify records the addition and deletion of webhooks in the team audit log.

New to Connect? Set up a data layer first

If you haven’t already created a data layer, navigate to the

page for your team and select Add new data layer. Follow the prompts to configure the data layer and to add data sources, connected sites, and notifications. For more information, refer to our get started with Netlify Connect guide.

# Webhook format

The format for a data layer webhook is https://webhook.netlify-connect.com/hooks/data_layer/data_source/publish/{data_layer_id}/{webhook_id}.

Every data layer has a default webhook that is the same as above but without the unique webhook ID: https://webhook.netlify-connect.com/hooks/data_layer/data_source/publish/{data_layer_id}.

However, we recommend that you add a new authenticated webhook for your data layer and use that instead of the default. When you create a new webhook, Netlify generates a custom ID and appends it to the webhook URL to give you a unique webhook URL.

# Add a webhook

After you generate a webhook, the default webhook won’t work

After you add a webhook, the default webhook will no longer be authenticated. You will need to update all data sources and systems that rely on the webhook to use your new webhook URL instead.

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list, and then select Data layer settings.
  3. On the data layer settings page, select Webhooks.
  4. Select Add a webhook.
  5. Enter a Name for this webhook.
  6. Select Create webhook.

You can now send a POST request to the webhook to trigger a sync for your data layer. For example:

curl -X POST -d {} https://webhook.netlify-connect.com/hooks/data_layer/data_source/publish/{data_layer_id}/{webhook_id}

# Add headers to customize the request

If you wish to only update a single data source or add a webhook body, add a x-connect-data-source header to the request with the data integration’s slug as the header’s value.

# Delete a webhook

To delete a webhook from your data layer:

  1. Navigate to the page for your team in the Netlify UI.
  2. Select the data layer from the Data layers list, and then select Data layer settings.
  3. On the data layer settings page, select Webhooks.
  4. Select the webhook you want to delete.
  5. Select Delete webhook.
  6. A confirmation prompt will appear. Review the details and then select Delete.

After you delete all of your webhooks, the default webhook will be authenticated again.