open-wa
DocsAPI reference

Groups Client API

Generated client method reference for the groups namespace.

Groups Client API

This page documents 22 schema-registry client methods in the groups namespace.

addParticipant

Add participant to group

Signature client.addParticipant(groupId: string, contactId: string): Promise<boolean>

Usage

const result = await client.addParticipant("447123456789-1445627445@g.us", "447123456789@c.us");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<boolean>

Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionupdate
Functionalityboth
Positional parameter ordergroupId, contactId
AliasesaddGroupParticipant, groups.addParticipant
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/groups/addParticipantaddParticipantActive
AliasPUT/api/addGroupParticipantaddGroupParticipantActive
AliasPUT/api/addParticipantaddParticipantActive

approveGroupJoinRequest

Approve group join request

Signature client.approveGroupJoinRequest(groupId: string, contactId: string): Promise<string \| boolean>

Usage

import { SocketClient } from '@open-wa/socket-client';

const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.approveGroupJoinRequest({
  groupId: "447123456789-1445627445@g.us",
  contactId: "447123456789@c.us",
});

Parameters

Prop

Type

Returns

PropValue
Return typePromise<string | boolean>

Resolves to string \| boolean. A rejected Promise indicates input validation or dispatch failure.

This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionupdate
Functionalityboth
Positional parameter ordergroupId, contactId
Aliasesgroups.approveJoinRequest
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/groups/approveJoinRequestapproveGroupJoinRequestActive
AliasPUT/api/approveGroupJoinRequestapproveGroupJoinRequestActive
Restricted

createGroup

Create new group

Signature client.createGroup(name: string, contacts: string[]): Promise<GroupCreationResult \| null>

Usage

const result = await client.createGroup("name", ["447123456789@c.us"]);

Parameters

Prop

Type

Returns

PropValue
Return typePromise<GroupCreationResult | null>
GroupCreationResultView fields

Resolves to GroupCreationResult \| null. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<{ gid: GroupId } \| null>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionsend
Functionalityboth
Positional parameter ordername, contacts
Aliasesgroups.create
Deprecated aliases-
Licenserestricted
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPOST/api/groups/createcreateGroupActive
AliasPOST/api/createGroupcreateGroupActive

demoteParticipant

Demote participant from admin

Signature client.demoteParticipant(groupId: string, contactId: string): Promise<boolean \| string>

Usage

const result = await client.demoteParticipant("447123456789-1445627445@g.us", "447123456789@c.us");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<boolean | string>

Resolves to boolean \| string. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionupdate
Functionalityboth
Positional parameter ordergroupId, contactId
AliasesdemoteGroupParticipant, groups.demoteParticipant
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/groups/demoteParticipantdemoteParticipantActive
AliasPUT/api/demoteGroupParticipantdemoteGroupParticipantActive
AliasPUT/api/demoteParticipantdemoteParticipantActive

getAllGroups

Get all groups

Signature client.getAllGroups(withNewMessagesOnly?: boolean): Promise<Chat[]>

Usage

import { SocketClient } from '@open-wa/socket-client';

const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getAllGroups();

Parameters

Prop

Type

Returns

PropValue
Return typePromise<Chat[]>
ChatView fields

Resolves to Chat[]. A rejected Promise indicates input validation or dispatch failure.

This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API. Serialized chat returned by chat lookups and listings. Its id is an opaque ChatId; additional WhatsApp Web fields may be present.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionread
Functionalityboth
Positional parameter orderwithNewMessagesOnly
Aliasesgroups.all, groups.getAll, groups.list, listGroups
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/groups/getAllgetAllGroupsActive
AliasGET/api/getAllGroupsgetAllGroupsActive
AliasGET/api/groups/allgroups.allActive
AliasGET/api/groups/listgroups.listActive
AliasGET/api/listGroupslistGroupsActive

getGroupAdmins

Get group admins

Signature client.getGroupAdmins(groupId: string): Promise<ContactId[]>

Usage

import { SocketClient } from '@open-wa/socket-client';

const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getGroupAdmins({
  groupId: "447123456789-1445627445@g.us",
});

Parameters

Prop

Type

Returns

PropValue
Return typePromise<ContactId[]>
ContactIdView fields

Resolves to ContactId[]. A rejected Promise indicates input validation or dispatch failure.

This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API. Opaque WhatsApp contact identifier. Preserve the exact value returned by the API.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionread
Functionalityboth
Positional parameter ordergroupId
Aliasesgroups.getAdmins
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/groups/getAdminsgetGroupAdminsActive
AliasGET/api/getGroupAdminsgetGroupAdminsActive

getGroupInfo

Get group metadata

Signature client.getGroupInfo(groupId: string): Promise<GroupMetadata \| null>

Usage

const result = await client.getGroupInfo("447123456789-1445627445@g.us");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<GroupMetadata | null>
GroupMetadataView fields

Resolves to GroupMetadata \| null. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<GroupMetadata \| null>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionread
Functionalityboth
Positional parameter ordergroupId
Aliasesgroups.getInfo
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/groups/getInfogetGroupInfoActive
AliasGET/api/getGroupInfogetGroupInfoActive

