# Webhook Log

A **Webhook Log** is a read-only execution record generated automatically by the platform each time a [Webhook](/webhook) callback is sent to your endpoint. It records the status of the delivery attempt, the retry count, and timestamps for scheduled retries if the target endpoint fails to respond successfully.

:::info
Webhook Logs are strictly **read-only** (`GET`, `LIST`) audit trails generated by the system. They cannot be created, modified, or deleted by administrators.
:::

---

## How it works

1. **Trigger callback** — an event matching your [Webhook](/webhook) subscription occurs.
2. **Log created** — the system generates a `Webhook Log` entry with status `pending`, linking to the triggering [Event Log](/event-log).
3. **HTTP POST** — Gamopanda sends the callback payload to your endpoint URL.
4. **Outcome** —
   - **Success (2xx)**: status transitions to `processed`.
   - **Failure (non-2xx / timeout)**: status transitions to `errored`, `retryCount` increments, and a `nextRetryAt` timestamp is calculated.
5. **Max Retries** — if the callback continues to fail after multiple retries, the log transitions to `max_errored` and stops retrying.

---

## Fields

### Webhook details

| Field | Type | Description |
|---|---|---|
| `webhookId` | UUID | Reference to the parent [Webhook](/webhook) subscription |
| `webhook` | object | Read-only. Joined Webhook object details. |
| `eventLogIds` | array (UUID) | The IDs of the triggering [Event Logs](/event-log) |
| `eventLogs` | object | Read-only. Joined Event Log object details. |

### Execution status

| Field | Type | Default | Description |
|---|---|---|---|
| `webhookLogStatus` | enum | `pending` | Delivery status: `pending` · `processed` · `errored` · `max_errored` |
| `status` | enum | `live` | Log visibility status: `draft` · `live` · `paused` |

### Retry history

| Field | Type | Default | Description |
|---|---|---|---|
| `retryCount` | integer | `0` | Number of failed delivery retries |
| `lastRetriedAt` | datetime | — | When the last delivery attempt was retried |
| `nextRetryAt` | datetime | — | Scheduled time for the next delivery retry |

---

## Real-world examples

**🔍 Reading a Webhook Log Entry (Failed/Errored)**

An audit log showing a webhook callback that failed with retry scheduling information:

```json
{
  "id": "019985db-c631-74b1-913d-b404a5640c8e",
  "createdAt": "2026-07-14T08:00:00.000Z",
  "updatedAt": "2026-07-14T08:01:30.000Z",
  "webhookId": "019985db-c631-74b1-913d-b404a5640c8f",
  "eventLogIds": [
    "019985db-c631-74b1-913d-b404a5640c8c"
  ],
  "webhookLogStatus": "errored",
  "retryCount": 2,
  "lastRetriedAt": "2026-07-14T08:01:30.000Z",
  "nextRetryAt": "2026-07-14T08:06:30.000Z",
  "status": "live"
}
```

---

## Access & permissions

| Caller | Allowed operations | Notes |
|---|---|---|
| Admin | GET · LIST | Read-only delivery audit records |
| End user | *(none)* | No access |
| Guest user | *(none)* | No access |

---

## Related resources

| Resource | Description |
|---|---|
| [Webhook](/webhook) | The parent webhook subscription mapping event codes to your endpoint |
| [Event Log](/event-log) | The source system event log that initiated the webhook delivery |

---

## API reference

See the [API Reference](/api/webhook_log) for full request/response schemas and interactive examples for:

- `GET /schema/webhook_log/record` — list webhook logs
- `GET /schema/webhook_log/record/{id}` — get a webhook log by ID
