Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(changelog): bring the Unreleased entries back to the house style

Yudhi Armyndharisd598e20cf561
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3ef7cee32..aa292851e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,8 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
-- `POST /sessions/:sessionId/channels/:channelId/owner/transfer` hands a channel to a new owner on the Baileys engine. It is irreversible: the account stops being the owner and cannot take the channel back. The whatsapp-web.js engine answers `501` — its page function is present but rejects every call locally, against a subscriber list the library has no working path to repopulate, so wiring it would have produced a route that always failed.
-- `POST /sessions/:sessionId/channels/:channelId/admins/demote` demotes a channel admin back to a subscriber on the Baileys engine. There is no promote counterpart because neither engine library has one, so an admin is promoted from the WhatsApp app and demoted here. The whatsapp-web.js engine answers `501`: it declares the method, but the WhatsApp Web module its page body calls no longer exports the function, so wiring it would have produced a route that always failed.
+- `POST /sessions/:sessionId/channels/:channelId/owner/transfer` hands a channel to a new owner on the Baileys engine; it is irreversible, and the account cannot take the channel back. The whatsapp-web.js engine answers `501`.
+- `POST /sessions/:sessionId/channels/:channelId/admins/demote` demotes a channel admin back to a subscriber on the Baileys engine; neither library has a promote counterpart, so promote from the WhatsApp app. The whatsapp-web.js engine answers `501`.
- `POST /sessions/:id/chats/pin` pins a chat to the top of the list or unpins it, on both engines; `success: false` reports WhatsApp's three-pin cap, which only the whatsapp-web.js engine can observe.
- `POST /sessions/:id/chats/mute` mutes a chat until an epoch-milliseconds timestamp or unmutes it with an explicit `null`, on both engines; unlike `chats/archive` it has no declined outcome, since the change is not keyed to the chat's last message.
- `engine-inventory-parity.spec.ts` fails when a `docs/29` exposure or event mark no longer matches the adapters: a symbol marked as used must appear in adapter code rather than only in a comment, and an event marked consumed must have a listener behind it.
@@ -21,47 +21,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `POST /sessions/:sessionId/calls/link` generates a shareable WhatsApp call link on both engines, returning the finished `https://call.whatsapp.com/…` URL; a WhatsApp-side failure answers `403` rather than a success carrying an empty link.
- `DELETE /sessions/:sessionId/profile/picture` removes the account profile picture on both engines; removing one that is already absent is a no-op answering `200`, so the call is safe to repeat.
- `docs-29-counts.spec.ts` binds every count-shaped claim in `docs/29` to the capability matrix, so a figure restated in the intro, the architecture prose, a mermaid node or a section heading cannot drift from the source it restates.
-- The JavaScript, Python, PHP, Go and Java SDKs expose `PUT /sessions/:id/presence`, which sets the account's own global presence. The gateway has published the route since v0.15.0 with no client counterpart, so a typed client had to fall back to a raw request. It is the account's presence, not a chat's — the per-chat typing and recording states are unchanged on the chats resource.
-- The JavaScript, Python, PHP, Go and Java SDKs expose the three group membership-request routes — list, approve and reject. The gateway has published them since v0.15.0 with no client counterpart. Omitting the participant list acts on every pending request, and an approval that WhatsApp refuses for some requesters still answers `200`, reporting the outcome per participant in `results`.
-- The JavaScript, Python, PHP, Go and Java SDKs expose `GET /sessions/:sessionId/contacts/blocked`, which lists the ids the account has blocked. The gateway has published the route since v0.15.0 while every SDK shipped `block` and `unblock` with no way to read back what either one had done. The method is named `listBlocked` (`list_blocked` in Python) rather than `blocked`, which would sit one character from its two neighbours while taking a different argument list and returning a plausible-looking array. It needs only a read-level key, unlike `block` and `unblock`.
-
-### Fixed
-
-- The chart's optional ServiceMonitor now scrapes one target per pod instead of two. Its selector matched only the shared selector labels, which both the ClusterIP and the headless Service carry, so Prometheus discovered a target through each and produced two sets of series distinguished only by the `service` label — enough to double-count any naive aggregation. The headless Service also publishes not-ready addresses, so it kept a target pointed at a pod whose port is still closed during boot and reported it as down. The ServiceMonitor and the ClusterIP Service now share a `openwa.io/scrape-target` label that the headless Service does not carry. After upgrading, series previously collected through the headless target stop appearing: check any dashboard or alerting rule that matches on the `service` label, which now always resolves to the ClusterIP Service.
-- The Helm chart no longer restarts the pod while it is still starting. The container binds its port only after every bootstrap hook has finished, so during boot the endpoint is closed rather than unhealthy and each liveness probe is a connection refusal; with no startup probe the liveness settings governed that window and allowed 50 seconds before the kubelet killed the container. This is not limited to deployments using session auto-start: the database connect retry alone is up to 10 attempts three seconds apart, so a database that is slow to accept connections can consume 30 of those 50 seconds on a stock install. A startup probe now allows 300 seconds (a 5-second period, 60 failures) and fires immediately, so a fast boot is recognised in about five seconds rather than after a fixed delay — the pod becomes live sooner than before, not later. A boot that is genuinely unbounded is not made safe by any fixed budget.
-- A Helm upgrade that changes only `env` or `secretEnv` now restarts the pod, so the new configuration actually reaches the running container. The pod template carried nothing derived from the ConfigMap or Secret, so such an upgrade rendered a byte-identical template and triggered no rollout: the release reported success while the process kept its previous values, because Kubernetes reads `envFrom` only when a container is created. The pod template now carries checksums of the rendered ConfigMap and Secret. Two consequences worth reading before upgrading: a configuration change now restarts this single-instance StatefulSet where previously it did not, and the chart can only observe configuration it renders itself — with `existingSecret` set no Secret is created, so changes to that operator-managed Secret still need `kubectl rollout restart`. The Secret checksum is published as a pod annotation, which is readable by anyone who can list pods; `values.yaml` notes what that means when choosing between `secretEnv` and `existingSecret`.
-- Promoting a participant who is already an admin, or demoting one who is already not, answers `200` instead of `500` on the whatsapp-web.js engine. WhatsApp Web rejects a status change that would change nothing, and the minified page bundle reports that rejection without a name, so the request failed with no usable diagnosis. The install-time patch now skips a participant whose status already matches the request, which makes both operations idempotent: the requested end state already holds.
-- A participant id carrying a recognised domain but a nonsense user-part — `NOT A [email protected]`, `@c.us` — is now rejected with `400` like any other malformed id. The earlier check tested only the domain, so these still reached WhatsApp Web and produced the same undiagnosable `500` the check was added to prevent. The same rule now backs the `mentions` validator, which had the identical gap, and it covers the two membership-request routes, which take the same ids and were missed the first time. A bare phone number is also qualified before it reaches the Baileys socket; previously it went out without a domain, which WhatsApp does not read as an id at all, so the write silently did nothing. Fixes #1220.
-- Messages that existed before the full-text index was created are indexed on the next boot instead of being permanently unsearchable, and ordinary edits and deletes on them work again. The boot-time backfill was gated on the index being empty, but `messages_fts` is an FTS5 external-content table whose `count(*)` returns the row count of `messages`, so the condition could never hold and the backfill never ran; until those rows are indexed the sync triggers issue delete commands for documents that were never added and SQLite rejects the whole statement. The guard is now a rowid-level completeness check, so it also repairs a partially populated index rather than only an empty one.
-- A WhatsApp-level refusal of a group participant add, remove, promote or demote on the Baileys engine is now reported as `403` instead of propagating as an unhandled error. Participant refusals normally arrive one per participant and were already mapped; a refusal of the request itself arrives through the other channel, and this was the only write in the Baileys group adapter that did not map it. A dropped connection or a timeout is still reported as itself rather than as a permissions problem. Refs #1220.
-- Removing, promoting or demoting group participants on the whatsapp-web.js engine now reports which participants WhatsApp actually acted on. The library resolves each requested id against the group's own member list and silently drops what it cannot find, so a request naming only non-members answered `500` for removal — the empty batch tripped an arity assertion — while promotion and demotion answered `200` claiming success for people WhatsApp never touched. Such a request now answers `403`, and a mixed request reports the untouched entries as `404` instead of confirming them. An installation whose `node_modules` predates this release keeps the previous behaviour for the reporting half; the `500` is closed either way. Refs #1220.
-- A group participant id that does not name an individual — free text, a group id, a number too short to be one — is now rejected with `400` naming the offending entries, instead of being handed to the engine. On whatsapp-web.js such an id reached the page-side `createWid`, which threw an error the minified bundle reports without a name, so the caller received a `500` that could not be diagnosed from either end. The check covers group creation and adding, removing, promoting and demoting participants, and it sits in the service rather than the request body so the MCP tools are guarded on the same terms as the REST routes. Refs #1220.
-- Creating a channel on the Baileys engine no longer answers `500` while leaving the channel behind. The library's response parser read `thread.picture.id` eagerly, but its create call sends only a name and description and has no picture parameter, so the picture was absent on every create and the parse threw after WhatsApp had already created the newsletter — and because the operation is non-idempotent, a client retrying the `500` leaked one orphan channel per attempt, invisible through the API since `getSubscribedChannels` is not available on that engine. A new install-time patch reads the response defensively so the call succeeds and returns the new channel's id, which is the only place that id appears.
-- A profile-picture lookup that fails on the whatsapp-web.js engine now answers `503` instead of `{"url": null}`, which is what the route already documented. whatsapp-web.js resolves `undefined` for the only legitimate negative — no picture, or hidden by privacy — so every error reaching the adapter was a failure being reported as "this contact has no avatar". The batch route keeps its best-effort `null`, having no per-id error channel. A dead page during a single-contact lookup likewise stops reading as `404`.
+- The JavaScript, Python, PHP, Go and Java SDKs expose `PUT /sessions/:id/presence`, which sets the account's own global presence — not a chat's; the per-chat typing and recording states are unchanged.
+- The JavaScript, Python, PHP, Go and Java SDKs expose the three group membership-request routes — list, approve and reject; omitting the participant list acts on every pending request, and a partial refusal still answers `200` with each outcome in `results`.
+- The JavaScript, Python, PHP, Go and Java SDKs expose `GET /sessions/:sessionId/contacts/blocked` as `listBlocked` (`list_blocked` in Python), reading back what `block` and `unblock` have done. It needs only a read-level key.
+
+### Fixed
+
+- The chart's optional ServiceMonitor now selects on a new `openwa.io/scrape-target` label, so it scrapes one target per pod instead of two; series previously collected through the headless target stop appearing, so check anything keyed on the `service` label.
+- The Helm chart's new startup probe stops the kubelet killing a pod that is still booting, allowing 300s (`periodSeconds: 5`, `failureThreshold: 60`) where the liveness settings allowed 50.
+- A Helm upgrade that changes only `env` or `secretEnv` now restarts the pod through ConfigMap and Secret checksums, so the new configuration reaches the running container. With `existingSecret` set the chart renders no Secret, so that path still needs `kubectl rollout restart`; `values.yaml` notes what publishing the Secret checksum as a pod annotation means.
+- A participant id with a recognised domain but a nonsense user-part — `NOT A [email protected]`, `@c.us` — is now rejected with `400` instead of reaching WhatsApp Web as an undiagnosable `500`; the same rule backs the `mentions` validator and the membership-request routes, and a bare phone number is qualified before reaching the Baileys socket. Fixes #1220.
+- Messages that predate the full-text index are indexed on the next boot instead of staying permanently unsearchable, and edits and deletes on them work again; the `messages_fts` emptiness guard is now a rowid-level completeness check.
+- A WhatsApp-level refusal of a group participant add, remove, promote or demote on the Baileys engine is now `403` instead of an unhandled error; a dropped connection or a timeout is still reported as itself. Refs #1220.
+- Removing, promoting or demoting group participants on the whatsapp-web.js engine now reports who WhatsApp actually acted on: a request naming only non-members answers `403` rather than `500` or a false `200`, and a mixed request reports the untouched entries as `404`. An installation whose `node_modules` predates this release keeps the previous reporting. Refs #1220.
+- A group participant id that does not name an individual — free text, a group id, a number too short — is now rejected with `400` naming the offending entries instead of reaching the engine as an undiagnosable `500`. The check sits in the service, so the MCP tools are guarded like the REST routes. Refs #1220.
+- Creating a channel on the Baileys engine no longer answers `500` while leaving the channel behind, so a retry no longer leaks an orphan newsletter; a new install-time patch reads the create response defensively and returns the channel's id.
+- A profile-picture lookup that fails on the whatsapp-web.js engine now answers `503` instead of the `{"url": null}` the route documents as "no picture"; the batch route keeps its best-effort `null`.
+- Promoting a participant who is already an admin, or demoting one who is already not, answers `200` instead of `500` on the whatsapp-web.js engine; the install-time patch skips a participant whose status already matches, making both operations idempotent.
- The JavaScript, Python, Go and Java SDKs list `group.join_request`, an event the gateway has accepted and dispatched all along, so a typed client can subscribe to it without casting past its own type.
- A webhook's `lastTriggeredAt` is published as a nullable date-time string instead of an object, so a client generated from the contract no longer rejects both of the values the field actually carries. The response itself is unchanged.
-- The group-list and status routes no longer appear twice in the OpenAPI contract under different path-parameter names, so a client generated from it gets one method per endpoint; the parameters are now `sessionId` and `id`. The URLs themselves are unchanged.
-- A bare `@SkipThrottle()` no longer leaves a route throttled: it writes one metadata key the guard never read, so `/api/metrics` and the `/api/health*` probes were rate-limited despite being documented as exempt, and a 429 on readiness reads as unhealthy to every configured probe. Those four routes are also `@Public()`, so the global IP limit was the only one reaching them and they now carry none — rate-limit them at your proxy if they are internet-facing.
-- The chat-media retention purge and orphan sweep now run while `CHAT_MEDIA_ARCHIVE_ENABLED` is off; previously turning archiving off stopped both, leaving files past their TTL and crash-leftover orphans in the store indefinitely. Note the consequence for a deployment that has archiving off: the orphan sweep now deletes any file under the `chat-media/` prefix that no message row references, once it has been unreferenced for the grace window (`CHAT_MEDIA_ORPHAN_GRACE_MS`, default 1h). A file a surviving row points at is never touched.
+- The group-list and status routes no longer appear twice in the OpenAPI contract under different path-parameter names; the parameters are now `sessionId` and `id`, and the URLs are unchanged.
+- A bare `@SkipThrottle()` no longer leaves a route throttled: `/api/metrics` and the `/api/health*` probes were rate-limited despite being documented as exempt. All four are also `@Public()` and now carry no limit — rate-limit them at your proxy if they are internet-facing.
+- The chat-media retention purge and orphan sweep now run while `CHAT_MEDIA_ARCHIVE_ENABLED` is off, which previously stopped both. Consequence for such a deployment: the sweep now deletes any file under `chat-media/` that no message row references, once unreferenced for `CHAT_MEDIA_ORPHAN_GRACE_MS` (default 1h).
- A plugin whose code went missing is recoverable through the API again: reinstalling now writes over its surviving `ctx.storage` directory instead of answering `409`, and uninstalling a known-but-unloaded id no longer answers `404`.
-- A sticker sent through the Baileys engine no longer reaches WhatsApp as non-WebP bytes labelled `image/webp`; the adapter converts `image/*` to a 512×512 WebP before the socket, passes genuine WebP through byte-identical, and refuses anything it cannot convert with a `400` instead of reporting success.
+- A sticker sent through the Baileys engine no longer reaches WhatsApp as non-WebP bytes labelled `image/webp`: the adapter converts `image/*` to a 512×512 WebP, passes genuine WebP through unchanged, and refuses the rest with `400`.
- `docs/18-sdk-design.md` and the SDK READMEs now list every method the five clients ship: the whole `media` resource plus 26 methods across nine others were missing, so server-side media conversion, presence subscription, session config and webhook delivery diagnostics read as unavailable.
-- The engine parity check no longer skips optional interface members. `probeLiveness?()` did not match its member pattern, so the capability matrix could omit any optional method while the check reported green; it now has a row recording that wwjs probes with a real round trip and Baileys with a local check.
-- `.env.example` and the troubleshooting FAQ no longer name a specific WhatsApp Web build to pin with `WWEBJS_WEB_VERSION`. The build they named has since been withdrawn from the registry, and a build the registry no longer serves is fetched, missed and silently ignored — so an operator following the FAQ's own workaround got the default behaviour while the log claimed the pin had been applied. Both now point at the registry's `html/` folder for a build that is currently served.
-- A WhatsApp Web build that cannot be resolved from the wa-version registry is now reported (`web_version_resolve_failed`) with the reason, the registry URL and the remedy. A host that cannot reach the registry — a proxy, a firewalled VPS, regional blocking — silently continued without a pin and let whatsapp-web.js pick the build itself, which is the "authenticates then never reaches ready" class the pin exists to prevent; nothing was logged, so there was nothing to grep for. The existing one-minute backoff already bounds how often the warning can repeat.
-- `POST /sessions/:id/pairing-code` answers `409` while a whatsapp-web.js session is still starting up, instead of a `500` carrying a raw `TypeError`. The engine stored its client before launching Chromium, so for the whole launch — seconds on a modest host — the route passed its only guard and reached into a browser page that did not exist yet. Requesting a code straight after `POST /start`, which is what the dashboard's linking modal invites, landed in exactly that window. The request is now accepted only once the session reaches `qr_ready`, the state the pairing flow needs anyway.
-- A burst of inbound media messages no longer loses the media of everything past the eighth. The Baileys adapter capped the download queue at its active slots, and an upsert is submitted in one synchronous pass, so admission was a constant 8 whatever the batch size — a 40-message upsert arrived with 32 of its files replaced by an omitted-media marker. The queue is now unbounded and a burst parks instead of shedding; the concurrent-download bound is unchanged.
-- The JavaScript SDK reports why a production gateway rejected a request instead of ending the error message in `[object Object]`. NestJS omits `error` from the envelope whenever the exception carried no explicit message, which is what the global ValidationPipe does under `disableErrorMessages` — the default whenever `NODE_ENV=production` and `VALIDATION_ERROR_DETAIL` is unset — so every rejected request in a stock production deployment answers `{ statusCode, message }`. The SDK required all three keys to recognise the envelope; the PHP, Python and Go clients already treated `error` as optional.
-
-- Stopping or deleting a session id that does not exist no longer leaves an entry behind in the teardown-mark set. The mark is set synchronously at entry, before the existence check, so a `404` set one too — and nothing could remove it, because the two paths that clear a mark both run after their own lookup and a session id is never re-supplied. The set grew by one for every such request until the process restarted. A refusal against a session that does exist still keeps its mark, which is what the mark is for.
-
-- A plugin loaded from the legacy plugins directory can be enabled, uninstalled and updated like any other. The loader scans that directory in addition to the configured one, but recorded nothing about where each package came from, so every later operation built its path as `<plugins.dir>/<id>`: enabling failed with a missing entry file and left the plugin in `ERROR`, uninstalling deleted the storage directory and reported success while the code stayed on disk and reloaded on the next boot, updating renamed a directory that was not there, and the config UI answered `404`. Each plugin now carries the directory it was loaded from, and installing still writes to the configured one.
-
-- Auto-starting previously authenticated sessions no longer delays the HTTP listener. NestJS binds the port only after every bootstrap hook has finished, and the auto-start loop launches one engine at a time with a 2s throttle, each bounded only by the engine-init timeout of at least 60 seconds — so a host with several sessions kept the port closed, not merely unhealthy, for minutes. The Helm chart's liveness budget is roughly 50 seconds and the Docker `HEALTHCHECK` encodes the same expectation, so a restart could be killed before it ever answered, and no probe budget can cover a bound that grows with the session count. The launches now run after the port is open; a shutdown that lands mid-run stops the remaining launches and waits for the one in flight. A failure of the session scan itself is now logged instead of aborting startup.
+- The engine parity check no longer skips optional interface members. `probeLiveness?()` did not match its member pattern, so the capability matrix could omit any optional method while the check reported green.
+- `.env.example` and the troubleshooting FAQ no longer name a specific WhatsApp Web build to pin with `WWEBJS_WEB_VERSION`; the build they named has been withdrawn, and one the registry no longer serves is silently ignored. Both now point at the registry's `html/` folder.
+- A WhatsApp Web build that cannot be resolved from the wa-version registry is now reported (`web_version_resolve_failed`) with the reason, the registry URL and the remedy; an unreachable registry previously continued without a pin and logged nothing.
+- `POST /sessions/:id/pairing-code` answers `409` while a whatsapp-web.js session is still starting up, instead of a `500` carrying a raw `TypeError`; a code requested straight after `POST /start` landed in the Chromium launch window. It is now accepted only from `qr_ready`.
+- A burst of inbound media messages no longer loses the media of everything past the eighth: the Baileys download queue was capped at its active slots, making admission a constant 8 whatever the batch size. It is now unbounded.
+- The JavaScript SDK reports why a production gateway rejected a request instead of ending its error message in `[object Object]`; NestJS omits `error` from the envelope under `disableErrorMessages`, the default when `NODE_ENV=production` and `VALIDATION_ERROR_DETAIL` is unset.
+- Stopping or deleting a session id that does not exist no longer leaves an entry in the teardown-mark set, which nothing could clear and which grew by one for every such `404`.
+- A plugin loaded from the legacy plugins directory can be enabled, uninstalled and updated like any other, and its config UI loads; every operation built its path as `<plugins.dir>/<id>` while the package was elsewhere, so enabling left it in `ERROR` and uninstall silently kept the code.
+- Auto-starting previously authenticated sessions no longer delays the HTTP listener; NestJS binds the port only after every bootstrap hook finishes, so a host with several sessions kept the port closed past the Helm chart's liveness budget and the Docker `HEALTHCHECK`.
### Security
-- An advisory usage-statistics write no longer persists the whole API-key row. A key deleted while a request that had already loaded it was in flight was re-inserted with its original hash and authenticated again; a revocation or a narrowing of role, allowlist, IP allowlist or expiry was likewise reverted to the values that request loaded. The write is now scoped to the two usage columns and affects nothing if the row is gone.
+- An advisory usage-statistics write no longer persists the whole API-key row: a key deleted mid-request was re-inserted and authenticated again, and a revocation or a narrowing of role, allowlist, IP allowlist or expiry was reverted. The write is now scoped to the two usage columns.
- `.env.example` no longer ships `ENABLE_SWAGGER=true` uncommented: the template also declares `NODE_ENV=production`, so copying it pinned the opt-in that production withholds and served the schema and running version at `/api/docs`, which sits outside the API-key guard. Bare-metal operators who already copied it should check their own `.env`; Docker and Helm are unaffected.
## [0.15.0] - 2026-08-09