Webhooks

A webhook notifies one of your systems as soon as something happens in goPrevina: an incident is recorded, a training session is completed or the status of a compliance requirement changes. goPrevina sends the event to the URL you give, signed with HMAC-SHA256.

1. What is on the screen

At the top, the “Verifying a delivery” drop-down. Then the “Create a webhook” block with “Name”, “Target URL” and the “Events” that can be sent (an “All events” box and one per event, such as incident.created or training.session.completed). Below, the list of webhooks; if there are none it says “No webhooks yet.”. At the end, “Failed deliveries”.

2. Create a webhook

1. Enter a “Name” and the “Target URL” (the HTTPS address of your system that will receive the events).

2. Tick “All events” or at least one specific event.

3. Press “Create a webhook”.

4. The signing secret appears with the notice “Copy this signing secret now — it will not be shown again:”. Store it in your system and press “Done”: you use it to check that every request comes from goPrevina.

3. Watch a webhook

When there are webhooks, three status cards with their count appear above the list: “With failed deliveries”, “Disabled” and “No incidents”. Press them to filter the list. Each row shows the name (a link to its page), the URL, the events and the failures, with a “disabled” or “auto-disabled” mark if it is not sending.

To the right of each row are icon buttons: “Send test”, “Delivery history”, “Replay”, “Enable / disable” and “Delete” (it asks for confirmation). Press the name to open the webhook's page, with its summary and all its deliveries.

4. Failed deliveries and replaying a period

If your URL fails 5 times in a row, goPrevina marks the webhook “auto-disabled” and stops sending: fix your system and switch it back on with “Enable / disable”.

“Failed deliveries” lists the deliveries that failed after every retry, with the event, the webhook, the error and the date. When your endpoint works again, press “Redeliver” on the row. To repeat many at once, “Replay” asks for “From” and “To” (31 days at most) and sends again the events of that period that the webhook subscribes to.

5. What your system has to do

Each event arrives as a POST request with a JSON body and the signature in the header. The “Verifying a delivery” drop-down shows how to calculate the signature and repeats two rules: refuse a timestamp older than 5 minutes and discard duplicates, because a delivery can arrive more than once. Your system must answer with a 2xx code; any other response counts as a failure, is retried and stays in the delivery history.