Browse SDKs · WASM
SDKsWASM

Invite users to a group

Invite one or more users to join a specified group.

Copy

Group owners and administrators can manage group members within the permissions granted by OpenIMServer. The client can use GroupMemberRole to control which actions are shown, but the server always performs the final authorization check.

Parameters

ParameterTypeRequiredDescription
groupIDstringYesID of the target group.
reasonstringYesInvitation note. Pass an empty string if no note is needed.
userIDListstring[]YesIDs of the users to invite.
await openimsdk.inviteUserToGroup({
  groupID,
  reason: 'Invitation to join the project discussion group',
  userIDList: ['user-002', 'user-003'],
});

When the Promise resolves, the server has accepted the invitation request; it does not mean that every invited user is already present in the member list. If approval is required, an application event may occur first. Merge a user into the member list only after the user actually joins and OnGroupMemberAdded arrives. For the complete member event implementation, see List group members.