Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(session): count pending relaunches in the session cap docs

Yudhi Armyndharisca9122055d9a
diff --git a/docs/03-system-architecture.md b/docs/03-system-architecture.md
index e30a6d6d4..58f703c54 100644
--- a/docs/03-system-architecture.md
+++ b/docs/03-system-architecture.md
@@ -1553,8 +1553,8 @@ flowchart LR
| **Enterprise** | PostgreSQL | S3/MinIO | Redis | 10+ | 4GB+ | Agency, high volume |
> Session counts are guidance only by default. Set `MAX_CONCURRENT_SESSIONS` to a positive integer
-> to cap concurrently running or initializing engines; the default `0` keeps the historical
-> unlimited behavior.
+> to cap concurrently running or initializing engines, plus sessions waiting to relaunch after a
+> failed reconnect; the default `0` keeps the historical unlimited behavior.
### Configuration Examples
diff --git a/docs/06-api-specification.md b/docs/06-api-specification.md
index c8bc6d91a..15c79775c 100644
--- a/docs/06-api-specification.md
+++ b/docs/06-api-specification.md
@@ -663,7 +663,7 @@ Returned via `transformSession`. Status typically transitions to `initializing`
A session stopped with `POST /stop` or `POST /force-kill` is marked to run again only once the start gets past the `400` and `409` refusals below; a refused start leaves the stop in place.
-**Errors:** `400` session already started / already starting, or this node already runs `MAX_CONCURRENT_SESSIONS` sessions (`Maximum concurrent sessions reached (N)`, answered only after the `404` and the `409` for a session running on another node; the session is not started, so retry once a slot frees or on a node with room) · `401` · `403` · `404` not found · `409` credential teardown for the same session name still in flight (retryable; body carries `code: 'SESSION_NAME_TEARDOWN_PENDING'`; no destructive side effect runs before the refusal — a retry after cleanup settles proceeds), or another node currently holds this session's engine (refused before any engine is launched), or, with no `code`, a `POST /stop`, `POST /force-kill` or data import (`stopOrphans`) of this session that began or finished while the start was waiting, or a delete of it still running (the start yields and launches nothing; after a stop or force-kill a new `POST /start` clears it and starts the session, after a delete or an import that removed the session the retry answers `404`) · `504` the engine did not finish starting within its timeout (WhatsApp Web or the network unreachable, a stalled browser or resource limit, or, on whatsapp-web.js, an unreachable `proxyUrl`); the engine is torn down, so the start can be retried once the cause is addressed
+**Errors:** `400` session already started / already starting, or this node already holds `MAX_CONCURRENT_SESSIONS` slots, counting running and starting engines and sessions waiting to relaunch after a failed reconnect (`Maximum concurrent sessions reached (N)`, answered only after the `404` and the `409` for a session running on another node; the session is not started, so retry once a slot frees or on a node with room) · `401` · `403` · `404` not found · `409` credential teardown for the same session name still in flight (retryable; body carries `code: 'SESSION_NAME_TEARDOWN_PENDING'`; no destructive side effect runs before the refusal — a retry after cleanup settles proceeds), or another node currently holds this session's engine (refused before any engine is launched), or, with no `code`, a `POST /stop`, `POST /force-kill` or data import (`stopOrphans`) of this session that began or finished while the start was waiting, or a delete of it still running (the start yields and launches nothing; after a stop or force-kill a new `POST /start` clears it and starts the session, after a delete or an import that removed the session the retry answers `404`) · `504` the engine did not finish starting within its timeout (WhatsApp Web or the network unreachable, a stalled browser or resource limit, or, on whatsapp-web.js, an unreachable `proxyUrl`); the engine is torn down, so the start can be retried once the cause is addressed
#### POST /api/sessions/:sessionId/stop