# 6.9 Remove Group Members

The `removeGroupMembers` function is used to remove a list of members from the Group. Any existing member of the group can remove other members. 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 remove members from the group).

The function takes the following parameters :

* **sessionId** : Unique SessionId which is received in the registration/login function response.
* **groupId**  :  GroupId of the group.
* **groupMembers** : List of members to be removed from the group.

{% tabs %}
{% tab title="C++" %}

```cpp
#include "BayunCore.h"

std::vector<Bayun::GroupMember> groupMembers;
Bayun::GroupMember groupMember1("<companyEmployeeId>", "<companyName>");
Bayun::GroupMember groupMember2("<companyEmployeeId>", "<companyName>");
groupMembers.push_back(groupMember1);
groupMembers.push_back(groupMember2);
Bayun::ShAddGroupMemberResponse response = bayunCore->removeGroupMembers("<sessionId>",
 groupId, groupMembers);
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://bayun.gitbook.io/bayuncoresdk-cpp/groups/remove-group-members.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
