# Delivery Logs (https://yapl.app/en/docs/user-guides/webhooks/delivery-logs)

# Delivery Logs

Every webhook delivery is logged so you can monitor what was sent, whether it was delivered successfully, and troubleshoot any failures.

## Viewing Delivery Logs

1. Navigate to **Settings > Webhooks**
2. Click the menu icon on the endpoint you want to inspect
3. Select **Deliveries**
4. Browse the delivery history (10 entries per page)

## Delivery Status

Each delivery has one of four statuses:

| Status | Meaning |
|--------|---------|
| **Success** | Delivered successfully — your endpoint returned a 2xx response |
| **Failed** | All retry attempts exhausted — delivery was not successful |
| **Retrying** | Initial attempt failed — YAPL is retrying automatically |
| **Pending** | Queued for delivery — not yet sent |

## Log Details

Each delivery log entry shows:

| Field | Description |
|-------|-------------|
| Event type | The event that triggered the delivery (e.g., `project.created.v1`) |
| Status | Current delivery status |
| Response status | HTTP status code returned by your endpoint |
| Response time | How long your endpoint took to respond (in milliseconds) |
| Attempt number | Which delivery attempt this is (1 = first try, up to 6 total) |
| Timestamp | When the delivery attempt was made |
| Error message | Details about what went wrong (for failed deliveries) |

## Retry Schedule

When a delivery fails, YAPL retries with increasing delays:

| Attempt | Delay after failure |
|---------|---------------------|
| 1st attempt | Immediate |
| 1st retry | 30 seconds |
| 2nd retry | 2 minutes |
| 3rd retry | 10 minutes |
| 4th retry | 1 hour |
| 5th retry | 6 hours |

A delivery is considered failed when:
- Your endpoint returns a non-2xx HTTP status code (e.g., 400, 500)
- Your endpoint doesn't respond within 10 seconds
- A network error prevents the request from reaching your endpoint

After 5 retries (6 total attempts), the delivery is permanently marked as **Failed**.

## Troubleshooting Failed Deliveries

### Timeout errors

Your endpoint must respond within **10 seconds**. If processing takes longer:
- Return a 200 response immediately
- Process the webhook data asynchronously in the background

### 4xx errors (400, 401, 403, 404)

- **400 Bad Request** — Your endpoint couldn't parse the payload. Ensure it accepts JSON.
- **401/403 Unauthorized** — If your endpoint requires authentication, add the appropriate header in the webhook's custom headers configuration.
- **404 Not Found** — The URL may be incorrect. Edit the webhook and verify the URL.

### 5xx errors (500, 502, 503)

- **500 Internal Server Error** — Your endpoint encountered an error. Check your server logs.
- **502/503 Service Unavailable** — Your server may be down or overloaded. YAPL will retry automatically.

### Network errors

- Ensure your endpoint is publicly accessible
- Check that your firewall allows incoming HTTPS requests
- Verify DNS resolution for your endpoint's domain

## Best Practices

### Monitor regularly

Check delivery logs periodically to catch issues before they become problems. A pattern of retries may indicate your endpoint is struggling under load.

### Respond quickly

Return a 200 status code as soon as possible. Don't do heavy processing before responding — accept the webhook, respond with 200, then process the data asynchronously.

### Handle duplicates

In rare cases (network issues, retries), you may receive the same event more than once. Use the event `id` field to detect and ignore duplicates.

### Check after changes

After editing a webhook URL or your endpoint's code, use the **Test** feature to verify everything still works.

## Related Topics

- [Creating Webhooks](/docs/user-guides/webhooks/creating-webhooks) — Set up and configure endpoints
- [Event Types](/docs/user-guides/webhooks/event-types) — Events that trigger deliveries
- [Verifying Signatures](/docs/user-guides/webhooks/verifying-signatures) — Validate delivery authenticity