Get
/api/v1/rooms.get
Get all opened rooms (all joined public & private channels and all DMs) of the authenticated user.
Changelog
Version | Description |
---|---|
0.72.0 | Added |
Header parameters
X-Auth-Token
stringRequired
The authToken
of the authenticated user.
ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired
The userId
of the authenticated user.
ExamplerbAXPnMktTFbNpwtJ
Query parameters
updatedSince
string
A date as an ISO string. When you provide the updatedSince
query parameter, then the update and remove in the response will contain only those updated and removed since the specified date and time.
Example2017-11-25T15:08:17.248Z
Responses
200
OK
Success
{
"update": [
{
"_id": "GENERAL",
"ts": "2024-02-14T14:34:49.365Z",
"t": "c",
"name": "general",
"usernames": [],
"msgs": 55,
"usersCount": 36,
"_updatedAt": "2024-07-16T08:49:34.732Z",
"u": {
"_id": "rocket.cat",
"username": "rocket.cat",
"name": "Rocket.Cat"
},
"default": true,
"lastMessage": {
"_id": "668fc2bbffe932842327c1ff",
"t": "discussion-created",
"rid": "GENERAL",
"ts": "2024-07-11T11:32:11.220Z",
"msg": "Discussion",
"u": {
"_id": "5m4hjvzCTRCqwPrD2",
"username": "Rama",
"name": "Raghav Ram"
},
"groupable": false,
"drid": "668fc2bbffe932842327c1fd",
"_updatedAt": "2024-07-11T11:32:11.220Z"
},
"lm": "2024-07-11T11:32:11.220Z"
},
{
"_id": "WbYJfC5kTArcECGkpfZ3bvXC72pobjFPLJ",
"t": "d",
"usernames": [
"user2",
"user1"
],
"usersCount": 2,
"msgs": 2,
"ts": "2024-07-10T13:48:14.998Z",
"uids": [
"WbYJfC5kTArcECGkp",
"fZ3bvXC72pobjFPLJ"
],
"default": false,
"ro": false,
"sysMes": true,
"_updatedAt": "2024-07-10T13:48:28.300Z",
"lastMessage": {
"_id": "XHjLcN3pCe8snaoTm",
"rid": "WbYJfC5kTArcECGkpfZ3bvXC72pobjFPLJ",
"msg": "again",
"ts": "2024-07-10T13:48:28.262Z",
"u": {
"_id": "fZ3bvXC72pobjFPLJ",
"username": "user1",
"name": "user1"
},
"_updatedAt": "2024-07-10T13:48:28.296Z",
"urls": [],
"mentions": [],
"channels": [],
"md": [
{
"type": "PARAGRAPH",
"value": [
{
"type": "PLAIN_TEXT",
"value": "again"
}
]
}
]
},
"lm": "2024-07-10T13:48:28.262Z"
},
{
"_id": "fZ3bvXC72pobjFPLJrocket.cat",
"t": "d",
"usernames": [
"user1",
"rocket.cat"
],
"usersCount": 2,
"msgs": 15,
"ts": "2024-02-21T02:00:01.657Z",
"uids": [
"fZ3bvXC72pobjFPLJ",
"rocket.cat"
],
"default": false,
"ro": false,
"sysMes": true,
"_updatedAt": "2024-07-17T02:00:05.203Z",
"lastMessage": {
"rid": "fZ3bvXC72pobjFPLJrocket.cat",
"msg": "*Update your Rocket.Chat*\nNew version available (6.10.0)\nhttps://github.com/RocketChat/Rocket.Chat/releases/tag/6.10.0",
"ts": "2024-07-17T02:00:05.161Z",
"u": {
"_id": "rocket.cat",
"username": "rocket.cat",
"name": "Rocket.Cat"
},
"_id": "c4PzLLTy4fDSCmm4F",
"_updatedAt": "2024-07-17T02:00:05.198Z",
"urls": [
{
"url": "https://github.com/RocketChat/Rocket.Chat/releases/tag/6.10.0",
"meta": {}
}
],
"mentions": [],
"channels": [],
"md": [
{
"type": "PARAGRAPH",
"value": [
{
"type": "BOLD",
"value": [
{
"type": "PLAIN_TEXT",
"value": "Update your Rocket.Chat"
}
]
}
]
},
{
"type": "PARAGRAPH",
"value": [
{
"type": "PLAIN_TEXT",
"value": "New version available (6.10.0)"
}
]
},
{
"type": "PARAGRAPH",
"value": [
{
"type": "LINK",
"value": {
"src": {
"type": "PLAIN_TEXT",
"value": "https://github.com/RocketChat/Rocket.Chat/releases/tag/6.10.0"
},
"label": [
{
"type": "PLAIN_TEXT",
"value": "https://github.com/RocketChat/Rocket.Chat/releases/tag/6.10.0"
}
]
}
}
]
}
]
},
"lm": "2024-07-17T02:00:05.161Z"
}
],
"remove": [],
"success": true
}
object
update
Array of object
object
_id
string
ts
string
t
string
name
string
usernames
Array of string
string
msgs
integer
usersCount
integer
_updatedAt
string
u
object
_id
string
username
string
name
string
default
boolean
lastMessage
object
_id
string
t
string
rid
string
ts
string
msg
string
alias
string | null
attachments
Array of object
object
file
object
_id
string
name
string
type
string
u
object
_id
string
username
string
name
string
groupable
boolean
drid
string
_updatedAt
string
urls
Array of object
object
url
string
meta
object
mentions
Array of object
object
channels
Array of object
object
md
Array of object
object
type
string
value
Array of object
object
type
string
value
string
lm
string
uids
Array of string
string
ro
boolean
sysMes
boolean
remove
Array of object
object
success
boolean
401
Unauthorized
Authorization Error
{
"status": "error",
"message": "You must be logged in to do this."
}
object
status
string
message
string