> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-llms-scoped-indexes.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update A Group

> Update group details such as name, description, icon, and metadata using the CometChat Flutter SDK.

<Accordion title="AI Integration Quick Reference">
  ```dart theme={null}
  // Update a group
  Group group = Group(guid: "GROUP_ID", name: "New Name", type: CometChatGroupType.public);
  group.description = "Updated description";
  group.icon = "https://example.com/icon.png";

  await CometChat.updateGroup(
    group: group,
    onSuccess: (Group group) => debugPrint("Updated: ${group.name}"),
    onError: (CometChatException e) => debugPrint("Error: ${e.message}"),
  );
  ```
</Accordion>

Update a group's name, icon, description, or metadata. The GUID and group type cannot be changed after creation. See the [Group Class](/sdk/flutter/create-group#group-class) reference for all editable fields.

## Update Group

*In other words, as a group owner, how can I update the group details?*

You can update the existing details of the group using the `updateGroup()` method. Pass a [`Group`](/sdk/reference/entities#group) object with the updated values.

<Note>
  **Available via:** SDK | [REST API](https://api-explorer.cometchat.com) | [UI Kits](/ui-kit/flutter/overview)
</Note>

### Parameters

| Parameter | Type | Description |
| - | - | - |
| `group` | `Group` | An instance of the [`Group`](/sdk/reference/entities#group) class with updated values |
| `onSuccess` | `Function(Group group)?` | Callback triggered on successful group update |
| `onError` | `Function(CometChatException excep)?` | Callback triggered on error |

<Tabs>
  <Tab title="Dart">
    ```dart theme={null}
    String GUID = "GUID";
      String groupName = "Hello Group!";
      String groupType = CometChatGroupType.public;
      String password = "";

      Group _group = Group(guid: GUID, name: groupName, type: groupType);


      await CometChat.updateGroup(group: _group, onSuccess: (Group group ){
        debugPrint("Group Created Successfully : $group ");
      }, onError:(CometChatException e) {
        debugPrint("Group Creation failed with exception: ${e.message}");
      } );   
    ```
  </Tab>
</Tabs>

<Accordion title="Response">
  **On Success** — A `Group` object containing all details of the updated group:

  <span id="update-group-group-object" style={{scrollMarginTop: '100px'}} />

  **Group Object:**

  | Parameter | Type | Description | Sample Value |
  | - | - | - | - |
  | `guid` | string | Unique identifier for the group | `"cometchat-guid-1"` |
  | `name` | string | Display name of the group | `"Hello Group!"` |
  | `icon` | string | URL of the group icon | `null` |
  | `description` | string | Description of the group | `null` |
  | `membersCount` | number | Number of members in the group | `5` |
  | `metadata` | object | Custom metadata attached to the group | `{}` |
  | `joinedAt` | number | Epoch timestamp when the logged-in user joined the group | `1745554729` |
  | `hasJoined` | boolean | Whether the logged-in user has joined the group | `true` |
  | `createdAt` | number | Epoch timestamp when the group was created | `1745554729` |
  | `owner` | string | UID of the group owner | `"cometchat-uid-1"` |
  | `updatedAt` | number | Epoch timestamp when the group was last updated | `1745554800` |
  | `tags` | array | List of tags associated with the group | `[]` |
  | `type` | string | Type of the group (public, private, password) | `"public"` |
  | `scope` | string | Scope of the logged-in user in the group | `"admin"` |
  | `password` | string | Password for password-protected groups | `null` |
  | `isBannedFromGroup` | boolean | Whether the logged-in user is banned from the group | `false` |
</Accordion>

<Accordion title="Error">
  | Parameter | Type | Description | Sample Value |
  | - | - | - | - |
  | `code` | string | Error code identifier | `"ERR_GUID_NOT_FOUND"` |
  | `message` | string | Human-readable error message | `"The specified group does not exist."` |
  | `details` | string | Additional technical details | `"Please provide a valid GUID for the group."` |
</Accordion>

After the successful update of the group, you will receive an instance of `Group` class containing updated information of the group.

For more information on the `Group` class, please check [here](/sdk/flutter/create-group#group-class).

<Note>
  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()`.
</Note>

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Delete Group" icon="trash" href="/sdk/flutter/delete-group">
    Permanently delete a group
  </Card>

  <Card title="Retrieve Groups" icon="magnifying-glass" href="/sdk/flutter/retrieve-groups">
    Fetch and filter groups with pagination
  </Card>

  <Card title="Create Group" icon="plus" href="/sdk/flutter/create-group">
    Create new public, private, or password-protected groups
  </Card>

  <Card title="Groups Overview" icon="users" href="/sdk/flutter/groups-overview">
    Overview of all group management features
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.