Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

docs(sdk): say groups list never returns participantsCount or isAdmin

Yudhi Armyndharisb300df8fee6a
diff --git a/sdk/go/types_group.go b/sdk/go/types_group.go
index 78a3bc8b4..64a1513ad 100644
--- a/sdk/go/types_group.go
+++ b/sdk/go/types_group.go
@@ -12,9 +12,9 @@ type GroupParticipant struct {
}
// GroupSummary is the slim group shape from the list endpoint. Note that
-// ParticipantsCount and IsAdmin are stripped by the LIST endpoint on the
-// current engine and will normally be absent from the payload — use Groups.Get
-// (which returns GroupInfo) when you need them. They are pointers so a missing
+// ParticipantsCount and IsAdmin are stripped by the LIST endpoint and are
+// never returned by List, only by Create; use Groups.Get (which returns
+// GroupInfo) when you need them. They are pointers so a missing
// field decodes as nil rather than being confused with a zero-valued present
// field.
type GroupSummary struct {
diff --git a/sdk/java/src/main/java/com/rmyndharis/openwa/model/GroupSummary.java b/sdk/java/src/main/java/com/rmyndharis/openwa/model/GroupSummary.java
index 6f7c0a7f6..37008b2f6 100644
--- a/sdk/java/src/main/java/com/rmyndharis/openwa/model/GroupSummary.java
+++ b/sdk/java/src/main/java/com/rmyndharis/openwa/model/GroupSummary.java
@@ -1,10 +1,21 @@
package com.rmyndharis.openwa.model;
-/** Item returned by {@code GET /sessions/:id/groups} (the slim list shape). */
+/**
+ * Item returned by {@code GET /sessions/:id/groups} (the slim list shape), and the
+ * {@code groups.create} response.
+ */
public record GroupSummary(
String id,
String name,
+ /**
+ * Only in a {@code groups.create} response, never in {@code groups.list}; {@code groups.get}
+ * carries the participants.
+ */
Integer participantsCount,
+ /**
+ * Only in a {@code groups.create} response, never in {@code groups.list}; {@code groups.get}
+ * carries each participant's role.
+ */
Boolean isAdmin,
/** JID of the parent community, or {@code null} if standalone. */
String linkedParentJID) {}
diff --git a/sdk/python/openwa/types.py b/sdk/python/openwa/types.py
index 9c40b6070..b81d615ed 100644
--- a/sdk/python/openwa/types.py
+++ b/sdk/python/openwa/types.py
@@ -787,11 +787,13 @@ class GroupParticipant(TypedDict):
class GroupSummary(TypedDict):
- """Item returned by ``GET /sessions/:id/groups`` (the slim list shape)."""
+ """Item returned by ``GET /sessions/:id/groups`` (the slim list shape), and the ``groups.create`` response."""
id: Jid
name: str
+ # Only in a groups.create response, never in groups.list; groups.get carries the participants.
participantsCount: NotRequired[int]
+ # Only in a groups.create response, never in groups.list; groups.get carries each participant's role.
isAdmin: NotRequired[bool]
linkedParentJID: NotRequired[str | None]