logo
In-app Chat

Remove users from a room


Description

By this API, you can remove the specified users from a room. When you find that a user violates the room rules, the user can be removed from the room through this method.

The client will receive notifications through the following event callbacks when an existing user is removed from the room, or in-room users leave.

PlatformUser being removed from the roomUser status changes in the room
iOS/macOSzim:roomStateChanged:event:extendedData:zim:roomMemberLeft:roomID:
AndroidonRoomStateChangedonRoomMemberLeft
WindowsonRoomStateChangedonRoomMemberLeft
WebroomStateChangedroomMemberLeft

Request method and endpoint

  • Request method: GET
  • Request URL: https://zim-api.zego.im/?Action=KickoutRoomUser
  • Transmission protocol: HTTPS
  • QPS limit: 20 requests/second

Request parameters

Listed below are the parameters specific to this request and part of the common request parameters. For the complete list of common request parameters, see Accessing Server APIs - Common parameters.

ParameterTypeRequiredDescription
RoomIdStringYesRoom ID.
UserId[]Array of StringYes

The list of user IDs to be removed, up tp 50 user IDs are supported.

For example: UserId[]=a&UserId[]=b

CustomReasonStringNoThe reason for removing the user. Shorter than 32 bytes is recommended.
Note

The RoomId and UserId can only contain numbers, letters, and the following special characters: !#$%&()+-:;<=.>?@[]^_{}|~.

Sample request

Untitled
https://zim-api.zego.im/?Action=KickoutRoomUser
&RoomId=123
&UserId[]=a&UserId[]=b
&CustomReason=reason
&<Common parameters>
1
Copied!

Response parameters

ParameterTypeDescription
CodeNumberReturn code.
MessageStringDescription of the request execution result.
RequestIdStringRequest ID.

Sample response

Untitled
{
    "Code":0,
    "Message":"success",
    "RequestId":"343649807833778782"
}
1
Copied!

Return codes

Listed below are the return codes related to this API. For the complete list of return codes, see Return codes.

Return codeDescription
660000011The number of users exceeds the limit.
660300001The room does not exist.
660300002The user is not in this room.

Previous

Obtain information about users in a room

Next

Query whether a user is in a room