b2_cancel_large_file
  • 11 Sep 2026
  • Dark
    Light

b2_cancel_large_file

  • Dark
    Light

Article summary

Post
/b2api/v4/b2_cancel_large_file

Cancels a file upload

Cancels the upload of a large file, and deletes all of the parts that have been uploaded.

This will return an error if there is no active upload with the given file ID.

NOTE:

This API endpoint can be called using a GET request by converting the parameters in the request body to query parameters.


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)


For information on all API versions, view our API changelog.

Header parameters
Authorization
stringRequired

An account authorization token, obtained from b2_authorize_account. The token must have the writeFiles capability.


This is required if the bucket containing the file is not public. It is optional for buckets that are public.

Body parameters
object
fileId
string Required

The ID returned by b2_start_large_file.

ExamplefileId
Responses
200

The request succeeded.

object
fileId
string

The ID of the file whose upload that was canceled.

Example4_za71f544e781e6891531b001a_f200ec353a2184825_d20160409_m004829_c000_v0001016_t0028
accountId
string

The account that the bucket is in.

ExampleACCOUNT_ID
bucketId
string

The unique identifier of the bucket.

Example4a48fe8875c6214145260818
fileName
string

The name of the file that was canceled.

Examplebigfile.dat
400
statuscodedescription
400bad_bucket_idThe requested bucket ID does not match an existing bucket.
400bad_requestThe request had the wrong fields or illegal values. The message returned with the error will describe the problem.
object
status
integer

The numeric HTTP status code. Always matches the status in the HTTP response.

Example400
code
string

A single-identifier code that identifies the error.

Exampleinvalid_bucket_name
message
string

A human-readable message, in English, saying what went wrong.

Examplebucket name is too long
401
statuscodedescription
401bad_auth_tokenThe auth token used is not valid. Call b2_authorize_account again to either get a new one, or an error message describing the problem.
401expired_auth_tokenThe auth token used has expired. Call b2_authorize_account again to get a new one.
401unauthorizedThe 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.

Was this article helpful?

What's Next