> ## Documentation Index
> Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt
> Use this file to discover all available pages before exploring further.
# Get Room Discussions
> Get all discussions of a room.
### Changelog
| Version | Description |
| ------- | --------------|
|9.0.0 | Removed the `fields` and `query` parameters. |
| 1.0.0 | Added |
## OpenAPI
````json GET /api/v1/rooms.getDiscussions
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Rooms"
},
"servers": [
{
"url": "https://apiexplorer.support.rocket.chat"
}
],
"tags": [
{
"name": "Channels"
},
{
"name": "Directory"
},
{
"name": "Groups"
},
{
"name": "Rooms"
},
{
"name": "Teams"
},
{
"name": "Room Invites"
},
{
"name": "Subscriptions"
},
{
"name": "ABAC"
}
],
"paths": {
"/api/v1/rooms.getDiscussions": {
"get": {
"tags": [
"Rooms"
],
"summary": "Get Room Discussions",
"description": "Get all discussions of a room. \n\n### Changelog\n| Version | Description |\n| ------- | --------------|\n|9.0.0 | Removed the `fields` and `query` parameters. |\n| 1.0.0 | Added |",
"operationId": "get-api-v1-rooms.getDiscussions",
"parameters": [
{
"$ref": "#/components/parameters/Auth-Token"
},
{
"$ref": "#/components/parameters/UserId"
},
{
"$ref": "#/components/parameters/Optional-RoomName"
},
{
"$ref": "#/components/parameters/Optional-RoomId"
},
{
"$ref": "#/components/parameters/count"
},
{
"$ref": "#/components/parameters/offset"
},
{
"schema": {
"type": "string"
},
"in": "query",
"name": "sort",
"description": "Sort the channels in ascending (`1`) or descending (`-1`) order. The value must be entered as a JSON object. The options are as follows:\n * `fname`: Sort by discussion name. For example, `sort={\"fname\":1}` (this is the default sorting mechanism).\n * `ts`: Sort by creation timestamp. For example, `sort={\"ts\":-1}`\n * `usersCount`: Sort by number of users. For example, `sort={\"usersCount\":1}`"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"discussions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"fname": {
"type": "string"
},
"_updatedAt": {
"type": "string"
},
"topic": {
"type": "string"
},
"prid": {
"type": "string"
},
"encrypted": {
"type": "boolean"
},
"name": {
"type": "string"
},
"t": {
"type": "string"
},
"msgs": {
"type": "integer"
},
"usersCount": {
"type": "integer"
},
"u": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"username": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"ts": {
"type": "string"
},
"ro": {
"type": "boolean"
},
"default": {
"type": "boolean"
},
"sysMes": {
"type": "boolean"
},
"lastMessage": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"rid": {
"type": "string"
},
"msg": {
"type": "string"
},
"ts": {
"type": "string"
},
"u": {
"type": "object",
"properties": {
"_id": {
"type": "string"
},
"username": {
"type": "string"
},
"name": {
"type": "string"
}
}
},
"_updatedAt": {
"type": "string"
},
"urls": {
"type": "array",
"items": {
"type": "object"
}
},
"mentions": {
"type": "array",
"items": {
"type": "object"
}
},
"channels": {
"type": "array",
"items": {
"type": "object"
}
},
"md": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"value": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"value": {
"type": "string"
}
}
}
}
}
}
}
}
},
"lm": {
"type": "string"
}
}
}
},
"count": {
"type": "integer"
},
"offset": {
"type": "integer"
},
"total": {
"type": "integer"
},
"success": {
"type": "boolean"
}
}
},
"examples": {
"Success": {
"value": {
"discussions": [
{
"_id": "6514d34ea2f73c7460e18cb4",
"fname": "test-discussion",
"_updatedAt": "2023-09-28T01:14:04.275Z",
"topic": "general",
"prid": "GENERAL",
"encrypted": false,
"name": "M75nSgA3uYsnTbKRu",
"t": "c",
"msgs": 1,
"usersCount": 1,
"u": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "roxie",
"name": "test test"
},
"ts": "2023-09-28T01:13:50.574Z",
"ro": false,
"default": false,
"sysMes": true,
"lastMessage": {
"_id": "pnm4kh84HfncDEZj7",
"rid": "6514d34ea2f73c7460e18cb4",
"msg": "Hi guys , this is for SWE team",
"ts": "2023-09-28T01:14:04.119Z",
"u": {
"_id": "rbAXPnMktTFbNpwtJ",
"username": "roxie",
"name": "test test"
},
"_updatedAt": "2023-09-28T01:14:04.233Z",
"urls": [],
"mentions": [],
"channels": [],
"md": [
{
"type": "PARAGRAPH",
"value": [
{
"type": "PLAIN_TEXT",
"value": "Hi guys , this is for SWE team"
}
]
}
]
},
"lm": "2023-09-28T01:14:04.119Z"
}
],
"count": 1,
"offset": 0,
"total": 1,
"success": true
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/authorizationError"
}
}
}
}
},
"components": {
"parameters": {
"Auth-Token": {
"name": "X-Auth-Token",
"in": "header",
"description": "The `authToken` of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
},
"UserId": {
"name": "X-User-Id",
"in": "header",
"description": "The `userId` of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "rbAXPnMktTFbNpwtJ"
},
"Optional-RoomName": {
"name": "roomName",
"in": "query",
"description": "The room name. It is required if the `roomId` is not provided.",
"required": false,
"schema": {
"type": "string"
},
"example": "general"
},
"Optional-RoomId": {
"name": "roomId",
"in": "query",
"description": "The room ID. It is required if the `roomName` is not provided.",
"schema": {
"type": "string"
},
"example": "dlpfuijw7ej"
},
"count": {
"name": "count",
"in": "query",
"description": "The number of items to return. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#pagination) to learn more.",
"required": false,
"schema": {
"type": "integer"
},
"example": 50
},
"offset": {
"name": "offset",
"in": "query",
"description": "Number of items to \"skip\" in the query, i.e. requests return count items, skipping the first offset items. Refer to the [official documentation](https://developer.rocket.chat/apidocs/query-parameters#pagination) to learn more.",
"required": false,
"schema": {
"type": "integer"
},
"example": 50
}
},
"responses": {
"authorizationError": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
}
},
"examples": {
"Authorization Error": {
"value": {
"success": false,
"error": "You must be logged in to do this."
}
}
}
}
}
}
}
}
}
````