Skip to main content
Quick Reference - Delete a group:
await CometChat.deleteGroup("GUID");
Available via: SDK | REST API

Delete a Group

To delete a group you need to use the deleteGroup() method. The user must be an Admin of the group they are trying to delete.
var GUID = "GUID";

CometChat.deleteGroup(GUID).then(
response => {
  console.log("Groups deleted successfully:", response);
}, error => {
  console.log("Group delete failed with exception:", error);
}
);  
The deleteGroup() method takes the following parameters:
ParameterDescription
GUIDThe GUID of the group you would like to delete

Best Practices

Deleting a group is irreversible — all messages, members, and metadata are permanently removed. Always prompt the user for confirmation before calling deleteGroup().
The logged-in user must have Admin scope on the group. Verify the user’s scope using getGroup() before attempting deletion to provide a better UX.

Troubleshooting

Verify the logged-in user is an Admin of the group. Owners and Moderators may not have delete permissions depending on your app configuration.
Ensure the deleteGroup() promise resolved successfully. If using cached data, refresh your group list after deletion to remove stale entries.

Next Steps