Remove group members
Description
Remove users in the group by specifying their user IDs.
User IDs in the group can be obtained by Query group member list.
After a user is successfully removed, all group members (including the group owner and the removed member) will receive a ZIM SDK callback interface:
iOS | Android | macOS | Windows |
---|---|---|---|
groupMemberStateChanged | onGroupMemberStateChanged | groupMemberStateChanged | onGroupMemberStateChanged |
Web | Flutter | Reactive Native | Unity3D |
groupMemberStateChanged | onGroupMemberStateChanged | groupMemberStateChanged | OnGroupMemberStateChanged |
Operation prototype
- Request method: POST
- Request endpoint:
https://zim-api.zego.im/?Action=KickoutGroupUser
- Protocol: HTTPS
- Rate limit: 20 requests/second
Request parameters
Listed below are the parameters specific to this request and part of the public request parameters. For the complete list of public request parameters, see Accessing Server APIs - Public parameters.
Parameter | Type | Required | Description |
---|---|---|---|
FromUserId | String | Yes | User ID of the operator. |
GroupId | String | Yes | Group ID. |
UserId[] | Array of String | Yes | A list of user IDs to be removed, supporting up to 50 user IDs. Example: "UserId": ["usera","userb"] |
CustomReason | String | No | The reason for removal, with a length limit of 32 bytes. |
FromUserId, GroupId, UserId[], and CustomReason only support numbers, English characters, and '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ', ',']', '^', '_', '{', '|', '}', '~', and ' '.
Sample request
-
Sample request URL:
Untitledhttps://zim-api.zego.im/?Action=KickoutGroupUser &<public request parameter>
1 -
Request body:
Untitled{ "FromUserId":"zego_user", "GroupId":"groupA", "CustomReason":"reason", "UserId":["userA"] }
1
Response parameters
Parameter | Type | Description |
---|---|---|
Code | Number | Return code.
Note If you remove multiple users at the same time:
|
Message | String | The description information of the request result. |
RequestId | String | Request ID. |
ErrorList | Array of String | A list of failed operations. |
└UserId | String | User ID of the removal failure. |
└SubCode | Number | Error code of the removal failure. |
Sample response
{
"Code":0,
"Message":"success",
"RequestId":"343649807833778782",
"ErrorList": [
{
"UserId":"u2",
"SubCode":660000012
}
]
}
Return codes
The following table describes only the return codes related to the business logic of the operation. For the complete list of return codes, see Return codes.
Return Code | Description | Processing Suggestions |
---|---|---|
660000002 | Parameter error. | Please refer to the correct parameters in Request Parameters. |
660000011 | The number of users to be removed exceeds the limit. | The number should not exceed 50. |
660600001 | The group does not exist. | Please confirm the GroupId is correct. |
660600005 | The call frequency of the KickoutGroupUser interface exceeds the limit. | The rate limit is 20 requests/second, please do not exceed the limit. |
61103 | The user to be removed is not in the group. | No need to process. |