Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

fix: close the remaining review findings across config, proxy, pacing, automation and the SDKs

Yudhi Armyndharis9f323cb2447d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ad4e0e332..22f62bb1d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,13 +12,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Autoreply rules** — per-session single-message autoreplies under `/api/sessions/:id/automation-rules`; conditions use the webhook filter format, the reply goes through the normal send path, and `fromMe`/freshness/per-chat-cooldown guards bound reply loops.
- **Message & chat management** — pin/unpin and star/unstar messages, archive/unarchive chats, clear a chat without deleting it, and vote on polls (whatsapp-web.js).
- **Contacts, groups & channels** — save/edit/remove addressbook contacts; read/set/remove a group picture; `memberAddMode` group setting; preview a group from its invite code before joining; create/delete/mute channels.
-- **Labels** — create, rename, recolour and delete labels; two read-only label agent tools for MCP.
+- **Labels** — create, rename, recolour and delete labels; eight label agent tools for MCP (four read-only, four write).
- **Presence & calls** — subscribe to presence (`presence.update`, online/typing) and receive call-outcome events (`call.accepted`, `call.rejected`, `call.missed`).
- **Send options** — `linkPreview` toggle on `send-text`, plus a caller-supplied `customLinkPreview` on Baileys.
- **Media & status** — server-side media conversion (audio→Ogg/Opus, video→MP4) via `ffmpeg` (`MEDIA_CONVERSION_ENABLED`); post an audio status as a voice note; archive chat media to the file store and fetch it back after delivery (`CHAT_MEDIA_ARCHIVE_ENABLED`).
- **Opt-in send pacing** (`SEND_PACING_ENABLED`) — warm-up ramp, daily caps, a failure breaker, and a cold-reachout budget that also bounds group participant adds; enforcement is recorded in the audit log.
- **Account restrictions surfaced** — WhatsApp-imposed restrictions appear on the session (API + `session.restriction` webhook + dashboard badge) instead of a generic error.
-- **Horizontal-scaling groundwork (opt-in)** — sessions record their owning process via a renewed lease so two replicas cannot both start one; a dead node's sessions are adopted automatically once the lease lapses (`SESSION_TAKEOVER_SWEEP_MS`); session-scoped requests are forwarded to the owning node when each node sets `NODE_URL`; and WebSocket events fan out across replicas when `REDIS_ENABLED=true`.
+- **Horizontal-scaling groundwork (opt-in)** — sessions record their owning process via a renewed lease so two replicas cannot both start one; a node only reaps the in-flight bulk batches of sessions it may claim, and a data import reports the sessions another node is running; a dead node's sessions are adopted automatically once the lease lapses (`SESSION_TAKEOVER_SWEEP_MS`); session-scoped requests are forwarded to the owning node when each node sets `NODE_URL`; and WebSocket events fan out across replicas when `REDIS_ENABLED=true`.
### Changed
@@ -35,6 +35,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- A media-storage root the app cannot write to is caught at boot with a clear error, instead of failing on the first write (#1066).
- The bundled `docker-compose.yml` now forwards the `SEND_PACING_*`, `MEDIA_CONVERSION_*`/`FFMPEG_PATH` and session-ownership (`NODE_ID`, `NODE_URL`, lease/sweep) variables — previously these features could not be enabled from `.env` in a compose deployment at all.
- The four label write tools (`LabelUpsert`, `LabelDelete`, `LabelAddToChat`, `LabelRemoveFromChat`) answered `Internal error` over MCP even though the write had succeeded on WhatsApp, prompting agents to retry a completed operation; they now return `{ success: true }`.
+- **Boot validation covers the lease and routing knobs.** A heartbeat that does not fit inside the lease TTL (renewals landing after the claim lapsed, so peers adopt sessions from a healthy node), a `NODE_URL` without a scheme, and a non-positive media-conversion knob are now boot errors instead of silent fallbacks or a 500 on the first forward. Forwarded responses also relay the owner's `Retry-After`/`X-RateLimit-*`, and an unusable owner URL answers 503 rather than 500.
+- **Autoreply rules gain a per-session cap** (`AUTOMATION_MAX_PER_SESSION`, default 32), matching the webhook cap: every inbound message is evaluated against every rule of its session.
+- The cold-reachout probe recognises a bare phone number, so a known contact passed without a JID suffix is no longer charged as a stranger; a voice status accepts `backgroundColor`; and a graceful shutdown no longer logs a handful of Redis unsubscribe errors.
- **Security (multi-node routing only): the session forwarder could be aimed at any origin.** HTTP/1.1's absolute-form request target (`GET http://elsewhere/api/sessions/x`) is matched by the router and left verbatim in the request URL, where resolving it against the owner's address discards that address — an authenticated caller could make a node forward their request, API key attached, to an origin of their choosing and read the response. The forward target is now rebuilt from the owner's origin plus the request's path and query, so the destination cannot be influenced at all. Deployments without `NODE_URL` (the default) were never affected: the forwarder is inert there.
- **`stop` and `delete` are fenced against a session a live peer is running.** Only `start` was claim-checked, and neither of those two needs a local engine, so a request landing on the wrong node — routine when session ownership is configured but request routing is not — wrote `disconnected` over a peer's live session or deleted its row and credentials while the peer's engine kept running. Both now answer 409; a lapsed claim still proceeds, since taking over is what the claim rule allows.
- **Multi-node ownership races closed:** a `stop` landing while a `start` is mid-launch no longer hands back the claim under a live engine (which left the engine unclaimed and startable a second time elsewhere), a failed start no longer pins its session to that node forever, and a deliberate teardown of a session whose crashed owner's lease had lapsed now really leaves it down instead of being re-adopted by the takeover sweep. Successful forwarded requests also stop logging a spurious error.
diff --git a/dashboard/src/pages/Sessions.tsx b/dashboard/src/pages/Sessions.tsx
index f96dabbab..e0103b47d 100644
--- a/dashboard/src/pages/Sessions.tsx
+++ b/dashboard/src/pages/Sessions.tsx
@@ -59,6 +59,8 @@ export function Sessions() {
const queryClient = useQueryClient();
const [sessions, setSessions] = useState<Session[]>([]);
const [loading, setLoading] = useState(true);
+ // The full-page spinner belongs to the FIRST load only (see fetchSessions).
+ const initialLoadDone = useRef(false);
const [error, setError] = useState<string | null>(null);
const [searchQuery, setSearchQuery] = useState('');
const [statusFilter, setStatusFilter] = useState('all');
@@ -70,7 +72,10 @@ export function Sessions() {
const fetchSessions = useCallback(async (): Promise<Session[]> => {
try {
- setLoading(true);
+ // Background refetches — a websocket push, a mutation reloading the list — would otherwise
+ // replace the whole page with a spinner for the length of a round-trip, so a restriction
+ // arriving on a live page reads as a full reload.
+ if (!initialLoadDone.current) setLoading(true);
const data = await sessionApi.list();
setSessions(data);
// Keep the shared React Query cache (read by the Dashboard via useSessionsQuery /
@@ -86,6 +91,7 @@ export function Sessions() {
setError(err instanceof Error ? err.message : t('sessions.create.errorDefault'));
return [];
} finally {
+ initialLoadDone.current = true;
setLoading(false);
}
}, [t, queryClient]);
diff --git a/docs/06-api-specification.md b/docs/06-api-specification.md
index f0a6bac10..487217519 100644
--- a/docs/06-api-specification.md
+++ b/docs/06-api-specification.md
@@ -1299,7 +1299,7 @@ Send a plain text message.
| chatId | string | Yes | non-empty | `[email protected]` or `[email protected]` |
| text | string | Yes | non-empty, max 4096 | Message text |
| mentions | string[] | No | array of WIDs | WIDs to @mention (e.g. `["[email protected]"]`). See **Mentions** below |
-| linkPreview | boolean | No | — | `false` suppresses the URL preview. See **Link previews** below |
+| linkPreview | boolean | No | — | `false` suppresses it; on Baileys `true` is required to get one. See **Link previews** below |
| customLinkPreview | object | No | `{ url, title, description? }` | Attach a preview you supply. **Baileys only.** See **Link previews** below |
```json
@@ -1310,14 +1310,16 @@ Send a plain text message.
{ "chatId": "[email protected]", "text": "see https://example.com", "linkPreview": false }
```
-**Link previews.** `linkPreview` is guaranteed **only in its suppressing direction**. Sending `false`
-stops the preview on both engines. Leaving it unset means "whatever the engine does by default", and
-the two engines genuinely differ:
+**Link previews.** Sending `false` stops the preview on both engines. The two differ on what
+happens otherwise: whatsapp-web.js lets WhatsApp Web build one in-page (free, so it is the default),
+while on Baileys the gateway must fetch the page itself — a blocking outbound request per URL before
+the message can go out — so there a preview is **opt-in**:
| | whatsapp-web.js | Baileys |
| -------------------- | --------------------------------------------------------------------- | -------------------------------------------------- |
| `linkPreview: false` | no preview | no preview |
-| unset / `true` | asks WhatsApp Web to build a preview in-page | the gateway fetches the page itself and builds one |
+| unset | asks WhatsApp Web to build a preview in-page | no preview |
+| `linkPreview: true` | asks WhatsApp Web to build a preview in-page | the gateway fetches the page itself and builds one |
| `customLinkPreview` | `501` — the library takes a boolean only, with no way to pass a title | preview attached verbatim, nothing fetched |
**How Baileys previews are generated.** Not with the library's own generator. That one delegates to
diff --git a/docs/09-testing-strategy.md b/docs/09-testing-strategy.md
index f382f57e7..4ee8d21cf 100644
--- a/docs/09-testing-strategy.md
+++ b/docs/09-testing-strategy.md
@@ -187,7 +187,7 @@ authoritative gate. Current policy:
| `src/core/agent-tools/` | 77% | 32% | 49% | 50% |
| `src/core/hooks/` | 81% | 73% | 85% | 84% |
| `src/core/plugins/` | 72% | 74% | 81% | 80% |
-| `src/database/` | 62% | 60% | 67% | 66% |
+| `src/database/` | 69% | 69% | 72% | 72% |
| `src/engine/adapters/` | 74% | 84% | 83% | 83% |
| `src/engine/identity/` | 85% | 95% | 94% | 93% |
| `src/modules/audit/` | 59% | 45% | 72% | 68% |
diff --git a/docs/13-horizontal-scaling.md b/docs/13-horizontal-scaling.md
index 7cbdee365..e7ac29558 100644
--- a/docs/13-horizontal-scaling.md
+++ b/docs/13-horizontal-scaling.md
@@ -49,6 +49,16 @@
> which is exactly how a takeover begins. Without `NODE_URL` the whole path is inert and
> single-node deployments pay nothing.
>
+> **The lease compares timestamps written by different nodes, so their clocks must agree.** Each
+> node writes `leaseExpiresAt` from its own clock and reads every other node's the same way, so a
+> node whose clock runs more than one lease TTL (default 60s) ahead sees healthy peers as lapsed and
+> will take their sessions over. Run NTP (or any time sync) on every node — the default on ordinary
+> server images — and treat a skew larger than `SESSION_LEASE_TTL_MS` as a misconfiguration.
+>
+> **A forwarded request is throttled on both nodes.** The receiving node counts it before
+> forwarding, and the owner counts it again on arrival; with `REDIS_ENABLED=true` both counts land
+> in the same shared bucket. Size the rate limits with that in mind for a routed deployment.
+>
> Forwards carry the client address in `x-forwarded-for` (inbound chain preserved, the
> observed peer appended). For an `allowedIps`-restricted key or the per-IP throttler to see
> the REAL client on forwarded calls, each node must list its peer nodes' addresses in its
@@ -188,8 +198,9 @@ services:
- DATABASE_PASSWORD=${DB_PASSWORD}
- REDIS_HOST=redis
- QUEUE_ENABLED=true
- # Operator-facing metadata only — the application does not read NODE_ID (no consumer
- # exists in src/). Useful for correlating log lines by hand, nothing more.
+ # The session-ownership identity: it names which process holds each session's engine, and
+ # it must be STABLE across restarts (a value that changes makes the restarted process a new
+ # node, which has to wait out its own previous lease). Defaults to the container hostname.
- NODE_ID={{.Node.Hostname}}-{{.Task.Slot}}
volumes:
- sessions:/app/data/sessions
@@ -345,8 +356,11 @@ spec:
- secretRef:
name: openwa-secrets
env:
- # Operator-facing metadata only — the application does not read NODE_ID (no consumer
- # exists in src/); it is retained for the future node-affinity design in 13.2.
+ # The session-ownership identity — see the compose example above. It must be STABLE
+ # across restarts, which a Deployment's pod name is NOT: use a StatefulSet (whose pod
+ # names are ordinal and stable) for a routed multi-node deployment, or pin a value per
+ # replica. A changing NODE_ID still converges (the old lease lapses and the sweep
+ # adopts), but every restart then costs one lease TTL of downtime for its sessions.
- name: NODE_ID
valueFrom:
fieldRef:
diff --git a/openapi.json b/openapi.json
index 2f0407cd6..92f7e6b93 100644
--- a/openapi.json
+++ b/openapi.json
@@ -2472,7 +2472,7 @@
"description": "The archived media bytes, served as an attachment."
},
"404": {
- "description": "Nothing archived for this message — archiving was off when it arrived, the message carries no media, the media was above the archive cap, or retention has since cleared it."
+ "description": "Nothing archived for this message — archiving was off when it arrived, the message carries no media, the media was above the archive cap, retention has since cleared it, or the message was sent BY this account (only inbound media is archived)."
}
},
"summary": "Download a message’s archived media",
@@ -4227,6 +4227,9 @@
"responses": {
"200": {
"description": "Subject updated"
+ },
+ "403": {
+ "description": "The engine refused the change — admin rights are required"
}
},
"summary": "Change group name/subject",
@@ -4271,6 +4274,9 @@
"responses": {
"200": {
"description": "Description updated"
+ },
+ "403": {
+ "description": "The engine refused the change — admin rights are required"
}
},
"summary": "Change group description",
@@ -5709,7 +5715,7 @@
"description": "The supplied media is above the media size cap."
},
"503": {
- "description": "Conversion is disabled, or the ffmpeg binary is not runnable."
+ "description": "Conversion is disabled, the ffmpeg binary is not runnable, or the conversion queue is saturated — retry shortly."
}
},
"summary": "Convert audio into a WhatsApp voice note (Ogg/Opus)",
@@ -5743,7 +5749,7 @@
"description": "The supplied media is above the media size cap."
},
"503": {
- "description": "Conversion is disabled, or the ffmpeg binary is not runnable."
+ "description": "Conversion is disabled, the ffmpeg binary is not runnable, or the conversion queue is saturated — retry shortly."
}
},
"summary": "Convert video into a WhatsApp-compatible MP4",
@@ -8245,7 +8251,7 @@
},
"linkPreview": {
"type": "boolean",
- "description": "Set `false` to suppress the URL preview. Guaranteed only in that direction: leaving it unset means whatever the engine does by default, and the engines differ — whatsapp-web.js asks WhatsApp Web to build a preview, while Baileys builds none unless its optional preview generator is installed. Sending `true` therefore does not force a preview on Baileys.",
+ "description": "Controls the URL preview, and the engines differ. On whatsapp-web.js WhatsApp Web builds one by default and `false` suppresses it. On Baileys previews are OPT-IN: `true` asks the gateway to fetch the page and attach one, while unset or `false` sends none — generating a preview is a blocking outbound fetch per URL in the text, so it is never done unless asked for.",
"example": false
},
"customLinkPreview": {
@@ -9507,6 +9513,11 @@
}
]
},
+ "backgroundColor": {
+ "type": "string",
+ "description": "Background colour as `#RRGGBB`, which WhatsApp renders behind the voice-note bubble. Baileys only — whatsapp-web.js exposes no styling for a status and ignores it.",
+ "example": "#25D366"
+ },
"recipients": {
"description": "Recipient JIDs (0–256), @c.us or @lid. Required on the Baileys engine (it posts to exactly this allow-list); ignored by whatsapp-web.js, which broadcasts to the account's status-privacy audience — omit it there.",
"example": [
diff --git a/package.json b/package.json
index 1e00ebc9b..4df41cbad 100644
--- a/package.json
+++ b/package.json
@@ -223,10 +223,10 @@
"statements": 80
},
"./src/database/": {
- "branches": 62,
- "functions": 60,
- "lines": 67,
- "statements": 66
+ "branches": 69,
+ "functions": 69,
+ "lines": 72,
+ "statements": 72
},
"./src/engine/adapters/": {
"branches": 74,
diff --git a/sdk/go/types_message.go b/sdk/go/types_message.go
index 669f3009c..2ce014e5f 100644
--- a/sdk/go/types_message.go
+++ b/sdk/go/types_message.go
@@ -1,6 +1,9 @@
package openwa
-import "net/url"
+import (
+ "encoding/json"
+ "net/url"
+)
// MessageResponse is the acknowledgement for a sent message.
type MessageResponse struct {
@@ -15,9 +18,9 @@ type SendTextRequest struct {
// Mentions lists WIDs to @mention (e.g. ["[email protected]"]). The text must
// also contain the @<number> token.
Mentions []string `json:"mentions,omitempty"`
- // LinkPreview set to false suppresses the URL preview. Guaranteed only in that direction: nil
- // means the engine default, and the engines differ — whatsapp-web.js asks WhatsApp Web to build a
- // preview, Baileys builds none unless its optional generator is installed.
+ // LinkPreview controls the URL preview. False suppresses it on both engines. Otherwise the
+ // engines differ: whatsapp-web.js builds one in-page by default, while on Baileys a preview is
+ // OPT-IN — it needs true, because generating one is a blocking outbound fetch per URL.
LinkPreview *bool `json:"linkPreview,omitempty"`
// CustomLinkPreview attaches a preview you supply instead of one fetched from the URL. Nothing is
// fetched, so it works even for a URL the gateway cannot reach. Baileys only — whatsapp-web.js
@@ -358,9 +361,24 @@ type StarMessageRequest struct {
}
// VotePollRequest casts a vote on a poll. Options are option TEXTS, not ids —
-// no engine surfaces stable per-option ids. An empty slice clears the vote.
+// no engine surfaces stable per-option ids. An empty (or nil) slice clears the vote.
type VotePollRequest struct {
ChatID string `json:"chatId"`
PollMessageID string `json:"pollMessageId"`
Options []string `json:"options"`
}
+
+// MarshalJSON encodes a nil Options as `[]` rather than `null`.
+//
+// Clearing a vote is exactly the zero-value case, and the API requires the field to be an array:
+// `null` fails validation with a 400, so the one thing the zero value should express was the one
+// thing it could not. Omitting the field would fail the same way, which is why there is no
+// `omitempty` here.
+func (r VotePollRequest) MarshalJSON() ([]byte, error) {
+ type alias VotePollRequest
+ out := alias(r)
+ if out.Options == nil {
+ out.Options = []string{}
+ }
+ return json.Marshal(out)
+}
diff --git a/sdk/go/vote_clear_test.go b/sdk/go/vote_clear_test.go
new file mode 100644
index 000000000..5f39c17cc
--- /dev/null
+++ b/sdk/go/vote_clear_test.go
@@ -0,0 +1,26 @@
+package openwa
+
+import (
+ "encoding/json"
+ "strings"
+ "testing"
+)
+
+// Clearing a vote is the zero value, and the API requires options to be an array: a nil slice
+// encoded as `null` failed validation, so the one thing the zero value should express could not be.
+func TestVotePollRequestEncodesNilOptionsAsEmptyArray(t *testing.T) {
+ body, err := json.Marshal(VotePollRequest{ChatID: "[email protected]", PollMessageID: "M1"})
+ if err != nil {
+ t.Fatalf("marshal: %v", err)
+ }
+ if !strings.Contains(string(body), `"options":[]`) {
+ t.Fatalf("expected an empty array, got %s", body)
+ }
+ body, err = json.Marshal(VotePollRequest{ChatID: "[email protected]", PollMessageID: "M1", Options: []string{"Yes"}})
+ if err != nil {
+ t.Fatalf("marshal: %v", err)
+ }
+ if !strings.Contains(string(body), `"options":["Yes"]`) {
+ t.Fatalf("expected the supplied options, got %s", body)
+ }
+}
diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/model/GroupSettings.java b/sdk/java/src/main/java/com/rmyndharis/openwa/model/GroupSettings.java
index 155606b29..c2cfd7c87 100644
--- a/sdk/java/src/main/java/com/rmyndharis/openwa/model/GroupSettings.java
+++ b/sdk/java/src/main/java/com/rmyndharis/openwa/model/GroupSettings.java
@@ -8,6 +8,14 @@ package com.rmyndharis.openwa.model;
* engine.
*/
public record GroupSettings(Boolean announce, Boolean locked, Integer ephemeralSeconds, String memberAddMode) {
+ /**
+ * Back-compat constructor for callers written against the three-component record, before
+ * {@code memberAddMode} existed. Leaves that setting untouched, which is what omitting it means.
+ */
+ public GroupSettings(Boolean announce, Boolean locked, Integer ephemeralSeconds) {
+ this(announce, locked, ephemeralSeconds, null);
+ }
+
public static Builder builder() {
return new Builder();
}
diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/model/SendTextRequest.java b/sdk/java/src/main/java/com/rmyndharis/openwa/model/SendTextRequest.java
index 693336642..3ee3cec39 100644
--- a/sdk/java/src/main/java/com/rmyndharis/openwa/model/SendTextRequest.java
+++ b/sdk/java/src/main/java/com/rmyndharis/openwa/model/SendTextRequest.java
@@ -46,7 +46,7 @@ public record SendTextRequest(
/**
* {@code false} suppresses the URL preview. Guaranteed only in that direction: unset means the
* engine default, and the engines differ — whatsapp-web.js asks WhatsApp Web to build a
- * preview, Baileys builds none unless its optional generator is installed.
+ * preview by default; on Baileys a preview is OPT-IN and needs {@code true}.
*/
public Builder linkPreview(Boolean v) {
this.linkPreview = v;
diff --git a/sdk/java/src/test/java/com/rmyndharis/openwa/resources/GroupsResourceTest.java b/sdk/java/src/test/java/com/rmyndharis/openwa/resources/GroupsResourceTest.java
index 37337064b..384d1e171 100644
--- a/sdk/java/src/test/java/com/rmyndharis/openwa/resources/GroupsResourceTest.java
+++ b/sdk/java/src/test/java/com/rmyndharis/openwa/resources/GroupsResourceTest.java
@@ -118,6 +118,18 @@ class GroupsResourceTest {
assertTrue(tx.lastRequest().body().contains("AbCdEfGhIjKl"));
}
+ // The record gained a fourth component (memberAddMode); callers written against the previous
+ // three-component constructor must keep compiling, and omitting the new setting must mean
+ // "leave it alone" rather than sending a null.
+ @Test
+ void threeComponentConstructorStillWorksAndOmitsMemberAddMode() {
+ tx.respond(200, "{\"success\":true}");
+ GroupSettings legacy = new GroupSettings(true, false, 604800);
+ assertEquals(null, legacy.memberAddMode());
+ client.groups.updateGroupSettings("s", "[email protected]", legacy);
+ assertEquals(false, tx.lastRequest().body().contains("memberAddMode"));
+ }
+
@Test
void getGroupSettingsHitsSettingsPath() {
tx.respond(200, "{\"announce\":true,\"locked\":false,\"ephemeralSeconds\":604800}");
diff --git a/sdk/javascript/src/types.ts b/sdk/javascript/src/types.ts
index 0d9ce63bf..83f621246 100644
--- a/sdk/javascript/src/types.ts
+++ b/sdk/javascript/src/types.ts
@@ -191,7 +191,7 @@ export interface SendTextRequest {
/**
* Set `false` to suppress the URL preview. Guaranteed only in that direction: unset means the
* engine default, and the engines differ — whatsapp-web.js asks WhatsApp Web to build a preview,
- * Baileys builds none unless its optional generator is installed.
+ * preview by default; on Baileys a preview is OPT-IN and needs `true` (it costs an outbound fetch).
*/
linkPreview?: boolean;
/**
diff --git a/sdk/python/openwa/types.py b/sdk/python/openwa/types.py
index 26e3fb2ce..ae52a875c 100644
--- a/sdk/python/openwa/types.py
+++ b/sdk/python/openwa/types.py
@@ -203,7 +203,7 @@ class SendTextRequest(TypedDict, total=False):
mentions: list[str]
# Set False to suppress the URL preview. Guaranteed only in that direction: unset means the
# engine default, and the engines differ -- whatsapp-web.js asks WhatsApp Web to build a preview,
- # Baileys builds none unless its optional generator is installed.
+ # preview by default; on Baileys a preview is OPT-IN and needs True (it costs an outbound fetch).
linkPreview: bool
# Attach a preview you supply yourself instead of one fetched from the URL. Nothing is fetched,
# so this works even for a URL the gateway cannot reach. Baileys only -- whatsapp-web.js takes a
diff --git a/src/config/configuration.ts b/src/config/configuration.ts
index 5b54d32fe..dd3aee1b8 100644
--- a/src/config/configuration.ts
+++ b/src/config/configuration.ts
@@ -438,6 +438,17 @@ export default () => ({
})(),
},
+ // Autoreply rules
+ automation: {
+ // Max rules per session. Every inbound message is evaluated against every rule of its session,
+ // so an unbounded count turns each message into unbounded work. Creating a NEW rule above the
+ // cap is rejected with 400; existing ones are grandfathered. Default 32; 0 disables the cap.
+ maxPerSession: (() => {
+ const n = parseInt(process.env.AUTOMATION_MAX_PER_SESSION ?? '', 10);
+ return Number.isFinite(n) && n >= 0 ? n : 32;
+ })(),
+ },
+
// Server-side media conversion (opt-in): transcodes caller-supplied audio and video into the
// shapes WhatsApp clients actually play, by running the ffmpeg binary. Nothing is converted
// implicitly — only the explicit conversion endpoints use this.
diff --git a/src/config/env.validation.spec.ts b/src/config/env.validation.spec.ts
index 997b8e98e..f89d9e753 100644
--- a/src/config/env.validation.spec.ts
+++ b/src/config/env.validation.spec.ts
@@ -296,4 +296,33 @@ describe('validateEnv', () => {
// Unset falls through to the default path (configuration.ts) — the boot-loop fix.
expect(() => validateEnv({ DATABASE_TYPE: 'sqlite' })).not.toThrow();
});
+
+ // A renewal that does not fit inside the lease renews too late to matter: the claim lapses between
+ // ticks and peers adopt sessions from a healthy node, with nothing in the logs saying why.
+ it('rejects a lease heartbeat that does not comfortably fit inside the TTL', () => {
+ expect(() => validateEnv({ SESSION_LEASE_TTL_MS: '60000', SESSION_LEASE_HEARTBEAT_MS: '50000' })).toThrow(
+ /at most half/,
+ );
+ // The defaults stand in for whatever is unset, so a lone oversized heartbeat cannot slip past.
+ expect(() => validateEnv({ SESSION_LEASE_HEARTBEAT_MS: '45000' })).toThrow(/at most half/);
+ expect(() => validateEnv({ SESSION_LEASE_TTL_MS: '20000' })).toThrow(/at most half/);
+ expect(() => validateEnv({ SESSION_LEASE_TTL_MS: '120000', SESSION_LEASE_HEARTBEAT_MS: '30000' })).not.toThrow();
+ expect(() => validateEnv({})).not.toThrow();
+ });
+
+ // The forwarder builds an absolute URL from NODE_URL; a scheme-less value only fails at the first
+ // forward, as a 500 on a request that had nothing wrong with it.
+ it('rejects a NODE_URL that is not an absolute http(s) URL', () => {
+ expect(() => validateEnv({ NODE_URL: 'localhost:2785' })).toThrow(/absolute http/);
+ expect(() => validateEnv({ NODE_URL: '10.0.0.5:2785' })).toThrow(/absolute http/);
+ expect(() => validateEnv({ NODE_URL: 'ftp://10.0.0.5' })).toThrow(/absolute http/);
+ expect(() => validateEnv({ NODE_URL: 'http://10.0.0.5:2785' })).not.toThrow();
+ expect(() => validateEnv({ NODE_URL: 'https://node-a.internal' })).not.toThrow();
+ });
+
+ it('rejects a non-positive media-conversion knob instead of silently using the default', () => {
+ expect(() => validateEnv({ MEDIA_CONVERSION_CONCURRENCY: '0' })).toThrow(/positive integer/);
+ expect(() => validateEnv({ MEDIA_CONVERSION_TIMEOUT_MS: 'abc' })).toThrow(/positive integer/);
+ expect(() => validateEnv({ MEDIA_CONVERSION_MAX_OUTPUT_BYTES: '52428800' })).not.toThrow();
+ });
});
diff --git a/src/config/env.validation.ts b/src/config/env.validation.ts
index 74655b861..ebd29f3b0 100644
--- a/src/config/env.validation.ts
+++ b/src/config/env.validation.ts
@@ -206,10 +206,49 @@ export function validateEnv(config: EnvConfig): EnvConfig {
'WEBHOOK_MAX_PAYLOAD_BYTES',
// 0 would refuse every request carrying a body (a self-DoS), so the budget is positive-only.
'INFLIGHT_BODY_BUDGET_BYTES',
+ // Media conversion: each is read with a `> 0` guard that silently falls back to the default,
+ // so a typo or a 0 quietly means "the default" instead of what the operator wrote.
+ 'MEDIA_CONVERSION_TIMEOUT_MS',
+ 'MEDIA_CONVERSION_MAX_OUTPUT_BYTES',
+ 'MEDIA_CONVERSION_CONCURRENCY',
+ // Session ownership leases, same fall-back-silently reasoning.
+ 'SESSION_LEASE_TTL_MS',
+ 'SESSION_LEASE_HEARTBEAT_MS',
+ 'SESSION_TAKEOVER_SWEEP_MS',
+ 'SESSION_PROXY_TIMEOUT_MS',
]) {
checkPositiveInt(key);
}
+ // A heartbeat that does not fit inside the lease renews too late to matter: the claim lapses
+ // between ticks, peers adopt sessions from a perfectly healthy node, and nothing in the logs says
+ // why. The defaults must be substituted for whatever is unset — validating only the key the
+ // operator happened to set would let a lone oversized heartbeat through.
+ const leaseTtlMs = Number(str('SESSION_LEASE_TTL_MS') ?? '60000');
+ const heartbeatMs = Number(str('SESSION_LEASE_HEARTBEAT_MS') ?? '20000');
+ if (Number.isInteger(leaseTtlMs) && Number.isInteger(heartbeatMs) && heartbeatMs * 2 > leaseTtlMs) {
+ errors.push(
+ `SESSION_LEASE_HEARTBEAT_MS (${heartbeatMs}) must be at most half of SESSION_LEASE_TTL_MS (${leaseTtlMs}) ` +
+ 'so a renewal that is late or fails once still lands inside the lease',
+ );
+ }
+
+ // The forwarder builds an absolute URL from this; a value without a scheme parses as something
+ // unusable (`localhost:2785` reads as the scheme `localhost:`) and only fails at the first
+ // forward, as a 500 on a request that had nothing wrong with it.
+ const nodeUrl = str('NODE_URL');
+ if (nodeUrl) {
+ let parsed: URL | undefined;
+ try {
+ parsed = new URL(nodeUrl);
+ } catch {
+ parsed = undefined;
+ }
+ if (!parsed || (parsed.protocol !== 'http:' && parsed.protocol !== 'https:')) {
+ errors.push(`NODE_URL must be an absolute http(s) URL (got "${nodeUrl}")`);
+ }
+ }
+
// Boolean feature flags read at module-eval time (app.module.ts) with a bare `=== 'true'` /
// `!== 'false'` comparison: a typo (`True`, `1`, `yes`) or trailing whitespace/CR silently
// (dis)ables the feature. Validate the RAW value — NOT a trimmed one — so `'true '` / `'true\r'`
diff --git a/src/modules/automation/automation-rules.service.ts b/src/modules/automation/automation-rules.service.ts
index afc70db93..ae4e4f108 100644
--- a/src/modules/automation/automation-rules.service.ts
+++ b/src/modules/automation/automation-rules.service.ts
@@ -1,5 +1,6 @@
-import { Injectable, NotFoundException, Optional } from '@nestjs/common';
+import { BadRequestException, Injectable, NotFoundException, Optional } from '@nestjs/common';
import { ModuleRef } from '@nestjs/core';
+import { ConfigService } from '@nestjs/config';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { createLogger } from '../../common/services/logger.service';
@@ -47,9 +48,24 @@ export class AutomationRulesService {
private readonly moduleRef?: ModuleRef,
@Optional()
private readonly lidMappingStore?: LidMappingStoreService,
+ @Optional()
+ private readonly configService?: ConfigService,
) {}
async create(sessionId: string, dto: CreateAutomationRuleDto): Promise<AutomationRule> {
+ // Per-session cap, the same shape (and softness) the webhook fan-out cap has: every inbound
+ // message is evaluated against every rule of its session, so an unbounded count turns each
+ // message into unbounded work. A concurrent create can race the count — the cap bounds
+ // amplification, it is not an invariant. Rules already above it are left alone.
+ const maxPerSession = this.configService?.get<number>('automation.maxPerSession', 32) ?? 32;
+ if (maxPerSession > 0) {
+ const existing = await this.ruleRepository.count({ where: { sessionId } });
+ if (existing >= maxPerSession) {
+ throw new BadRequestException(
+ `Automation rule limit reached for this session (${existing}/${maxPerSession}); delete one before adding another`,
+ );
+ }
+ }
const rule = this.ruleRepository.create({
sessionId,
name: dto.name,
diff --git a/src/modules/events/redis-io.adapter.ts b/src/modules/events/redis-io.adapter.ts
index 7bf679ed9..499a225be 100644
--- a/src/modules/events/redis-io.adapter.ts
+++ b/src/modules/events/redis-io.adapter.ts
@@ -90,10 +90,14 @@ export class RedisIoAdapter extends IoAdapter {
/** Close the pub/sub connections so a shutdown does not leak them. Called by Nest on app close. */
async close(server: Server): Promise<void> {
+ // Socket.IO's adapters unsubscribe from their Redis channels as the server closes. Tearing the
+ // clients down FIRST left those unsubscribes to be issued on dead clients, and each rejection
+ // surfaced as an unhandled rejection — a handful of ERROR lines on every graceful shutdown, for
+ // a shutdown that had in fact gone fine. Close the server first, then release the pair.
+ await super.close(server);
await Promise.allSettled([this.quitClient(this.pubClient), this.quitClient(this.subClient)]);
this.pubClient = undefined;
this.subClient = undefined;
- await super.close(server);
}
/**
diff --git a/src/modules/group/group.controller.ts b/src/modules/group/group.controller.ts
index 269f5f383..ebdd314a3 100644
--- a/src/modules/group/group.controller.ts
+++ b/src/modules/group/group.controller.ts
@@ -196,6 +196,7 @@ export class GroupController {
@ApiParam({ name: 'groupId', description: 'Group ID' })
@ApiBody({ type: GroupSubjectDto })
@ApiResponse({ status: 200, description: 'Subject updated' })
+ @ApiResponse({ status: 403, description: 'The engine refused the change — admin rights are required' })
async setSubject(
@Param('sessionId') sessionId: string,
@Param('groupId') groupId: string,
@@ -212,6 +213,7 @@ export class GroupController {
@ApiParam({ name: 'groupId', description: 'Group ID' })
@ApiBody({ type: GroupDescriptionDto })
@ApiResponse({ status: 200, description: 'Description updated' })
+ @ApiResponse({ status: 403, description: 'The engine refused the change — admin rights are required' })
async setDescription(
@Param('sessionId') sessionId: string,
@Param('groupId') groupId: string,
diff --git a/src/modules/media/media.controller.ts b/src/modules/media/media.controller.ts
index d92653f45..7ba09f901 100644
--- a/src/modules/media/media.controller.ts
+++ b/src/modules/media/media.controller.ts
@@ -43,7 +43,11 @@ export class MediaController {
})
@ApiResponse({ status: 400, description: 'Neither url nor base64 given, or ffmpeg refused the input.' })
@ApiResponse({ status: 413, description: 'The supplied media is above the media size cap.' })
- @ApiResponse({ status: 503, description: 'Conversion is disabled, or the ffmpeg binary is not runnable.' })
+ @ApiResponse({
+ status: 503,
+ description:
+ 'Conversion is disabled, the ffmpeg binary is not runnable, or the conversion queue is saturated — retry shortly.',
+ })
async convertVoice(@Body() dto: ConvertMediaDto) {
return this.mediaConversion.convertToVoice(dto);
}
@@ -60,7 +64,11 @@ export class MediaController {
})
@ApiResponse({ status: 400, description: 'Neither url nor base64 given, or ffmpeg refused the input.' })
@ApiResponse({ status: 413, description: 'The supplied media is above the media size cap.' })
- @ApiResponse({ status: 503, description: 'Conversion is disabled, or the ffmpeg binary is not runnable.' })
+ @ApiResponse({
+ status: 503,
+ description:
+ 'Conversion is disabled, the ffmpeg binary is not runnable, or the conversion queue is saturated — retry shortly.',
+ })
async convertVideo(@Body() dto: ConvertMediaDto) {
return this.mediaConversion.convertToVideo(dto);
}
diff --git a/src/modules/message/dto/send-message.dto.ts b/src/modules/message/dto/send-message.dto.ts
index 37409a0b9..7146b557e 100644
--- a/src/modules/message/dto/send-message.dto.ts
+++ b/src/modules/message/dto/send-message.dto.ts
@@ -77,10 +77,10 @@ export class SendTextMessageDto {
@ApiPropertyOptional({
description:
- 'Set `false` to suppress the URL preview. Guaranteed only in that direction: leaving it unset ' +
- 'means whatever the engine does by default, and the engines differ — whatsapp-web.js asks ' +
- 'WhatsApp Web to build a preview, while Baileys builds none unless its optional preview ' +
- 'generator is installed. Sending `true` therefore does not force a preview on Baileys.',
+ 'Controls the URL preview, and the engines differ. On whatsapp-web.js WhatsApp Web builds one ' +
+ 'by default and `false` suppresses it. On Baileys previews are OPT-IN: `true` asks the gateway ' +
+ 'to fetch the page and attach one, while unset or `false` sends none — generating a preview is ' +
+ 'a blocking outbound fetch per URL in the text, so it is never done unless asked for.',
example: false,
})
// Implicit conversion turns EVERY non-empty string into true, so an unguarded `false` sent as a
diff --git a/src/modules/message/message.controller.ts b/src/modules/message/message.controller.ts
index a041b40de..874eae972 100644
--- a/src/modules/message/message.controller.ts
+++ b/src/modules/message/message.controller.ts
@@ -365,7 +365,8 @@ export class MessageController {
status: 404,
description:
'Nothing archived for this message — archiving was off when it arrived, the message carries no ' +
- 'media, the media was above the archive cap, or retention has since cleared it.',
+ 'media, the media was above the archive cap, retention has since cleared it, or the message ' +
+ 'was sent BY this account (only inbound media is archived).',
})
async getChatMedia(
@Param('sessionId') sessionId: string,
diff --git a/src/modules/message/send-pacing-cold-query.spec.ts b/src/modules/message/send-pacing-cold-query.spec.ts
index b855ae2de..c65d253c4 100644
--- a/src/modules/message/send-pacing-cold-query.spec.ts
+++ b/src/modules/message/send-pacing-cold-query.spec.ts
@@ -252,6 +252,17 @@ describe('group reachouts against a real database', () => {
).resolves.toBeUndefined();
});
+ // The group endpoints accept a bare number and the engines qualify it themselves, so the probe
+ // must look under both spellings or a known contact is charged as a stranger.
+ it('does not charge for a known contact passed as a bare number', async () => {
+ await addMessage('[email protected]', YESTERDAY);
+
+ // Four participants, but the bare-number form of a known contact is not a stranger — three are.
+ await expect(
+ service.assertReachoutAllowed('s1', ['628555', '[email protected]', '[email protected]', '[email protected]']),
+ ).resolves.toBeUndefined();
+ });
+
it('counts a repeated id once', async () => {
await expect(
diff --git a/src/modules/message/send-pacing.service.ts b/src/modules/message/send-pacing.service.ts
index 67abdad93..361af6528 100644
--- a/src/modules/message/send-pacing.service.ts
+++ b/src/modules/message/send-pacing.service.ts
@@ -106,8 +106,10 @@ export class SendPacingService {
* addParticipants) persist no message row, so `countColdReachoutsToday` — which reads the messages
* table — cannot see them; without this tally each add request would get the full daily allowance
* afresh, making the cap per-request instead of per-day. In memory like the breaker (the service
- * doc explains why); it resets by UTC day and on restart, which for an anti-ban budget errs toward
- * fewer reachouts, never more.
+ * doc explains why); it resets by UTC day, and also on restart — which for this half of the budget
+ * means a restart FORGETS what was already spent and hands out the allowance again. That errs
+ * toward more reachouts, not fewer, and is the one place this feature is not restart-proof: the
+ * chat half is counted from the messages table and is.
*/
private readonly groupReachoutTally = new Map<string, { dayStartMs: number; count: number }>();
private readonly refusalSamples = new Map<string, RefusalSample>();
@@ -487,6 +489,13 @@ function dialectVariants(chatId: string): string[] {
if (lower.endsWith('@s.whatsapp.net')) {
return [chatId, chatId.slice(0, chatId.length - '@s.whatsapp.net'.length) + '@c.us'];
}
+ // A bare number is a user id with the suffix left off — the group-participant endpoints accept
+ // one and the engines qualify it themselves, so the history probe has to look under both
+ // spellings too or a contact the account already knows is charged as a stranger.
+ if (/^\d{5,}$/.test(chatId.trim())) {
+ const digits = chatId.trim();
+ return [digits, `${digits}@c.us`, `${digits}@s.whatsapp.net`];
+ }
return [chatId];
}
diff --git a/src/modules/session/session-proxy.interceptor.spec.ts b/src/modules/session/session-proxy.interceptor.spec.ts
index 8f892e33a..425b7b9e3 100644
--- a/src/modules/session/session-proxy.interceptor.spec.ts
+++ b/src/modules/session/session-proxy.interceptor.spec.ts
@@ -267,6 +267,42 @@ describe('SessionProxyInterceptor', () => {
expect(seen[1].headers['x-forwarded-for']).toBe('198.51.100.9, 10.0.0.4');
});
+ // A forwarded 429 comes from the OWNER's counters; without relaying its throttle headers the
+ // client is told to back off with no indication of for how long.
+ it('relays the owner’s throttle headers to the client', async () => {
+ const throttling = http.createServer((_req, res) => {
+ res.writeHead(429, {
+ 'content-type': 'application/json',
+ 'Retry-After-short': '7',
+ 'X-RateLimit-Remaining-short': '0',
+ });
+ res.end(JSON.stringify({ statusCode: 429 }));
+ });
+ await new Promise<void>(resolve => throttling.listen(0, '127.0.0.1', resolve));
+ const url = `http://127.0.0.1:${(throttling.address() as AddressInfo).port}`;
+
+ try {
+ const { interceptor, context, next, res } = build({ row: row({ nodeUrl: url }) });
+ await interceptor.intercept(context, next);
+
+ expect(res.status).toHaveBeenCalledWith(429);
+ expect(res.setHeader).toHaveBeenCalledWith('retry-after-short', '7');
+ expect(res.setHeader).toHaveBeenCalledWith('x-ratelimit-remaining-short', '0');
+ } finally {
+ await new Promise<void>(resolve => throttling.close(() => resolve()));
+ }
+ });
+
+ // A NODE_URL that is not a usable absolute URL is an unreachable owner, not a server fault on a
+ // request that had nothing wrong with it.
+ it('answers 503, not 500, when the owner’s recorded URL is unusable', async () => {
+ const { interceptor, context, next, res } = build({ row: row({ nodeUrl: 'node-a:2785' }) });
+
+ await interceptor.intercept(context, next);
+
+ expect(res.status).toHaveBeenCalledWith(503);
+ });
+
it('an unreachable owner answers 503 with the owner named, never a hang or a crash', async () => {
const { interceptor, context, next, handle, res } = build({
row: row({ nodeUrl: 'http://127.0.0.1:1' }),
diff --git a/src/modules/session/session-proxy.interceptor.ts b/src/modules/session/session-proxy.interceptor.ts
index 5703074e2..28f1d9c9e 100644
--- a/src/modules/session/session-proxy.interceptor.ts
+++ b/src/modules/session/session-proxy.interceptor.ts
@@ -23,7 +23,27 @@ import { normalizeIp } from '../../common/utils/ip';
const FORWARDED_REQUEST_HEADERS = ['x-api-key', 'authorization', 'content-type', 'accept'] as const;
/** The response headers relayed back. Deliberately short: hop-by-hop headers must not leak through. */
-const RELAYED_RESPONSE_HEADERS = ['content-type', 'content-disposition', 'x-content-type-options'] as const;
+const RELAYED_RESPONSE_HEADERS = [
+ 'content-type',
+ 'content-disposition',
+ 'x-content-type-options',
+ // Throttle answers come from the OWNER's counters, so the client must be told what the owner
+ // said: without these a forwarded 429 arrives with no indication of when to retry. The suffixed
+ // names are the ones the throttler actually sets (there is no bare Retry-After).
+ 'retry-after',
+ 'retry-after-short',
+ 'retry-after-medium',
+ 'retry-after-long',
+ 'x-ratelimit-limit-short',
+ 'x-ratelimit-remaining-short',
+ 'x-ratelimit-reset-short',
+ 'x-ratelimit-limit-medium',
+ 'x-ratelimit-remaining-medium',
+ 'x-ratelimit-reset-medium',
+ 'x-ratelimit-limit-long',
+ 'x-ratelimit-remaining-long',
+ 'x-ratelimit-reset-long',
+] as const;
/** Marks a request as already forwarded once. Whatever happens, it is never forwarded again. */
export const FORWARDED_HEADER = 'x-openwa-forwarded';
@@ -140,7 +160,6 @@ export class SessionProxyInterceptor implements NestInterceptor {
ownerNodeId: string,
ownerNodeUrl: string,
): Promise<void> {
- const target = forwardTarget(request.originalUrl, ownerNodeUrl);
const timeoutMs = this.configService?.get<number>('session.proxyTimeoutMs', 60_000) ?? 60_000;
const headers: Record<string, string> = { [FORWARDED_HEADER]: this.ownership?.nodeId ?? '1' };
@@ -162,6 +181,10 @@ export class SessionProxyInterceptor implements NestInterceptor {
const hasBody = !['GET', 'HEAD'].includes(request.method);
try {
+ // Inside the try: a NODE_URL that is not a usable absolute URL makes this throw, and that is
+ // an unreachable-owner condition (the 503 below names the node and the setting) — not a 500
+ // on a request that had nothing wrong with it. Boot validation rejects such a value too.
+ const target = forwardTarget(request.originalUrl, ownerNodeUrl);
const upstream = await fetch(target, {
method: request.method,
headers,
@@ -183,7 +206,7 @@ export class SessionProxyInterceptor implements NestInterceptor {
else response.end();
} catch (error) {
this.logger.warn(`Forwarding to session owner '${ownerNodeId}' failed`, {
- target,
+ ownerNodeUrl,
error: error instanceof Error ? error.message : String(error),
});
response.status(503).json({
diff --git a/src/modules/status/dto/send-media-status.dto.ts b/src/modules/status/dto/send-media-status.dto.ts
index 05c300e84..773a720f1 100644
--- a/src/modules/status/dto/send-media-status.dto.ts
+++ b/src/modules/status/dto/send-media-status.dto.ts
@@ -116,6 +116,17 @@ export class SendVoiceStatusDto {
@Type(() => StatusMediaInput)
audio!: StatusMediaInput;
+ @ApiPropertyOptional({
+ description:
+ 'Background colour as `#RRGGBB`, which WhatsApp renders behind the voice-note bubble. ' +
+ 'Baileys only — whatsapp-web.js exposes no styling for a status and ignores it.',
+ example: '#25D366',
+ })
+ @IsOptional()
+ @IsString()
+ @Matches(/^#[0-9A-Fa-f]{6}$/, { message: 'backgroundColor must be a hex color (e.g., #25D366)' })
+ backgroundColor?: string;
+
@ApiPropertyOptional({
description:
'Recipient JIDs (0–256), @c.us or @lid. Required on the Baileys engine (it posts to exactly this ' +
diff --git a/src/modules/status/status.controller.ts b/src/modules/status/status.controller.ts
index 4d1b7a1a7..e52a721b7 100644
--- a/src/modules/status/status.controller.ts
+++ b/src/modules/status/status.controller.ts
@@ -118,7 +118,10 @@ export class StatusController {
})
@ApiResponse({ status: 413, description: 'Base64 media exceeds MEDIA_DOWNLOAD_MAX_BYTES.' })
async sendVoiceStatus(@Param('sessionId') sessionId: string, @Body() dto: SendVoiceStatusDto) {
- return this.statusService.postVoiceStatus(sessionId, dto.audio, { recipients: dto.recipients });
+ return this.statusService.postVoiceStatus(sessionId, dto.audio, {
+ recipients: dto.recipients,
+ backgroundColor: dto.backgroundColor,
+ });
}
@Delete(':statusId')