> Documentation index: [Saleor](/llms.txt) · [This section](/developer/llms.txt)
> Source: https://docs.saleor.io/developer/extending/webhooks/troubleshooting

# Webhooks Troubleshooting

<a id="retrieving-past-events"></a>

## Retrieving Past Events

You can only access events that are still in `PENDING` or `FAILED` state. If the event delivery was successfully completed (`SUCCESS`), Saleor removes it from the system.

To check details about past event delivery query the list of `eventDeliveries` for that specific webhook

Here's an example query to retrieve webhook deliveries:

```graphql
query WebhookDeliveries {
  webhook(id: "YOUR_WEBHOOK_ID") {
    id
    eventDeliveries(first: 50, sortBy: {direction: DESC, field: CREATED_AT}) {
      edges {
        node {
          id
          createdAt
          status
          payload
          attempts(first: 1) {
            edges {
              node {
                status
                responseStatusCode
                response
              }
            }
          }
        }
      }
    }
  }
}
```

<a id="retention--cleanup-policy"></a>

### Retention & Cleanup Policy

Saleor retains the payloads of `PENDING` or `FAILED` event deliveries based on the `EVENT_PAYLOAD_DELETE_PERIOD` environment variable. By default, this is set to **14 days**, meaning that after this period, such deliveries are automatically removed.

<a id="retrying-failed-event-deliveries"></a>

## Retrying Failed Event Deliveries

Saleor provides a mechanism to retry failed event deliveries using the [`eventDeliveryRetry`](/api-reference/webhooks/mutations/event-delivery-retry.md) mutation.

To retry a failed event, first get the delivery ID and then send the following mutation:

```graphql
mutation RetryEventDelivery {
  eventDeliveryRetry(id: "EVENT_DELIVERY_ID") {
    delivery {
      id
      status
    }
    errors {
      field
      code
      message
    }
  }
}
```

<a id="webhook-deactivation"></a>

## Webhook Deactivation

When a app/webhook is deactivated:

1.  Any events that are already in the queue will still be processed but will not be delivered to the target URL
2.  Events that are picked up from the queue while the app/webhook is disabled will be marked as permanently failed
3.  When the app/webhook is reactivated, any remaining events in the queue will be delivered as usual
4.  Events that were marked as failed during the deactivation period will not be retried
