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.

Audit Messages

Prev Next
Post
/api/v1/audit.messages
Premium tag

Searches messages for an audit and records the search in the audit log. This endpoint requires a license that includes the auditing module. Dates use ISO 8601 format. Requests are limited to ten per minute.

This endpoint replaces the deprecated auditGetMessages real-time method, which remains available until 9.0.0.

Permission required:

  • can-audit

Changelog

Version Description
8.8.0 Added
Header parameters
X-User-Id
stringRequired

The user ID.

ExampleCkCPNctrgCDfmWLqC
X-Auth-Token
stringRequired

The authentication token.

Example1Dd4iN_ClKn5jl-xPC36snQ4s9Zd5GZnXCQuCNSKcVE
Body parameters
Example
{
  "rid": "GENERAL",
  "startDate": "2026-08-01T00:00:00Z",
  "endDate": "2026-08-20T23:59:59.999Z",
  "users": [
    "dana.reyes"
  ],
  "msg": "incident report",
  "type": "u"
}
object
rid
string

The ID of the room to search in. Optional.

ExampleGENERAL
startDate
string (date-time) Required

The beginning of the period to search, as an ISO date string.

Example2026-08-01T00:00:00Z
endDate
string (date-time) Required

The end of the period to search, as an ISO date string.

Example2026-08-20T23:59:59.999Z
users
Array of string Required

The usernames whose messages are audited.

Example[ "dana.reyes" ]
string
msg
string | null Required

The text to search for in the messages.

Exampleincident report
type
string Required

The audit target. Use u for users, d for a direct message, or l for Omnichannel rooms. When rid is provided, the room ID determines the target.

Exampleu
visitor
string | null

The ID of the Omnichannel visitor to audit.

Example8f4c2d1e9a7b6c5d3e2f1a0b
agent
string | null

The ID of the Omnichannel agent to audit.

ExamplerbAXPnMktTFbNpwtJ
Responses
200

OK

Success Example
{
  "messages": [
    {
      "_id": "7aDSXtjMA3KPLxLjt",
      "rid": "GENERAL",
      "msg": "Please share the incident report",
      "ts": "2026-08-12T09:14:03.412Z",
      "u": {
        "_id": "rbAXPnMktTFbNpwtJ",
        "username": "dana.reyes",
        "name": "Dana Reyes"
      }
    }
  ],
  "success": true
}
Expand All
object
messages
Array of object

The messages matching the audit search.

object
_id
string
rid
string
msg
string
ts
string
u
object
_id
string
username
string
name
string
success
boolean
400

Bad Request

object
success
boolean
error
string
errorType
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string
403

Forbidden

Permission Error
{
  "success": false,
  "error": "User does not have the permissions required for this action [error-unauthorized]"
}
object
success
boolean
error
string