1
0
mirror of synced 2025-12-19 18:10:59 -05:00
Files
docs/content/webhooks/using-webhooks/handling-failed-webhook-deliveries.md

3.1 KiB

title, shortTitle, intro, versions, topics, layout
title shortTitle intro versions topics layout
Handling failed webhook deliveries Handle failed deliveries {% data variables.product.company_short %} does not automatically redeliver failed webhook deliveries, but you can handle failed deliveries manually or by writing code.
fpt ghes ghec
* * *
Webhooks
inline

About webhook delivery failures

A webhook delivery can fail for multiple reasons. For example, if your server is down or takes longer than {% ifversion fpt or ghec %}10{% else %}30{% endif %} seconds to respond, {% data variables.product.company_short %} will record the delivery as a failure.

{% data variables.product.company_short %} does not automatically redeliver failed deliveries.

Handling delivery failures

You can manually redeliver failed deliveries. For more information, see AUTOTITLE.

You can also write a script that checks for failed deliveries and attempts to redeliver any that failed. Your script should run on a schedule and do the following:

  1. Use the {% data variables.product.company_short %} REST API to fetch data about any webhook deliveries that were attempted since the last time that your script ran. For more information, see AUTOTITLE, AUTOTITLE, and AUTOTITLE.

    {% ifversion fpt %}There are no API endpoints to get data about {% data variables.product.prodname_marketplace %} webhooks or {% data variables.product.prodname_sponsors %} webhooks.{% endif %}{% ifversion ghec %}There are no API endpoints to get data about {% data variables.product.prodname_marketplace %} webhooks, {% data variables.product.prodname_sponsors %} webhooks, or global webhooks.{% endif %}{% ifversion ghes %}There are no API endpoints to get data about global webhook deliveries.{% endif %}

  2. Look at the fetched data to see if any deliveries failed. The data for a failed delivery will have a status value that is not OK.

  3. Use the {% data variables.product.company_short %} REST API to redeliver any deliveries that failed. For more information, see AUTOTITLE, AUTOTITLE, and AUTOTITLE.

For example scripts, see:

If a webhook delivery fails repeatedly, you should investigate the cause. Each failed delivery will give a reason for failure. For more information, see AUTOTITLE.