Toggle menu

deleteFiles

Deletes files from the file store, either via their file identifier or via references. deleteFiles will delete a supplied reference if other references to the file exist.

By default a file will only be deleted if it is unreferenced, excluding any reference criteria supplied in the delete call. If a file is referenced by references other than those supplied in the delete call, only those references supplied in the delete call will be removed from the file - the file itself will not be removed from the store. This is to avoid deleting files that are referenced by other sources.

Request Parameters

NameTypeComments
fileIDsArray<UUID>UUID file identifiers of the files to delete. Either fileIDs or refDetails must be supplied
refDetailsList<Reference>A list of reference objects. Either fileIDs or refDetails must be supplied
deleteOnlyIfUnreferencedBoolean, optionalSet to false to override the standard behaviour and force a deletion, but keep in mind that other sources may be dependent on the file

Example Request

{
    "id": "testreq1",
    "jsonrpc": "2.0",
    "method": "deleteFiles",
    "params": {
        "fileIDs": [
            "f618b936-572f-44f1-a300-9944b5b3e2c6"
        ]
    }
}

Example Response

{
    "f618b936-572f-44f1-a300-9944b5b3e2c6": {
        "success": true,
        "fileDetails": {
            "id": "f618b936-572f-44f1-a300-9944b5b3e2c6",
            "references": [],
            "createdBy": null,
            "created": "2016-02-22T17:01Z",
            "hash": "ba44f7f8f88543fbf91f9b9eb0217cfe",
            "lastUpdatedBy": null,
            "lastUpdated": "2016-02-22T17:01Z",
            "filename": "pusheen.png",
            "type": "image/png",
            "size": 37029
        }
    }
}

Last modified on 27 June 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon