Detect and Recover webhook failures

Whether you fear that some webhooks were not received or you just want to monitor that everything is going smoothly, we got you covered.

Detect and Recover with the API

Our API provides 2 usefull endpoints for monitoring and recovering from failures.

Detect Failures

With the endpoint GET /endpoint/{endpoint_id}/stats, you can get your sending statistics. You can set up time limits for this request (since and until)

Example Request :

curl --location 'https://api.sinay.ai/webhook/api/v1/endpoint/ep_2hmPUJQUpB9chQTvVSMCP5yrqFt/stats?since=2024-06-12T12%3A00%3A00Z' \
--header 'Accept: application/json'

Response example :

{
    "success": 0,
    "pending": 0,
    "sending": 10,
    "fail": 32
}

With this example, you can see that your endpoint has recorded a lot of failures and no success. You should definitely go to your dashboard and check what's going on. But you can also try some automatic recovery steps.

Replay missing

You can use the POST /endpoint/{endpoint-id}/replay-missing endpoint to replay every messages failed during a certain period. A successfull request to this endpoint will return a 204 response.

Example Request:

curl --location 'https://api.sinay.ai/webhook/api/v1/endpoint/ep_2hmPUJQUpB9chQTvVSMCP5yrqFt/replay-missing' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'API_KEY: ••••••' \
--data '{
  "since": "2024-06-12T12:00:00Z",
  "until": "2024-06-12T15:00:00Z"
}'

Detect failures with the dashboard

In the monitoring dashboard, you can select your endpoint and see if there were any failed webhook attempts

Failed webhook attempts

The webhooks status are as follows :

  • Succeeded : the webhook has been received by the endpoint, without any error code
  • Sending : the webhook reception has failed at least once, but we will retry
  • Failed : the webhook reception has failed everytime we tried

You can then click on a webhook to check what has been sent and investigate the errors if needed.

Svix error

Svix error - webhook attempt

In my example, the error states that this url cannot be resolved (which, for https://test.test , is not surprising)

Recover failures with the dashboard

Once you have found a failed webhook, diagnosed the problem and fixed it, you will want to recover every failed attempt that has been made previously.

You can do it either webhook message by webhook message

Svix webhook message

or in the message view:

Svix message view

Or replay missing messages since a certain date:

Svix missing messages