logo
Video Call
Server API
Stream Mixing and Transcoding APIs
On this page

CloseRoom

GET

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

This API removes all users from the Room and closes the Room.

If the developer has configured Logged Out Callback and Stream Destroyed Callback according to Callback Configuration Guide, when the server calls this API:

  • The server will receive Logged Out Callback notifications, allowing the developer to track user logout events from the Room.
  • The status of Streams in the original Room will be closed, and the server will receive Stream Destroyed Callback, allowing the developer to be informed about Stream closure in the Room.

After the Room is closed, client users will be kicked out of the Room and will receive ZEGOCLOUD SDK callback interfaces:

ZegoExpress SDKLiveRoom SDK
iOS/macOSonRoomStateChangedonKickout
AndroidonRoomStateChangedonKickout
WindowsonRoomStateChangedOnKickOut
WebroomStateChangedonKickout
Rate Limit
All Rooms under the same AppID: 1 time/second (test environment: 1 time/second)

Request

Query Parameters

    Action stringrequired

    Possible values: [CloseRoom]

    API Prototype Parameter

    https://rtc-api.zego.im?Action=CloseRoom

    AppId uint32required

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

    SignatureNonce stringrequired

    💡Common parameter. A 16-character hexadecimal random string (hex-encoded 8-byte random number). For the generation algorithm, refer to the signature example.

    Timestamp int64required

    💡Common parameter. Current Unix timestamp in seconds. For the generation algorithm, refer to the signature example. A maximum deviation of 10 minutes is allowed.

    Signature stringrequired

    💡Common parameter. Signature used to verify the legitimacy of the request. Please refer to the signature mechanism to generate it.

    SignatureVersion stringrequired

    Possible values: [2.0]

    Default value: 2.0

    💡Public parameter. Signature version number.

    RoomId stringrequired

    Room ID.

    CustomReason string

    Reason for closing, with a maximum length of 256 bytes. When using, URL encoding (UrlEncode) must be performed on its content.

    RoomCloseCallback boolean

    Whether to generate Room Close Callback. Since this is usually an active closure initiated by the developer, no separate Room Close Callback notification will be sent to the developer. If you need to use Room Close Callback for unified logic processing, you can change it to true.

    📌 Note

    This parameter only affects whether Room Close Callback is generated. Callback notifications for Room closure due to other reasons (such as Logged Out Callback) are not affected.

Responses

Operation successful
Schema
    Code int32

    Return code. The following only lists some return codes related to API business logic. For complete return codes, please refer to Global Return Codes.

    Return CodeDescriptionSuggested Action
    5018Room has been destroyed or does not exist.Please confirm whether the requested RoomId exists.
    5024Room does not exist, with the same internal judgment logic as 104 and 50001.Please confirm whether the requested RoomId exists.
    Message string

    Description of operation result.

    RequestId string

    Request ID.

Previous

DescribeSimpleStreamList

Next

KickoutUser

On this page

Back to top