How to Delete Documents

→ "Try it out - API Component "YADB""
→ check GitHub Python calls | Java Script calls | Java calls | Postman collection


This "How to" describes how to delete documents using yuuvis® API. This action requires basic knowledge of import and store documents using the yuuvis® API.


Deleting a Document

To delete a document from the system, you send a DELETE request to the URL /dms-core/objects/{objectId} using the corresponding objectId ("Delete document by ID" endpoint).
Your request will delete the metadata record and, if present, the content file itself.

Deleting a Document
Request deleteRequest = new Request.Builder()
        .header("Ocp-Apim-Subscription-Key", key)
        .url(baseUrl + "/dms-core/objects/" + objectId)
        .delete().build()

Response Codes

Status Code Meaning
200 OK The stored document (object) with this objectId has been deleted.
404 Not Found The document (object) with this objectId can not be found.
409 Conflict The document (object) with this objectId could not be deleted due to retention.

Deleting a Version of a Document

To delete a version of a document from the system, you send a DELETE request to the URL /dms-core/objects/{objectId}/versions/{versionNr} using the corresponding objectId as well as the versionNr.
The used version number must exist for the document (object). Note that if the version number indicates the current version of the document, the entire document - including all its versions - will be deleted.

Deleting a Version of a Document
 Request deleteVersionRequest = new Request.Builder()
        .header("Ocp-Apim-Subscription-Key", key)
        .url(baseUrl + "objects/"+objectId+"/versions/1")
        .delete().build();
Response deleteVersionResponse = client.newCall(deleteVersionRequest).execute();

Deleting a Link Document

Stored documents (objects) usually consist of the content file and the metadata record. During the import you can also create so called link document: the contentStreams object refers to existing content in the system. Thus it just refers to an already stored content file but has its own metadata record.

Note that if you delete such a link document (object) the corresponding content file is deleted in the entire system and is also no longer available for the originally imported document.

Deleting Compound Documents

For deleting compound documents please refer to "Compound Documents". It describes what compound documents are and what to consider when deleting compound documents.