Get Reported Messages

Retrieves all the reported messages grouped by users. It supports the Pagination parameters.

It requires the view-moderation-console permission.

URL

Requires Auth

HTTP Method

/api/v1/moderation.reportsByUsers

yes

GET

Headers

ArgumentExampleRequiredDescription

X-User-Id

myuser-name

Required

The authenticated user ID.

X-Auth-Token

myauth-token

Required

Auth token.

Query Parameter

ArgumentExampleRequiredDescription

oldest

2021-09-30T09:33:15.621Z

Optional

It represents the oldest point in time for which you want to retrieve moderation reports

latest

2023-08-30T09:33:15.621Z

Optional

It represents the oldest point in time for which you want to retrieve moderation reports

Example Call

curl --location 'http://localhost:3000/api/v1/moderation.reportsByUsers' \
--header 'x-auth-token: aEO8Hw3zorBFQtAEYsNPnr67Li9-lY5kX1foen8UiiS' \
--header 'x-user-id: rbAXPnMktTFbNpwtJ' \
--data ''

Example Result

Success

{
    "reports": [
        {
            "rooms": [
                {
                    "_id": "6423ce62c29657e5b3ba2675rbAXPnMktTFbNpwtJ",
                    "t": "d",
                    "federated": true
                }
            ],
            "count": 1,
            "message": "hi",
            "msgId": "tDNLALSFk2LET2JZH",
            "ts": "2023-08-30T09:38:38.792Z",
            "username": "funke.olasupo",
            "name": "Funke Olasupo",
            "userId": "rbAXPnMktTFbNpwtJ",
            "isUserDeleted": false
        },
        {
            "rooms": [
                {
                    "_id": "5fRTXMt7DMJbpPJfhrbAXPnMktTFbNpwtJ",
                    "t": "d"
                }
            ],
            "count": 2,
            "message": "himm",
            "msgId": "xY8cN7yuPQfBgJ9xz",
            "ts": "2023-08-30T09:33:15.621Z",
            "username": "test.funke",
            "name": "TestFunke",
            "userId": "5fRTXMt7DMJbpPJfh",
            "isUserDeleted": false
        }
    ],
    "count": 2,
    "offset": 0,
    "total": 3,
    "success": true
}

Error

Any of the following errors can occur on the endpoint.

  • Authorization: Requires an authentication token for the request to be made.

  • Invalid UserId: Occurs when the userId is invalid or does not belong to any user in the workspace.

  • No Permission: Occurs when the authenticated user doesn't have the view-moderation-console permission.

{
    "status": "error",
    "message": "You must be logged in to do this."
}

Change Log

Version

Description

6.2.0

Added

Last updated

Rocket.Chat versions receive support for six months after release.