Removes history information for a list of pages and their attachments.

Parent
Type
Path
rest/historymgr/1/cleaner/remove-history
Method
POST
Since
1.0

The service allows to selectively remove history information for a limited number of pages.

No Undo!

 

There is no undo!

It is strongly recommended to run commands only on backed up instances. Make a backup of your data before starting to work with this API! Consider to run your experiments on a copy of the production data!

Parameters

The service provides the following parameters to control the histories to be cleaned.

pageIds

The comma-separated list of identifiers of the pages whose history is to be removed.

keepCount

The number of page versions to keep, 1 (default) meaning that only the current version is kept.

Accepted values are larger than zero.

preservePattern

The pattern to match for version comments. Versions that match this pattern are preserver, that is: not removed.

Danger of loosing Versions!

 

Please note that any versions that do not match are removed. This includes versions whose comments are misspelled.

The preserve pattern is applied to all page versions that are taken into consideration. That is the versions saved with the keepCount are preserved whether they match this pattern or not.

 

Assume that important versions have a comment that starts with [important]. If you want to preserve this versions, use the following regular expression.

^\[important\].*$

Note that for this example versions with the following comments will be removed, since they do not match the example expression.

  • important: My very special version
  • [important - this is important!
  • important change

removeAttachments

Controls whether or not the attachments of versions that are not removed should also be cleaned.

If checked previous versions of attachments to pages are also removed.

attachmentKeepCount

The number of attachment versions to keep, 1 (default) meaning that only the current version is kept.

Response

The call is not started in a long running task. Therefore keep the list of pages to clean short.

Lots of pages?

 

If you need to clean an entire space or Confluence instance, use Remove Histories.