logo
In-app Chat
ZIMAudio
On this page

CreateRoom

POST

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

Developers can call this API to create a room. When creating a room, you can set custom room attributes. A room can have a maximum of 20 room attributes. If you need to increase the limit, please contact ZEGOCLOUD Technical Support.

QPS Limit
20 times/s

Request

Query Parameters

    Action stringrequired

    Possible values: [CreateRoom]

    API prototype parameter

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

    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, must be in registered status. This user will not automatically join the room. Only supports numbers, English characters, and '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', ' ', ',', '{'

    RoomId stringrequired

    Possible values: <= 32 characters

    Room ID. Only supports numbers, English characters, and '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', ' ', ',', '{'

    RoomName string

    Possible values: <= 64 characters

    Room name. A string with a maximum length of 64 bytes.

    DestroyDelayTime number

    Possible values: <= 10800

    When the number of people in the room is 0, the room delayed destruction time in seconds. The maximum room delayed destruction time defaults to 10800 seconds. When the room is delayed for destruction, room attributes and room user attributes are not retained by default. If you need to retain them, please contact ZEGOCLOUD Technical Support.

    Attributes object[]
    Attribute information to be added.
  • Array[
  • Key stringrequired

    Room attribute key.

    Value stringrequired

    Room attribute value.

    AutoDelete number

    Possible values: [0, 1]

    Whether to automatically delete when the user exits.

    • 0: Do not automatically delete;
    • 1: Automatically delete.
    When creating a room, FromUserId will not be added to the room. The deletion operation will only be triggered when the user first enters the room and then exits.
  • ]

Responses

OK
Schema
    Code int32

    Return status code (0 indicates success).

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

    Return codeDescriptionSolution
    660000002Parameter error.Please check the parameters.
    660300005Frequency limit.Please try again later.
    660300014Room already exists.Check if the room has already been created.
    660300015Number of rooms exceeds the limit.Check if the number of rooms exceeds the limit, or contact technical support for expansion.
    Message string

    Return status information.

    RequestId string

    Unique request identifier.

    AttributeSeq int32

    Records the total number of changes to all attributes (create, modify, delete) in the room, used to calibrate attributes and calculate the order of attribute changes. The AttributeSeq value increases by 1 each time an attribute changes.

    Note: When multiple attributes change at once, the AttributeSeq value will increase multiple times. For example, if 3 attributes are modified at once, the AttributeSeq value will increase by 3.

Previous

Delete all friends

Next

Query room attributes

On this page

Back to top