---
title: "Webhooks"
url: "https://dev.4hse.com/guides/webhooks"
description: "Learn how to set up and use 4HSE webhooks for your integrations."
---

# Webhooks

In this guide, we will explain how to use Webhooks to integrate the 4HSE platform with external web services, automating processes and synchronizing data in real time.

## What are Webhooks?

[Section titled “What are Webhooks?”](#what-are-webhooks)

A **webhook** is a **trigger** that automatically sends data to a specified URL when a particular event occurs. Unlike traditional API calls, where an external system needs to “poll” 4HSE to check for changes, webhooks work the other way around: 4HSE “calls” a web service to notify it of a change, such as the creation of a new user or the update of a certificate. This event-driven approach is much more efficient and responsive.

## Available Events

[Section titled “Available Events”](#available-events)

Currently, 4HSE supports the following events for triggering webhooks. These events cover create, update, and delete (CRUD) operations on the platform’s main resources:

-   [`PERSON::CREATE`](/api/person/#webhook-PERSON::CREATE)
-   [`PERSON::UPDATE`](/api/person/#webhook-PERSON::UPDATE)
-   [`PERSON::DELETE`](/api/person/#webhook-PERSON::DELETE)
-   [`ACTION_SUBSCRIPTION::CREATE`](/api/actionsubscription/#webhook-ACTION_SUBSCRIPTION::CREATE)
-   [`ACTION_SUBSCRIPTION::DELETE`](/api/actionsubscription/#webhook-ACTION_SUBSCRIPTION::UPDATE)
-   [`CERTIFICATE::CREATE`](/api/certificate/#webhook-CERTIFICATE::CREATE)
-   [`CERTIFICATE::UPDATE`](/api/certificate/#webhook-CERTIFICATE::UPDATE)
-   [`CERTIFICATE::DELETE`](/api/certificate/#webhook-CERTIFICATE::DELETE)
-   [`CERTIFICATE_ACTION::CREATE`](/api/certificateaction/#webhook-CERTIFICATE_ACTION::CREATE)
-   [`CERTIFICATE_ACTION::UPDATE`](/api/certificateaction/#webhook-CERTIFICATE_ACTION::UPDATE)
-   [`CERTIFICATE_ACTION::DELETE`](/api/certificateaction/#webhook-CERTIFICATE_ACTION::DELETE)

When one of these events occurs, 4HSE sends an **HTTP POST** request to the configured **Endpoint**, including the event data in the request body.

## How to Configure a Webhook

[Section titled “How to Configure a Webhook”](#how-to-configure-a-webhook)

To register a new webhook, navigate to the 4HSE administration panel: **Menu > Administration > Configuration > Webhooks**.

From the top grid, you can view the list of existing webhooks and add a new webhook by clicking the **+** icon.

The fields to define a webhook are as follows:

-   **Enabled:** This checkbox can be selected to activate the webhook. You can deselect it at any time to temporarily deactivate the webhook without deleting it.
-   **Name:** A descriptive name to easily identify the webhook (e.g., “New User Synchronization”).
-   **Event:** The event can be selected from a list of available events.
-   **Endpoint:** The URL of the web service that will receive the data. The endpoint must be public and capable of receiving HTTP POST requests.
-   **Headers:** A field to add custom HTTP headers. This feature is particularly useful for passing authentication tokens (`Authorization`) or other security keys required by the web service.

Once the fields are filled out, you can click **Save** to save and activate the webhook.

![webhooks-setup](/_astro/webhooks-1.CQP1liTe_1x4QKE.webp)

## Testing a Webhook

[Section titled “Testing a Webhook”](#testing-a-webhook)

On the same Webhooks configuration page, you can test a webhook with an event already generated by the system. When you click the test button, a window opens listing all past events of that type (e.g., all created persons). One of these events can be selected to be manually sent to the webhook.

In the **Result** section, two tabs are available:

-   **Request:** Displays the **payload** (the HTTP request body) that 4HSE sent to the endpoint, allowing you to verify that the data is correctly formatted.
-   **Response:** Displays the response received from the web service, including the HTTP status and response body. These details are essential for diagnosing communication errors.

![webhooks-testing](/_astro/webhooks-2.9iRj9s10_Z2uwPRr.webp)

## Monitoring Execution

[Section titled “Monitoring Execution”](#monitoring-execution)

For a complete view of all webhook executions in real time, navigate to: **Menu > Administration > Operations > Tasks**.

In this section, you will find a log of all executed webhooks. Each log entry shows the **Status** of the delivery (e.g., `done` for success or `failed` for failure) and other useful information such as the creation and update dates. By clicking on a single log entry, the `Details` section opens, allowing you to analyze the **Payload** and **Log** to diagnose any issues. This is the primary tool for monitoring webhook functionality in a production environment.

![webhooks-monitoring](/_astro/webhooks-3.DUzpxcSI_ZR6kIO.webp)

This site is protected by reCAPTCHA and the Google [Privacy Policy](https://policies.google.com/privacy) and [Terms of Service](https://policies.google.com/terms) apply.