- Print
- DarkLight
b2_delete_file_version
- Print
- DarkLight
Deletes one version of a file
If the version you delete is the latest version, and there are older versions, then the most recent older version will become the current version, and be the one that you'll get when downloading by name. See File Versions for more details.
When used on an unfinished large file, this call has the same effect as b2_cancel_large_file.
API Versions
v1: Application keys (July 26, 2018)
Incompatible change: After calling b2_authorize_account with an application key that does not have the right permissions, this call will return a 401 Unauthorized.
v1: Original release (September 22, 2015)
PLEASE NOTE:
This API endpoint can be called using a GET
request by converting the parameters in the request body to query parameters.
An account authorization token, obtained from b2_authorize_account.
The token must have the deleteFiles
capability.
The name of the file.
The ID of the file, as returned by b2_upload_file, b2_list_file_names, or b2_list_file_versions.
Must be specified and set to true
if deleting a file version protected by Object Lock governance mode retention settings. Setting the value requires the bypassGovernance
application key capability. See Object Lock for more information.
The request succeeded.
The unique ID of the file version that was deleted.
The name of the file.
status | code | description |
---|---|---|
400 | bad_bucket_id | The requested bucket ID does not match an existing bucket. |
400 | bad_request | The request had the wrong fields or illegal values. The message returned with the error will describe the problem. | 400 | file_not_present | File not present: <fileName> <fileId> . |
The numeric HTTP status code. Always matches the status in the HTTP response.
A single-identifier code that identifies the error.
A human-readable message, in English, saying what went wrong.
status | code | description |
---|---|---|
401 | bad_auth_token | The auth token used is not valid. Call b2_authorize_account again to either get a new one, or an error message describing the problem. |
401 | expired_auth_token | The auth token used has expired. Call b2_authorize_account again to get a new one. |
401 | unauthorized | The auth token used is valid, but does not authorize this call with these parameters. The capabilities of an auth token are determined by the application key used with b2_authorize_account. |
401 | access_denied | Access Denied. The delete was not allowed because Object Lock is enabled on the file. |