Delete Multiple Files

Title

Delete multiple files in a single request

URL Path

vault_rest/files

Method

DELETE

Summary

Delete a group of files from the MetaDefender Vault storage. This API will only mark the files for deletion. The files will be physically removed by a background worker.

Permissions Restrictions

Administrators can delete any file, including other user's files.
Users can only delete their own files.

HTTP header parameters

Authorization

The authentication token of the caller

REQUIRED

This header should have the following format: Bearer [

Example: Bearer Cp01BwnXAIOLZXxn7yogjKqIZnZpQD

Method: DELETE

HTTP body

json

REQUIRED

Sample HTTP body
[
"05a89617d2e44c409654f516eab085a5",
"cadf2430773c44d9bbc49a516660382c"
]

Descriptions of body:

array

Array of file IDs to remove

Request Error

400

Bad Request

Invalid HTTP request

401

Invalid parameter

One or more parameters are invalid

403

Forbidden

Authentication token is incorrect

500

Internal Server Error

Server is temporarily unavailable

Response

Example of a successful request:

{
"results": [
{
"Key": "ec4f9dcb-bdc7-4028-a700-641f2a9fc1aa",
"Value": {
"message": null,
"ui_message_key": null
}
},
{
"Key": "7d871b61-ea56-4b99-b779-e9fb35815706",
"Value": {
"message": null,
"ui_message_key": null
}
}
],
"success_counter": 2
}

Example of a failed request:

{
"results": [
{
"Key": "82876039-12f4-4f7f-ae3c-6076c765a5f3",
"Value": {
"message": null,
"ui_message_key": null
}
},
{
"Key": "7d871b61-ea56-4b99-b779-e9fb35815706",
"Value": {
"message": "One or more files were not found. No files were deleted.",
"ui_message_key": "API_CANNOTDELETEFILENOTFOUND"
}
}
],
"success_counter": 1
}

Descriptions of response:

results

A collection of data containing relevant information for each file

Key

The ID of the file

success_counter

Number of files successfully flagged for deletion

ui_message_key

A message key that is useful for localization

message

A message describing the error