Contentstack allows you to create webhooks that send real-time data to any third-party application or service when a set event occurs.
To create a webhook, log in to your Contentstack account, and perform the following steps:
- Go to your stack, and click on the “Settings” icon on the left navigation panel.
- Click on Webhooks.
- Click on the + New Webhook button located at the top of the page.
- In the Create Webhook page, provide the following webhook details:
- Name (mandatory): Provide a suitable name for your webhook.
- URL to notify (mandatory): Specify the URL or web address where the data will be sent once the webhook is triggered. The URL will receive an HTTP POST request when the selected event happens.
- HTTP basic auth username (optional): Provide the username of the HTTP basic auth if you intend to use Basic Authentication to secure your webhook.
- HTTP basic auth password (optional): Provide the password of the HTTP basic auth.
- Custom headers (optional): This field lets you add any additional header into the HTTP POST request. You can add multiple headers by clicking the + icon.
- When (mandatory): Set the conditions for the webhook to trigger. Here you need to define the event when the webhook will be triggered. For ease of use, we have two views under it: Conditional View and Code View.
- Click on the Save button.
Note: A webhook will not trigger on local environments such as localhost.
Let's create a webhook that will be triggered whenever any changes are made to any content type in a stack.
To perform this create action via APIs, refer to the Create a webhook API request.
Additional Resource: After creating a webhook, you can refer to our Webhook Integrations guide that lists various examples of automating particular tasks using Webhooks and third party services/apps.