Skip to main content
Deleting a document does one of two things, and you choose which: it either moves the document to the trash, where it stays readable and can be brought back, or removes it outright. This guide walks both paths in four calls.

Before you begin

  • A document you no longer need. The examples work on a draft agreement that was never sent.

Step 1: Move the document to the trash

A plain delete is the reversible one:
Request
Response
Nothing comes back but the status: the document has been moved to the trash. It keeps its identifier, its content and its folder placements, and it stops appearing among your active documents. A transaction running on the document is cancelled shortly after the move, and restoring the document does not resume it.

Step 2: Read the trashed document

A document in the trash is still there to be read:
Request
Response
The read works exactly as before and trashed tells you the state, so your integration never has to remember what it threw away. Apart from restoring it or deleting it for good, reading is all the trash allows.
To enumerate the trash rather than check one document, search with trashed: GET /documents?trashed=true returns what is in it, while an ordinary search returns only active documents.

Step 3: Restore the document

Restoring takes the document out of the trash:
Request
Response
The document is active again, with its title, content and folder placements as they were.

Step 4: Delete the document for good

Set permanent to remove the document instead of trashing it:
Request
Response
The document is gone: reading it — or trying to restore it — now answers 404. The same call works on a document that is already in the trash, so emptying something out of it takes one request, not a restore followed by a delete.
A permanent delete cannot be undone: the document does not reach the trash and there is nothing left to restore. Reach for it only when you are certain, and prefer the plain delete everywhere else.
Folders work the same way, with one difference: a folder takes everything nested inside it along, into the trash and back out of it again — Organize documents in folders covers that.

Complete example

Emptying a draft into the trash and, once your own retention rules say so, removing it for good — as a Node.js script. Error handling is minimal for brevity — in production, inspect the error envelope of non-2xx responses.

Next steps