Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(webhook): describe unsent delivery-failure and failed outbox rows

Yudhi Armyndharisc4a838242a37
diff --git a/docs/05-database-design.md b/docs/05-database-design.md
index f2a7af596..42ca4878a 100644
--- a/docs/05-database-design.md
+++ b/docs/05-database-design.md
@@ -704,8 +704,8 @@ The data connection also owns:
- **`templates`** — reusable message templates (`src/modules/template/entities/template.entity.ts`), with a unique constraint on `(sessionId, name)` — one template name per session.
- **`status_updates`** — inbound status/story broadcasts with a 24-hour TTL (`src/modules/status-store/entities/status-update.entity.ts`); unique on `(sessionId, waStatusId)`. Attached media is stored via `StorageService`, not in the row.
-- **`webhook_delivery_failures`** — durable record of a webhook delivery that exhausted all retries (`src/modules/webhook/entities/webhook-delivery-failure.entity.ts`), surfaced via the ADMIN `GET /webhooks/delivery-failures`.
-- **`webhook_outbox_events`**: the outbound webhook delivery record (`src/modules/webhook/entities/webhook-outbox-event.entity.ts`): a row is written `pending` before the delivery attempt, so a delivery lost to a crash is replayed by the reconciler. It settles as `dispatched` once a durable owner (the BullMQ queue, or the inline POST in direct mode) holds it, or as `failed` when the replays run out. Settled rows drop their payload and are pruned on age (§5.7).
+- **`webhook_delivery_failures`** — durable record of a webhook delivery that exhausted its retries, or was not sent (attempts 0: shed, refused at shutdown, oversize or a preflight failure) and is pending replay (`src/modules/webhook/entities/webhook-delivery-failure.entity.ts`), surfaced via the ADMIN `GET /webhooks/delivery-failures`. A later successful delivery removes the row.
+- **`webhook_outbox_events`**: the outbound webhook delivery record (`src/modules/webhook/entities/webhook-outbox-event.entity.ts`): a row is written `pending` before the delivery attempt, so a delivery lost to a crash is replayed by the reconciler. It settles as `dispatched` once a durable owner (the BullMQ queue, or the inline POST in direct mode) holds it, or as `failed` when the replays run out or the reconciler finds the webhook removed, disabled or unsubscribed from the event (no failure row is written then). Settled rows drop their payload and are pruned on age (§5.7).
- **`plugin_instances`** — one configured instance of an adapter plugin, keyed `${pluginId}:${instanceId}` (`src/modules/integration/entities/plugin-instance.entity.ts`); holds the host-minted ingress HMAC secret, masked on API reads.
- **`ingress_events`** — persist-before-ack durable row and inbound dedup oracle, unique on `(pluginId, instanceId, providerDeliveryId)` (`src/modules/integration/entities/ingress-event.entity.ts`). The full payload is retired to `NULL` once dispatch is settled, leaving a slim dedup marker.
- **`conversation_mappings`** — bidirectional WA-chat ↔ provider-conversation mapping plus handover state (`src/modules/integration/entities/conversation-mapping.entity.ts`).
diff --git a/docs/07-api-collection.md b/docs/07-api-collection.md
index 0c3fd0116..b5991ee36 100644
--- a/docs/07-api-collection.md
+++ b/docs/07-api-collection.md
@@ -137,7 +137,7 @@ Update per-session proxy settings (ADMIN, unscoped key). No restart — changes
curl -X PATCH "$BASE/api/sessions/$SESSION_ID/proxy" \
-H "X-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
- -d '{ "proxyUrl": "http://user:[email protected]:8080" }'
+ -d '{ "proxyUrl": "http://user:[email protected]:8080", "proxyType": "http" }'
```
#### POST /api/sessions/:sessionId/start
@@ -1141,9 +1141,9 @@ curl -X GET "$BASE/api/webhooks?limit=100&offset=0" \
#### GET /api/webhooks/delivery-failures
-List webhook deliveries that exhausted every retry, most recent first (ADMIN; results stay confined
-to the key's allowed sessions). `lastStatusCode` is `null` when the failure was a
-network/timeout/SSRF error rather than a non-2xx response.
+List webhook deliveries that failed or were not sent (attempts 0, pending replay), most recent first
+(ADMIN; results stay confined to the key's allowed sessions). `lastStatusCode` is `null` when the
+failure was a network/timeout/SSRF error rather than a non-2xx response.
```bash
curl -X GET "$BASE/api/webhooks/delivery-failures?limit=100&offset=0" \