HOWTO: Use the Trash Feature

Updated: January 2, 2020

This page is scheduled for review and update. Check back soon for updated content!

Java API and General Concepts

Trash feature is managed by TrashService.

You can easily trash/untrash document model with trashDocument/untrashDocument. When you trash a document, Nuxeo Server performs the following operations:

  • document is renamed to avoid collision with further document
  • ecm:isTrashed property is set to true
  • documentTrashed is fired

As you can see, the trash stated is owned by the system property ecm:isTrashed. You can access its value with DocumentModel#isTrashed method.


public void testTrashFeature(TrashService trashService, DocumentModel docModel) {
  docModel.isTrashed(); // true
  docModel.isTrashed(); // false


You can use the Trash feature with the Automation REST API.

You can use following operations Document.Trash, Document.Untrash.


curl -u Administrator:Administrator -XPOST -H "Content-Type: application/json" http://localhost:8080/nuxeo/site/automation/Document.Trash -d '{"input":"doc:/some/document"}'

The returned JSON document will have ecm:isTrashed set to true in its properties.

We'd love to hear your thoughts!

All fields required