Skip to main content
Group types: CometChatGroupType.public | CometChatGroupType.password | CometChatGroupType.private Member scopes: GroupMemberScope.admin | GroupMemberScope.moderator | GroupMemberScope.participant
Create groups for multi-user conversations. You can create a group on its own with createGroup(), or create one and add members in a single call with createGroupWithMembers(). See the Group Class reference at the bottom for all available fields.

Create a Group

In other words, as a logged-in user, how do I create a public, private or password-protected group?
Available via: SDK | REST API | UI Kits
Use createGroup() to create a new group. Pass a Group object with the group details.

Parameters

On Success — A Group object containing all details of the newly created group:Group Object:
On success, returns a Group object with the created group’s details.
GUID can be alphanumeric with underscore and hyphen. Spaces, punctuation and other special characters are not allowed.

Add Members While Creating a Group

Use createGroupWithMembers() to create a group and add members in one operation.

Parameters

Create a GroupMember with: GroupMember(uid: "UID", scope: GroupMemberScope.participant)
On Success — A Group object containing all details of the newly created group:Group Object:

Group Class

The Group object has the following fields. Fields marked “Yes” in the Editable column can be modified after creation using updateGroup().

Next Steps

Join a Group

Join public, private, or password-protected groups

Add Members

Add users to an existing group

Retrieve Groups

Fetch and filter group lists

Groups Overview

Overview of all group management features