Skip to main content

deleteFileVersions

FileOperationArrayWrapper deleteFileVersions(DeleteVersionBatchRequestDto)

PUT /api/2.0/files/fileops/deleteversion

Delete file versions

Queues a background job that removes the listed versions from the history of one file, and answers with the caller's delete operations, including the one just started. Poll GET api/2.0/files/fileops until the operation reports finished; a failure met while the job runs is reported in its error rather than as a status code. Removal is permanent — deleted versions do not travel through Trash and cannot be restored, while the file itself stays in place with the versions that are left. Send the numbers that GET api/2.0/files/file/{fileId}/history reports, and send at least one: an empty list is not an empty request, it deletes the whole file instead. The number of the current version is refused before anything is queued, while numbers that no longer exist are passed over without a complaint. The caller needs the rights that deleting the file itself would need, so a member with read-only rights is refused, as are a file in an archived room and a file that is already in Trash, and a file that does not exist is answered as missing. To delete the file itself use PUT api/2.0/files/fileops/delete.

Parameters​

NameInTypeDescriptionNotes
DeleteVersionBatchRequestDtobodyDeleteVersionBatchRequestDto[optional]

Responses​

Status codeDescriptionTypeResponse headers
200The delete operations of the caller, the one just queued includedFileOperationArrayWrapperX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
400The request body cannot be read or has no fileId or versions--
403The caller cannot delete the file, the file is locked by another user, open for editing, in an archived room or in Trash, or versions includes the current version--
404The file does not exist--
401UnauthorizedErrorApiResponse-
429Too Many Requests.ErrorApiResponseRetry-After
500Internal Server Error.ErrorApiResponse-
502Bad Gateway. Returned by the reverse proxy, response body may be HTML and not JSON.--
503Service Unavailable. Returned by the reverse proxy, response body may be HTML and not JSON.--

Return type​

FileOperationArrayWrapper

Authorization​

Basic, OAuth2 (scopes: read, write), ApiKeyBearer, asc_auth_key, Bearer, OpenId

HTTP request headers​

  • Content-Type: application/json
  • Accept: application/json