> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Change Member Scope

> Update CometChat group member scopes with the Android SDK to manage participant, moderator, and admin roles.

> [accordion] AI Integration Quick Reference
>
> ```kotlin theme={null}
> // Change member scope (admin only)
> CometChat.updateGroupMemberScope(
>     "UID", 
>     "GUID", 
>     CometChatConstants.SCOPE_MODERATOR,
>     object : CallbackListener<String>() {
>         override fun onSuccess(message: String) { }
>         override fun onError(e: CometChatException) { }
>     })
> ```
>
> **Available Scopes:**
>
> * `SCOPE_ADMIN` - Full control over group
> * `SCOPE_MODERATOR` - Can moderate members and content
> * `SCOPE_PARTICIPANT` - Regular member (default)
>
> **Note:** Only group admins can change member scopes.

## Change Scope of a Group Member

Use `updateGroupMemberScope()` to change a member's role. Only group **Admins** can change scopes.

> [tab] Java
>
> ```java theme={null}
> private String GUID = "GUID";
> private String UID = "UID";
> private String scope = CometChatConstants.SCOPE_ADMIN;
>
> CometChat.updateGroupMemberScope(UID, GUID, scope, new CometChat.CallbackListener<String>() {
>   @Override
>   public void onSuccess(String successMessage) {
>     Log.d(TAG, "User scope updated successfully");
>   }
>
>   @Override
>   public void onError(CometChatException e) {
>     Log.d(TAG, "User scope update failed with exception: " + e.getMessage());
>   }
> });
> ```

> [tab] Kotlin
>
> ```kotlin theme={null}
> val GUID: String = "GUID"
> val UID: String = "UID"
> val scope: String = CometChatConstants.SCOPE_ADMIN
>
> CometChat.updateGroupMemberScope(UID, GUID, scope, object:CometChat.CallbackListener<String>(){
>   override fun onSuccess(p0: String?) {
>     Log.d(TAG, "User scope updated successfully")
>   }
>
>   override fun onError(p0: CometChatException?) {
>     Log.d(TAG, "User scope update failed with exception: " + p0?.message)
>   }
> })
> ```

This method takes the below parameters:

| Parameter | Description |
| - | - |
| `UID` | The UID of the member whose scope you would like to change |
| `GUID` | The GUID of the group for which the member's scope needs to be changed |
| `scope` | the updated scope of the member. This can be either of the 3 values: 1.`CometChatConstants.SCOPE_ADMIN` (admin) 2.`CometChatConstants.SCOPE_MODERATOR` (moderator) 3.`CometChatConstants.SCOPE_PARTICIPANT` (participant) |

The default scope of any member is `participant`. Only the **Admin** of the group can change the scope of any participant in the group.

## Real-Time Group Member Scope Changed Events

When a member's scope changes, group members receive a real-time event in `onGroupMemberScopeChanged()` of the `GroupListener` class. The callback provides an [`Action`](https://www.cometchat.com/docs/sdk/reference/messages#action) object, the updating [`User`](https://www.cometchat.com/docs/sdk/reference/entities#user), the updated [`User`](https://www.cometchat.com/docs/sdk/reference/entities#user), and the [`Group`](https://www.cometchat.com/docs/sdk/reference/entities#group).

> [tab] Java
>
> ```java theme={null}
> CometChat.addGroupListener(YourActivity.class.getSimpleName(), new CometChat.GroupListener() {
>   @Override
>   public void onGroupMemberScopeChanged(Action action, User updatedBy, User updatedUser, String scopeChangedTo, String scopeChangedFrom, Group group) {
>
>   }
> });
> ```

> [tab] Kotlin
>
> ```kotlin theme={null}
> CometChat.addGroupListener("ListenerID", object : CometChat.GroupListener() {
>   override fun onGroupMemberScopeChanged(action: Action, updatedBy: User, updatedUser: User, scopeChangedTo: String, scopeChangedFrom: String, group: Group) {
>
>   }
> })
> ```

## Missed Group Member Scope Changed Events

When fetching message history, scope changes appear as [`Action`](https://www.cometchat.com/docs/sdk/reference/messages#action) messages with these fields:

1. `action` - `scopeChanged`
2. `actionOn` - [`User`](https://www.cometchat.com/docs/sdk/reference/entities#user) object containing the details of the user whos scope has been changed
3. `actionBy` - [`User`](https://www.cometchat.com/docs/sdk/reference/entities#user) object containing the details of the user who changed the scope of the member
4. `actionFor` - [`Group`](https://www.cometchat.com/docs/sdk/reference/entities#group) object containing the details of the group in which the member scope was changed
5. `oldScope` - The original scope of the member
6. `newScope` - The updated scope of the member

> [!WARNING]
>
> Always remove group listeners when they're no longer needed (e.g., in `onDestroy()` or when navigating away). Failing to remove listeners can cause memory leaks and duplicate event handling.

***

## Next Steps

> [card] [Add Members](https://www.cometchat.com/docs/sdk/android/v4/group-add-members.md)
>
> Add new members with specific scopes

> [card] [Kick Member](https://www.cometchat.com/docs/sdk/android/v4/group-kick-member.md)
>
> Remove members from groups

> [card] [Transfer Ownership](https://www.cometchat.com/docs/sdk/android/v4/transfer-group-ownership.md)
>
> Transfer group ownership to another admin

> [card] [Retrieve Members](https://www.cometchat.com/docs/sdk/android/v4/retrieve-group-members.md)
>
> Fetch list of group members


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.