A room in Rocket.Chat is where conversations take place. The room object represents the details of rooms created in a workspace.
There are at least two fields on the room object.
_id
: The room/user ID (depends on the room type).t
: The room type. See the table below for details.
Properties
The Room
object has the following fields:
Field | Data type | Description |
---|---|---|
| String | The room ID. |
| String | The room type. E.g |
| String | The room’s name. |
| String | The full name of the room. |
| Number | The number of messages in the room. |
| Boolean | Indicates if the room is the default room. |
| Boolean | Indicates if the room is a broadcast room. |
| Boolean | Indicates if the room is featured. |
| String | The announcement or summary of the room. |
| Boolean | Indicates if a join code is required to enter the room. |
| String | Additional details about the room announcement, such as the style. |
| Boolean | Indicates if the room is encrypted. |
| String | The topic of the room. |
| Boolean | Indicates if reactions are allowed when the room is read-only. |
| MessageTypesValues[] | Boolean | Indicates whether system messages are enabled or an array of allowed system message types. |
| String | Information about the user who created the room ( |
| Array of string | Array of user IDs in the room. |
| Object | The last message sent in the room. |
| Date | Timestamp of the last message. |
| Number | The number of users in the room. |
| CallStatus | The status of a call in the room. |
| Date | The start time of a WebRTC call in the room. |
| String | Information about the user who served the room ( |
| String | Options for streaming content in the room ( |
| String | The primary room ID (for threads). |
| String | The ETag for the room avatar. |
| Boolean | Indicates if the room is the main room for a team. |
| String | The ID of the team the room belongs to. |
| Boolean | Indicates if the room is the default room for the team. |
| Boolean | Indicates if the room is open. |
| String | The language used for automatic translation in the room. |
| Boolean | Indicates if automatic translation is enabled for the room. |
| Number | The number of unread messages in the room. |
| Boolean | Indicates if there is an alert in the room. |
| Boolean | Indicates if the unread status is hidden. |
| Boolean | Indicates if the mention status is hidden. |
| Array of string | An array of user IDs who are muted in the room. |
| Array of string | An array of user IDs who are not muted in the room. |
| Array of string | An array of usernames in the room. |
| Date | Timestamp of when the room was created. |
| Boolean | Indicates if the room is a channel. |
| Boolean | Indicates if the room is read-only. |
| Boolean | Indicates if the room is marked as a favorite. |
| Boolean | Indicates if the room is archived. |
| String | Description or summary of the room. |
| Boolean | Indicates if the room was created as an OTR (off-the-record) room. |
| String | Key ID for end-to-end encryption in the room. |
| Boolean | (Deprecated) Indicates if the room is federated. |
| Object | (Deprecated) Custom fields for additional room information. |
| { _id: string } | Information about the channel the room belongs to. |
Room types
d
: Direct messagesc
: Public channelp
: Private channeldiscussions
: Team or channel discussionsteams
: Workspace teamsl
: Livechatv
: Omnichannel VoIP rooms
The information that comes with the room object changes according to its type.
A DM room object contains two fields:
_id
: The room ID.t
: The room type (in this case, the value isd
)
For example:
{
"_id": "room-id",
"t": "d"
}
A public chat room contains information about the room, as follows:
_id
: The room ID.t
: The room type (in this case, the value isc
).name
: The room name.u
: The room creator (it may return a null user).topic
: (Optional) The room topic.muted
: (Optional) A collection of muted users by their username.jitsiTimeout
: (Optional) If the Jitsi app is used in your workspace, this parameter may be present.
For example:
{
"_id": "room-id",
"t": "c",
"name": "room-name",
"u": { "_id": "user-id", "username": "username" },
"topic": "room-topic",
"muted": [ "username" ],
"jitsiTimeout": { "$date": 1480377601 }
}
This type of room resembles a public chat room:
_id
: The room ID.t
: The room type (in this case, the value isp
).name
: The room name.u
: The room creator (it may return a null user).topic
: (Optional) The room topic.muted
: (Optional) A collection of muted users by their username.jitsiTimeout
: (Optional) If the Jitsi app is used in your workspace, this parameter may be present.ro
: Flags if the room is read-only.
For example:
{
"_id": "room-id",
"t": "p",
"name": "room-name",
"u": { "_id": null, "username": null },
"topic": "room-topic",
"ro": false // This room is not read-only
}
The IRoom interface represents the Room object, defining the properties and their types that can be associated with a Room. Room information is stored in the rocketchat_room
collection on MongoDB.
See the IRoom interface here.
Rocket.Chat/IRoom.ts at develop · RocketChat/Rocket.Chat