Clear Room History

Prev Next
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
9.1.0 Added the ignoreDiscussionOrigin parameter.
0.67.0 Added fields limit, excludePinned, filesOnly and users
0.64.0 Added
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

If true, discussions aren't pruned. By default, the value is false.

Defaultfalse
ignoreDiscussionOrigin
boolean

If true, keeps the message each discussion started from, and its file. Takes effect only when ignoreDiscussion is true. Applies to discussions started after the workspace was updated; older discussions are pruned as before. By default, the value is false.

Defaultfalse
ignoreThreads
boolean

If true, threads aren't pruned. By default, the value is false.

Defaultfalse
Responses
200

OK

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

Unauthorized

Authorization Error
{
  "success": false,
  "error": "You must be logged in to do this."
}
object
success
boolean
error
string