Get group invite link

Signature client.getGroupInviteLink(groupId: string): Promise<string>

Usage

const result = await client.getGroupInviteLink("447123456789-1445627445@g.us");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<string>

Resolves to string. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<string>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionread
Functionalityboth
Positional parameter ordergroupId
Aliasesgroups.getInviteLink
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/groups/getInviteLinkgetGroupInviteLinkActive
AliasGET/api/getGroupInviteLinkgetGroupInviteLinkActive

getGroupMembers

Retrieves members of a group

Signature client.getGroupMembers(groupId: string): Promise<Contact[]>

Usage

const result = await client.getGroupMembers("447123456789-1445627445@g.us");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<Contact[]>
ContactView fields

Resolves to Contact[]. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<ContactId[]>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionread
Functionalityboth
Positional parameter ordergroupId
Aliasesgroups.getMembers
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/groups/getMembersgetGroupMembersActive
AliasGET/api/getGroupMembersgetGroupMembersActive

getGroupMembersId

Get group member IDs

Signature client.getGroupMembersId(groupId: string): Promise<ContactId[]>

Usage

import { SocketClient } from '@open-wa/socket-client';

const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getGroupMembersId({
  groupId: "447123456789-1445627445@g.us",
});

Parameters

Prop

Type

Returns

PropValue
Return typePromise<ContactId[]>
ContactIdView fields

Resolves to ContactId[]. A rejected Promise indicates input validation or dispatch failure.

This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API. Opaque WhatsApp contact identifier. Preserve the exact value returned by the API.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionread
Functionalityboth
Positional parameter ordergroupId
AliasesgetGroupMemberIds, groups.getMemberIds, groups.getMembersId
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/groups/getMemberIdsgetGroupMembersIdActive
AliasGET/api/getGroupMemberIdsgetGroupMemberIdsActive
AliasGET/api/getGroupMembersIdgetGroupMembersIdActive
AliasGET/api/groups/getMembersIdgroups.getMembersIdActive

getKickedGroups

Get groups where kicked

Signature client.getKickedGroups(): Promise<GroupChatId[]>

Usage

import { SocketClient } from '@open-wa/socket-client';

const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getKickedGroups();

Parameters

This method does not define input parameters.

Returns

PropValue
Return typePromise<GroupChatId[]>
GroupChatIdView fields

Resolves to GroupChatId[]. A rejected Promise indicates input validation or dispatch failure.

This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API. Opaque group conversation identifier returned by a group lookup or join method.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionread
Functionalityboth
Positional parameter order-
Aliasesgroups.getKicked
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/groups/getKickedgetKickedGroupsActive
AliasGET/api/getKickedGroupsgetKickedGroupsActive
Restricted

Join group via invite link

Signature client.joinGroupViaLink(link: string, returnChatObj?: boolean): Promise<GroupChatId \| boolean \| number \| Chat>

Usage

const result = await client.joinGroupViaLink("link");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<GroupChatId | boolean | number | Chat>
ChatView fields
GroupChatIdView fields

Resolves to GroupChatId \| boolean \| number \| Chat. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<GroupId \| boolean \| number>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionsend
Functionalityboth
Positional parameter orderlink, returnChatObj
Aliasesgroups.join, groups.joinViaLink, joinGroup
Deprecated aliases-
Licenserestricted
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPOST/api/groups/joinjoinGroupViaLinkActive
AliasPOST/api/groups/joinViaLinkgroups.joinViaLinkActive
AliasPOST/api/joinGroupjoinGroupActive
AliasPOST/api/joinGroupViaLinkjoinGroupViaLinkActive

leaveGroup

Leave a group

Signature client.leaveGroup(groupId: string): Promise<void>

Usage

const result = await client.leaveGroup("447123456789-1445627445@g.us");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<void>

Resolves to void. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionupdate
Functionalityboth
Positional parameter ordergroupId
Aliasesgroups.leave
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/groups/leaveleaveGroupActive
AliasPUT/api/leaveGroupleaveGroupActive

promoteParticipant

Promote participant to admin

Signature client.promoteParticipant(groupId: string, contactId: string): Promise<boolean \| string>

Usage

const result = await client.promoteParticipant("447123456789-1445627445@g.us", "447123456789@c.us");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<boolean | string>

Resolves to boolean \| string. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionupdate
Functionalityboth
Positional parameter ordergroupId, contactId
Aliasesgroups.promoteParticipant, promoteGroupParticipant
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/groups/promoteParticipantpromoteParticipantActive
AliasPUT/api/promoteGroupParticipantpromoteGroupParticipantActive
AliasPUT/api/promoteParticipantpromoteParticipantActive

rejectGroupJoinRequest

Reject group join request

Signature client.rejectGroupJoinRequest(groupId: string, contactId: string): Promise<string \| boolean>

Usage

import { SocketClient } from '@open-wa/socket-client';

