logo
In-app Chat
ZIMAudio
On this page

KickoutGroupUser

POST

https://zim-api.zego.im/

Remove users from a group by specifying user IDs.

Note
  • User IDs in the group can be obtained through Query group member list.
  • If the removed user is the group owner, the first user in the group list will automatically become the new group owner.

After successfully removing users, all group members (including the group owner and the removed members) will receive group member status change notifications through the ZIM SDK callback interface:

iOSAndroidmacOSWindows
groupMemberStateChangedonGroupMemberStateChangedgroupMemberStateChangedonGroupMemberStateChanged
WebMini ProgramFlutterReact Native
groupMemberStateChangedgroupMemberStateChangedonGroupMemberStateChangedgroupMemberStateChanged
Unity3Duni-app | uni-app xHarmonyOS
OnGroupMemberStateChangedgroupMemberStateChangedgroupMemberStateChanged
Note
The users corresponding to the parameters FromUserId and UserId have logged in to the ZIM service by calling the login method on the client, or have completed registration by calling the server-side API.
Note
The parameters FromUserId, GroupId, UserId[], and CustomReason only support numbers, English characters, and '!','#','$','%','&','(',')','+','\'',':',';','<','=','.','>','?', '@','[',']','^','_','{','}','|','~'.
QPS Limit
20 times/s

Request

Query Parameters

    Action stringrequired

    Possible values: [KickoutGroupUser]

    API prototype parameter

    https://zim-api.zego.im/?Action=KickoutGroupUser

    AppId uint32required

    💡Public parameter. Application ID, assigned by ZEGOCLOUD. Get it from the ZEGOCLOUD Admin Console.

    SignatureNonce stringrequired

    💡Public parameter. A 16-character hexadecimal random string (hex encoding of 8-byte random number). Refer to Signature example for how to generate.

    Timestamp int64required

    💡Public parameter. Current Unix timestamp, in seconds. Refer to Signature example for how to generate, with a maximum error of 10 minutes.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Default value: 2.0

    💡Public parameter. Signature version number.

    Signature stringrequired

    💡Public parameter. Signature, used to verify the legitimacy of the request. Refer to Signing the requests for how to generate an API request signature.

Body

required
    FromUserId stringrequired

    Possible values: <= 32 characters

    Operator user ID.

    GroupId stringrequired

    Possible values: <= 32 characters

    Group ID.

    UserId string[]required

    Possible values: <= 50

    List of user IDs to be removed. Maximum support for 50 user IDs.

    Example: "UserId": ["usera","userb"].

    CustomReason string

    Reason for removal, maximum 32 bytes.

Responses

OK
Schema
    Code number

    Return code.

    The following only lists the Code and SubCode related to the API business logic. For the complete return codes, please refer to Return codes.

    Note

    When you initiate a request to remove multiple users at the same time:

    • If 1 or more users are successfully removed, Code will return 0. In this case, please refer to the specific information in ErrorList to confirm the operation result.
    • If all users are not successfully removed, Code will return the relevant return code. For details, please refer to Return codes.
    Code / SubCodeDescriptionSuggested Solution
    660000002Parameter error.Please refer to Request and input the correct parameters.
    660000011Number of users to be removed exceeds the limit.The number should not exceed 50.
    660600001Group does not exist.Please confirm if the GroupId is correct.
    660600005Call frequency exceeds the limit.The call frequency is 20 times/s, please do not exceed the limit.
    660600008User to be removed is not in the group.The user has left the group, no action needed.
    660600009Failed to obtain group-related information.Please confirm if the GroupID is correct; if correct, please contact technical support.
    Message string

    Description of the request result.

    RequestId string

    Request ID.

    ErrorList object[]
    Failure list.
    • When Code is 0:
    • If ErrorList is empty, all specified users were removed successfully.
    • If ErrorList is not empty, it means some specified users failed to be removed. Please refer to SubCode for handling.
    • When Code is not 0:
    • If ErrorList is empty, it indicates parameter error, API frequency limit, or system error.
    • If ErrorList is not empty, it means all specified users failed to be removed.
  • Array[
  • UserId string

    User ID that failed to be removed.

    SubCode number

    Error code for removal failure. For the complete return codes, please refer to the Code description or Return codes.

  • ]

Previous

Query group member list

Next

Transfer the group ownership

On this page

Back to top