Quick Reference for AI Agents & DevelopersNote: Only group admins can delete groups. This action is permanent and cannot be undone.
Delete Group
To delete a group, use thedeleteGroup() method. The user must be an Admin of the group they are trying to delete.
- Java
- Kotlin
deleteGroup() method takes the following parameters:
| Parameter | Description |
|---|---|
GUID | The GUID of the group you want to delete |
Best Practices
Confirm Before Deleting
Confirm Before Deleting
Always prompt users to confirm deletion with a clear warning that this action is permanent and will remove all group messages and data.
Verify Admin Permissions
Verify Admin Permissions
Check the user’s scope before showing delete options. Only admins can delete groups.
Notify Members Before Deletion
Notify Members Before Deletion
Consider sending a notification or message to group members before deleting the group to give them time to save important information.
Troubleshooting
Delete Failed - Insufficient Permissions
Delete Failed - Insufficient Permissions
Symptom:
deleteGroup() fails with “Insufficient permissions” error.Cause: User is not an admin of the group.Solution: Only group admins can delete groups. Check the user’s scope using group.getScope() before attempting deletion.Delete Failed - Group Not Found
Delete Failed - Group Not Found
Symptom:
deleteGroup() fails with “Group not found” error.Cause: The group GUID is incorrect or the group has already been deleted.Solution: Verify the GUID is correct and the group still exists by fetching it first using retrieve-groups.