# How to delete a group

Deleting a WhatsApp group works differently depending on your role in the chat — whether you are an administrator or a regular participant.

#### If You Are a Group Administrator

{% hint style="info" %}
If you are a group admin, you will need to remove all of its members before you can delete the group.
{% endhint %}

1. **Get a group ID and a list of group member**\
   (method: <https://whapi.readme.io/reference/getgroups> )
2. **Remove all participants**\
   `delete https://gate.whapi.cloud/groups/{GroupID}`\
   (method: <https://whapi.readme.io/reference/removegroupparticipant> )
3. **Leave the group**\
   (method: <https://whapi.readme.io/reference/leavegroup> )
4. **Delete the chat** ( If the chat is **not deleted**, it will remain visible in the application **in read-only mode** and will be returned by the **Get Groups** method with the parameter\
   `"read_only": true`)\
   (method: [https://whapi.readme.io/reference/](https://whapi.readme.io/reference/deletechat))

{% hint style="info" %}
Once all members have been removed and the administrator has left, the group is considered permanently deleted and cannot be restored.
{% endhint %}

{% code title="Remove Participant Response" %}

```json
{
    "success": true,
    "processed": [
        "99001112233@s.whatsapp.net",
        "99998887766@s.whatsapp.net"
    ],
    "failed": []
}
```

{% endcode %}

{% code title="Leave group Response" %}

```json
{
    "success": true
}
```

{% endcode %}

#### If you are a group member

1. Get a group ID&#x20;
2. Leave the group
3. Delete the chat (optional, if you want it removed from your device)

{% hint style="info" %}
This only affects your account. The group will continue to exist for other members.
{% endhint %}
