> ## 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 the Most Popular Channels
>
Retrieves the top 5 popular channels in your workspace by the number of messages sent. It highlights the number of messages sent in private channels, private chats, and public channels.
Permission required: `view-engagement-dashboard`
### Changelog
| Version | Description |
| ---------------- | ------------|
|3.1.0 | Added |
## OpenAPI
````json GET /api/v1/engagement-dashboard/messages/top-five-popular-channels
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Statistics"
},
"servers": [
{
"url": "https://apiexplorer.support.rocket.chat"
}
],
"tags": [
{
"name": "Channels Engagement"
},
{
"name": "Messages Engagement"
},
{
"name": "Statistics"
},
{
"name": "Users Engagement"
}
],
"paths": {
"/api/v1/engagement-dashboard/messages/top-five-popular-channels": {
"get": {
"tags": [
"Messages Engagement"
],
"summary": "Get the Most Popular Channels",
"description": "\n\nRetrieves the top 5 popular channels in your workspace by the number of messages sent. It highlights the number of messages sent in private channels, private chats, and public channels. \n\nPermission required: `view-engagement-dashboard` \n\n### Changelog\n| Version | Description | \n| ---------------- | ------------|\n|3.1.0 | Added |",
"operationId": "get-api-v1-engagement-dashboard-messages-top-five-popular-channels",
"parameters": [
{
"$ref": "#/components/parameters/Auth-Token"
},
{
"$ref": "#/components/parameters/UserId"
},
{
"$ref": "#/components/parameters/start"
},
{
"$ref": "#/components/parameters/end"
}
],
"responses": {
"200": {
"description": "`t` denotes the type of room where the messages are sent. The types of rooms can be any of the following:\n - `d` represents Private Chats\n - `c` represents Public Channels\n - `p` represents Private Channels\"",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"channels": {
"type": "array",
"items": {
"type": "object",
"properties": {
"messages": {
"type": "integer"
},
"t": {
"type": "string"
},
"name": {
"type": "string"
},
"usernames": {
"type": "array",
"items": {
"type": "object"
}
}
}
}
},
"success": {
"type": "boolean"
}
}
},
"examples": {
"Success Example": {
"value": {
"channels": [
{
"messages": "727",
"t": "d",
"usernames": [
"google-calendar.bot",
"pavi.kim"
]
},
{
"messages": "26",
"t": "d",
"usernames": [
"fun.baek",
"google-calendar.bot"
]
},
{
"messages": "2",
"t": "d",
"usernames": [
"test.test",
"rocket.cat"
]
},
{
"messages": "1",
"t": "d",
"usernames": [
"ria.mit",
"rocket.cat"
]
},
{
"messages": "1",
"t": "d",
"usernames": [
"janna.coelho",
"rocket.cat"
]
}
],
"success": "true"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/keyError"
},
"401": {
"$ref": "#/components/responses/authorizationError"
},
"403": {
"$ref": "#/components/responses/forbiddenError"
}
}
}
}
},
"components": {
"parameters": {
"Auth-Token": {
"name": "X-Auth-Token",
"in": "header",
"description": "The token of the authenticated user.",
"required": "true",
"schema": {
"type": "string"
},
"example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
},
"UserId": {
"name": "X-User-Id",
"in": "header",
"description": "The user ID of the authenticated user.",
"required": "true",
"schema": {
"type": "string"
},
"example": "rbAXPnMktTFbNpwtJ"
},
"start": {
"name": "start",
"in": "query",
"description": "The start date.",
"required": "true",
"schema": {
"type": "string"
},
"example": "2023-10-29T14:48:00Z"
},
"end": {
"name": "end",
"in": "query",
"description": "The end date.",
"required": "true",
"schema": {
"type": "string"
},
"example": "2023-11-05T14:48:00Z"
}
},
"responses": {
"keyError": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
}
},
"examples": {
"Missing key": {
"value": {
"success": "false",
"error": "Match error: Missing key 'start'"
}
},
"Example 2": {
"value": {
"success": "false",
"error": "Match error: Failed Match.Where validation in field start"
}
}
}
}
}
},
"authorizationError": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"status": {
"type": "string"
},
"message": {
"type": "string"
}
}
},
"examples": {
"Authorization Error": {
"value": {
"status": "error",
"message": "You must be logged in to do this."
}
}
}
}
}
},
"forbiddenError": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
}
},
"examples": {
"Permission Error": {
"value": {
"success": "false",
"error": "User does not have the permissions required for this action [error-unauthorized]"
}
}
}
}
}
}
}
}
}
````