> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Recover a failing webhook

> What Streaming Hub does when your webhook endpoint stops answering, and how you read the delivery health and restart delivery.

Bring a webhook subscription back after your endpoint stopped answering.

## Participants

***

* **Your institution.** Your system calls the Streaming Hub API with an Access Manager token. Your HTTPS endpoint receives the deliveries.
* **Streaming Hub.** The Lerian platform service that retries failed deliveries and reports the health of each subscription. Lerian sets it up for your institution.
* **Lerian product.** The product that publishes the business event, for example Midaz.

## Diagram

***

![Recover a failing webhook](https://mintcdn.com/lerian-49cb71fc/KypD0TIKUCqZ014J/images/en/d2/id-recover-a-failing-webhook.svg?fit=max\&auto=format\&n=KypD0TIKUCqZ014J\&q=85\&s=69708097379e7ceba0f6915b3090f376)

## Steps

***

| # | From | To | Message | Lerian API | What happens |
| - | - | - | - | - | - |
| 1 | Lerian product | Streaming Hub | Event | | The product publishes a business event. |
| 2 | Streaming Hub | Your institution | Webhook | The events in `event_types` | Streaming Hub sends the signed event to your endpoint. |
| 3 | Your institution | Streaming Hub | Response | | Your endpoint answers with an error, or it does not answer in time. Any answer other than `2xx` is a failure. |
| 4 | Streaming Hub | Streaming Hub | Internal step | | Streaming Hub tries again on a back-off schedule. After the last try, it stops trying that event. |
| 5 | Streaming Hub | Streaming Hub | Internal step | | When the failures continue for a long time, Streaming Hub can disable the subscription. `enabled` becomes `false`. |
| 6 | Streaming Hub | Your institution | Event | Event `hub.destination.disabled` | Only if another subscription of yours receives this event. The event names the disabled subscription. |
| 7 | Your institution | Streaming Hub | Lerian API | [`GET /v1/subscriptions/{id}/health`](https://docs.lerian.studio/en/reference/platform/streaming-hub/get-subscription-health) | Read the delivery health of the subscription. |
| 8 | Streaming Hub | Your institution | Response | | The answer shows `enabled`, `status`, the delivery outcomes, `dead_lettered`, `auto_disabled` and `last_failure_at`. |
| 9 | Your institution | Your institution | Internal step | | Fix your endpoint. |
| 10 | Your institution | Streaming Hub | Lerian API | [`POST /v1/subscriptions/{id}/verify`](https://docs.lerian.studio/en/reference/platform/streaming-hub/verify-subscription) | Ask Streaming Hub to test your endpoint again. |
| 11 | Streaming Hub | Your institution | Webhook | Event `hub.subscription.verification_ping` | Streaming Hub sends a signed test event to your endpoint. |
| 12 | Your institution | Streaming Hub | Response | | Your endpoint answers `2xx`. |
| 13 | Streaming Hub | Your institution | Response | | The verify answers `outcome` `ok`. The subscription is `enabled` and `active` again, and new events reach your endpoint. |
| 14 | Streaming Hub | Your institution | Event | Event `hub.destination.verified` | Only if a subscription of yours receives this event. |

## How you know it finished

***

The verify answers `outcome` `ok`. The health view shows `enabled` `true` and `auto_disabled` `false`.

* **The verify fails.** The verify answers `outcome` `failed` with a `detail`, and the subscription stays disabled. Fix the endpoint and verify again.
* **You call ping instead.** A ping tests the endpoint, but it does not enable a disabled subscription. Use verify.
* **Events of the failure period.** Streaming Hub does not deliver the events that arrive while the subscription is disabled.

## Related

***

* [Receive events on a webhook](https://docs.lerian.studio/en/diagrams/platform-services/receive-events-on-a-webhook.md)
* [How Streaming Hub works](https://docs.lerian.studio/en/platform/streaming-hub/how-streaming-hub-works.md)
* [Managing subscriptions](https://docs.lerian.studio/en/platform/streaming-hub/managing-subscriptions.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.