# 7.12 Delete Group

The `deleteGroup` function 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).

The function takes the following parameters :

* **sessionId** : Unique SessionId which is received in the login/registration function response.
* **groupId**  : Group Id of the Group.

{% tabs %}
{% tab title="JavaScript" %}

```javascript
bayunCore.deleteGroup("<sessionId>", "<groupId>")
    .then(result => {
      console.log("Response received for deleteGroup.");
      console.log(result);
})
.catch(error => {
      console.log("Error caught");
      console.log(error);
});
```

{% endtab %}
{% endtabs %}