const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.rejectGroupJoinRequest({
  groupId: "447123456789-1445627445@g.us",
  contactId: "447123456789@c.us",
});

Parameters

Prop

Type

Returns

PropValue
Return typePromise<string | boolean>

Resolves to string \| boolean. A rejected Promise indicates input validation or dispatch failure.

This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionupdate
Functionalityboth
Positional parameter ordergroupId, contactId
Aliasesgroups.rejectJoinRequest
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/groups/rejectJoinRequestrejectGroupJoinRequestActive
AliasPUT/api/rejectGroupJoinRequestrejectGroupJoinRequestActive

removeParticipant

Remove participant from group

Signature client.removeParticipant(groupId: string, contactId: string): Promise<boolean>

Usage

const result = await client.removeParticipant("447123456789-1445627445@g.us", "447123456789@c.us");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<boolean>

Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionupdate
Functionalityboth
Positional parameter ordergroupId, contactId
Aliasesgroups.removeParticipant, removeGroupParticipant
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/groups/removeParticipantremoveParticipantActive
AliasPUT/api/removeGroupParticipantremoveGroupParticipantActive
AliasPUT/api/removeParticipantremoveParticipantActive

Revoke group invite link

Signature client.revokeGroupInviteLink(groupId: string): Promise<string \| boolean>

Usage

const result = await client.revokeGroupInviteLink("447123456789-1445627445@g.us");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<string | boolean>

Resolves to string \| boolean. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<string \| boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionupdate
Functionalityboth
Positional parameter ordergroupId
Aliasesgroups.revokeInviteLink
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/groups/revokeInviteLinkrevokeGroupInviteLinkActive
AliasPUT/api/revokeGroupInviteLinkrevokeGroupInviteLinkActive

setGroupDescription

Set group description

Signature client.setGroupDescription(groupId: string, description: string): Promise<boolean>

Usage

const result = await client.setGroupDescription("447123456789-1445627445@g.us", "description");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<boolean>

Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionupdate
Functionalityboth
Positional parameter ordergroupId, description
Aliasesgroups.setDescription
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/groups/setDescriptionsetGroupDescriptionActive
AliasPUT/api/setGroupDescriptionsetGroupDescriptionActive

setGroupEditToAdminsOnly

Restrict group editing to admins only

Signature client.setGroupEditToAdminsOnly(groupId: string, onlyAdmins: boolean): Promise<boolean>

Usage

import { SocketClient } from '@open-wa/socket-client';

const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.setGroupEditToAdminsOnly({
  groupId: "447123456789-1445627445@g.us",
  onlyAdmins: true,
});

Parameters

Prop

Type

Returns

PropValue
Return typePromise<boolean>

Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.

This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionupdate
Functionalityboth
Positional parameter ordergroupId, onlyAdmins
Aliasesgroups.setEditAdminsOnly, groups.setEditToAdminsOnly
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/groups/setEditAdminsOnlysetGroupEditToAdminsOnlyActive
AliasPUT/api/groups/setEditToAdminsOnlygroups.setEditToAdminsOnlyActive
AliasPUT/api/setGroupEditToAdminsOnlysetGroupEditToAdminsOnlyActive

setGroupIcon

Set group icon

Signature client.setGroupIcon(groupId: string, image: string): Promise<boolean>

Usage

const result = await client.setGroupIcon("447123456789-1445627445@g.us", "image");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<boolean>

Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionupdate
Functionalityboth
Positional parameter ordergroupId, image
Aliasesgroups.setIcon
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/groups/setIconsetGroupIconActive
AliasPUT/api/setGroupIconsetGroupIconActive

setGroupTitle

Set group title

Signature client.setGroupTitle(groupId: string, title: string): Promise<boolean>

Usage

const result = await client.setGroupTitle("447123456789-1445627445@g.us", "title");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<boolean>

Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.

In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionupdate
Functionalityboth
Positional parameter ordergroupId, title
Aliasesgroups.setTitle
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/groups/setTitlesetGroupTitleActive
AliasPUT/api/setGroupTitlesetGroupTitleActive

setGroupToAdminsOnly

Restrict group to admins only

Signature client.setGroupToAdminsOnly(groupId: string, onlyAdmins: boolean): Promise<boolean>

Usage

import { SocketClient } from '@open-wa/socket-client';

const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.setGroupToAdminsOnly({
  groupId: "447123456789-1445627445@g.us",
  onlyAdmins: true,
});

Parameters

Prop

Type

Returns

PropValue
Return typePromise<boolean>

Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.

This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.

Advanced method metadata

Overview

PropValue
Namespacegroups
Actionupdate
Functionalityboth
Positional parameter ordergroupId, onlyAdmins
Aliasesgroups.setAdminsOnly, groups.setToAdminsOnly
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/groups/setAdminsOnlysetGroupToAdminsOnlyActive
AliasPUT/api/groups/setToAdminsOnlygroups.setToAdminsOnlyActive
AliasPUT/api/setGroupToAdminsOnlysetGroupToAdminsOnlyActive

Was this helpful?

Your answer includes the page path and docs version.

On this page