logo
In-app Chat
Powered Byspreading
On this page

Remove user from the room


Description

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

Rate limit: 20 requests/second

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 endpoint: https://zim-api.zego.im/?Action=KickoutRoomUser
  • Transmission protocol: HTTPS

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.

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
&<Public 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