> For the complete documentation index, see [llms.txt](https://bayun.gitbook.io/bayuncoresdk-ios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bayun.gitbook.io/bayuncoresdk-ios/6-groups/6.9-delete-group.md).

# 7.12 Delete Group

The `deleteGroup:success:failure` method is used to delete a group the user is a member of. Any existing member of the group can delete the group. The developer can choose to build stricter access-control mechanisms on top of this if desired (e.g. only the group-owner or group-admin is authorized to delete the group).

**Method parameters :**

* **groupId** : Group Id of the Group.
* **success** : Success block to be executed after group is deleted.
* **failure** : Failure block to be executed if group could not be deleted, returns `BayunError`.

{% tabs %}
{% tab title="Objective-C" %}

```objectivec
[[BayunCore sharedInstance]deleteGroup: @"groupId" success:^{
   NSLog(@"Group deleted successfully"); 
} failure:^(BayunError error) {
   NSLog(@"Error deleting the group"); 
}];
```

{% endtab %}

{% tab title="Swift" %}

```swift
BayunCore.sharedInstance().deleteGroup("groupId", success: {
   NSLog("Group deleted successfully")
}, failure: {(bayunErrorCode)in
   NSLog("Error deleting the group")
})
```

{% endtab %}
{% endtabs %}
