Clear Room History

Post
/api/v1/rooms.cleanHistory

Cleans up a room by removing messages from the provided time range. For details, see the Prune messages from a room section.

Permission required: clean-channel-history

Changelog

Version Description
0.64.0 Added
0.67.0 Added fields limit, excludePinned, filesOnly and users
Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Body parameters
Example
{
  "roomId": "roomId",
  "latest": "2016-12-09T13:42:25.304Z",
  "oldest": "2016-08-30T13:42:25.304Z"
}
object
roomId
string Required

The room ID.

latest
string Required

The end of time range of messages.

oldest
string Required

The start of the time range of messages.

inclusive
boolean

Whether messages which land on the latest and oldest dates should be included. By default, the value is false.

excludePinned
boolean

Whether pinned messages should be deleted. By default, the value is false.

filesOnly
boolean

Whether to only delete files and keep messages intact. By default, the value is false.

users
Array of string

Specific set of users whose content to delete. By default, the value is [], that is, everyone.

string
limit
integer

The amount of messages to prune. By default, the value is 0 (all).

ignoreDiscussion
boolean

Determines if messages from discussions should be pruned. By default, the value is true.

ignoreThreads
boolean

Determines if messages from threads should be pruned. By default, the value is true.

Responses
200

OK

Success
{
  "success": true
}
object
success
boolean
401

Unauthorized

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