Skip to main content
// Update group details
const group = new CometChat.Group("GUID", "New Name", CometChat.GROUP_TYPE.PUBLIC);
const updated = await CometChat.updateGroup(group);
Update a group’s name, icon, description, or metadata. The GUID and group type cannot be changed after creation. See the Group Class reference for all editable fields.

Update Group

Use updateGroup() to modify group details. Pass a Group object with the updated values.
const GUID: string = "GUID";
const groupName: string = "Hello Group!";
const groupType: string = CometChat.GROUP_TYPE.PUBLIC;

const group: CometChat.Group = new CometChat.Group(GUID, groupName, groupType);

CometChat.updateGroup(group).then(
  (group: CometChat.Group) => {
      console.log("Group details updated successfully:", group);
  }, (error: CometChat.CometChatException) => {
      console.log("Group details update failed with exception:", error);
  }
);
ParameterDescription
groupAn instance of Group class with updated values
On success, returns a Group object with the updated details.
There is no real-time event listener for group updates. To get the latest group information after calling updateGroup(), fetch the group details again using getGroup().

Next Steps

Delete Group

Permanently delete a group

Retrieve Groups

Fetch and filter groups with pagination