Deleting history of a channel is returning error


In our rocket chat we have several channels that we need to purge in a scheduled time. So, as we don’t need to purge them all, the feature of the retention policy in the administration settings isn’t useful

We are trying to test it using postman, in one tab we use this api call
(As Get) https://chat.url/api/v1/

And we get this response
200 ok
“channel”: {
“_id”: “S6c****TMJjS”,
“fname”: “channel-to-purge”,
“customFields”: {},
“description”: “”,
“broadcast”: false,
“encrypted”: false,
“name”: “channel-to-purge”,

So, in another tab we use this api call (according with this reference)
(As Post) https://chat.url/api/v1/rooms.cleanHistory?roomId=S6c****TMJjS&oldest=2022-07-12T15:12:01.611Z&latest=2024-01-01T00:00:00.000Z

And the response is
400 bad request

    "success": false,
    "error": "The parameter \"roomId\" or \"roomName\" is required [error-roomid-param-not-provided]",
    "errorType": "error-roomid-param-not-provided"

As I highlighted in bold, we are using the same id that the api call retrieves, so, why is this error message jumping?

Thank you and regards

Server Setup Information

  • Version of Rocket.Chat Server: 6.5.0
  • NodeJS Version: v14.21.3
  • MongoDB Version: 5.0.23 / wiredTiger (oplog Habilitada)
  • Proxy: nginx
  • Firewalls involved: none