Statistics

Prev Next

On the Rocket.Chat’s workspace UI, the Workspace page and the Engagement dashboard provide insights into your workspace and usage activities. You can also view your workspace statistics using the following endpoints:

The statistics object

Statistics endpoints return a workspace statistics object with many counters. A trimmed example from Get Last Statistics:

{
  "_id": "v3D4mvobwfznKozH8",
  "uniqueId": "wD4EP3M7FeFzJdgku",
  "version": "8.7.0",
  "installedAt": "2023-07-10T16:44:58.548Z",
  "totalUsers": 24,
  "activeUsers": 22,
  "onlineUsers": 2,
  "totalRooms": 91,
  "totalChannels": 43,
  "totalPrivateGroups": 27,
  "totalDirect": 20,
  "totalLivechat": 1,
  "totalMessages": 796,
  "success": true
}

Fields you use most often:

  • version: The Rocket.Chat server version of the workspace.

  • uniqueId: The permanent identifier of the workspace. _id identifies one statistics snapshot.

  • totalUsers, activeUsers, onlineUsers: User counts by lifecycle and presence.

  • totalRooms and its breakdown (totalChannels, totalPrivateGroups, totalDirect, totalLivechat): Room counts by type.

Statistics API

  • View your workspace details, such as the version and number of users, and messages.

Monitor a workspace

  1. Get the last statistics for the current snapshot of users, rooms, messages, and version. Pass refresh=true to force a fresh calculation.

  2. Get the statistics list to compare historical snapshots over time.

Users engagement API

  • View the number of new and active users.

  • View the number of users and chat analytics by hour and week.

Track user engagement and busy periods

  1. Get new users and active users for a date range.

  2. Get users by time of the day to see when your users are online.

  3. Get hourly data or weekly data on when chat is busier.

Messages engagement API

  • View the number of messages sent within a specific time duration.

  • View the most popular channels by number of messages sent.

  • You can also view the origin of messages sent during a specific period.

Track message engagement

  1. Get the number of sent messages for a date range, and the origin of messages sent.

  2. Get the most popular channels, or get channels engagement to rank all channels by message volume.

Channels engagement API

  • View all channels in your workspace and the number of messages in each channel within a specific period.

Subscriptions API

  • Mark a channel as read or unread.

  • View the number of unread messages.

Conventions

  • Statistics endpoints require the view-statistics permission.

  • Engagement endpoints take start and end date query parameters in ISO 8601 format to define the reporting period.

  • Get Statistics List supports count, offset, sort, and query query parameters.