Skip to content

API Error Codes

Zach Schneider edited this page Jul 6, 2021 · 2 revisions

Backblaze B2 API Error Codes

HTTP 400 (Bad Request)

Code bad_request:

API Operation Description
b2_authorize_account The request had the wrong fields or illegal values. The message returned with the error will describe the problem.
b2_cancel_large_file
b2_copy_file
b2_copy_part
b2_create_bucket
b2_create_key
b2_delete_bucket
b2_delete_file_version
b2_delete_key
b2_download_file_by_id
b2_download_file_by_name
b2_finish_large_file
b2_get_download_authorization
b2_get_file_info
b2_get_upload_part_url
b2_get_upload_url
b2_hide_file
b2_list_buckets
b2_list_file_names
b2_list_file_versions
b2_list_keys
b2_list_parts
b2_list_unfinished_large_files
b2_start_large_file
b2_update_bucket
b2_update_file_legal_hold
b2_update_file_retention
b2_upload_file
b2_upload_part

Code too_many_buckets:

API Operation Description
b2_create_bucket The account is already at the maximum bucket count.

Code duplicate_bucket_name:

API Operation Description
b2_create_bucket Bucket name is already in use.

Code file_not_present:

API Operation Description
b2_delete_file_version A file with fileId and fileName is not present.

Code out_of_range:

API Operation Description
b2_list_file_names maxFileCount out of range.
b2_list_file_versions

Code invalid_bucket_id:

API Operation Description
b2_list_file_names Invalid bucketId
b2_list_file_versions

Code bad_bucket_id:

API Operation Description
b2_delete_file_version A bucket with bucketId does not exist.
b2_finish_large_file
b2_start_large_file

Code invalid_file_id:

API Operation Description
b2_list_file_versions Invalid startFileId.

HTTP 401 (Unauthorized)

Code unsupported:

API Operation Description
b2_authorize_account The applicationKeyId is valid, but cannot be used with this version of the B2 API. The message contains information about what the problem is.

Code unauthorized:

API Operation Description
b2_authorize_account The applicationKeyId and/or the applicationKey are wrong.
b2_cancel_large_file The authorization token used is valid, but does not authorize this call with these parameters. The capabilities of an authorization token are determined by the application key used with b2_authorize_account.
b2_copy_file
b2_copy_part
b2_create_bucket
b2_create_key
b2_delete_bucket
b2_delete_file_version
b2_delete_key
b2_download_file_by_id
b2_download_file_by_name
b2_finish_large_file
b2_get_download_authorization
b2_get_file_info
b2_get_upload_part_url
b2_get_upload_url
b2_hide_file
b2_list_buckets
b2_list_file_names
b2_list_file_versions
b2_list_keys
b2_list_parts
b2_list_unfinished_large_files
b2_start_large_file
b2_update_file_legal_hold
b2_update_file_retention
b2_upload_file
b2_upload_part

Code bad_auth_token:

API Operation Description
b2_cancel_large_file The authorization token used is not valid. Call b2_authorize_account again to either get a new one, or an error message describing the problem.
b2_copy_file
b2_copy_part
b2_create_bucket
b2_create_key
b2_delete_bucket
b2_delete_file_version
b2_delete_key
b2_download_file_by_id
b2_download_file_by_name
b2_finish_large_file
b2_get_download_authorization
b2_get_file_info
b2_get_upload_part_url
b2_get_upload_url
b2_hide_file
b2_list_buckets
b2_list_file_names
b2_list_file_versions
b2_list_keys
b2_list_parts
b2_list_unfinished_large_files
b2_start_large_file
b2_update_file_legal_hold
b2_update_file_retention
b2_upload_file The auth token used is not valid. Call b2_get_upload_url again to get a new one.
b2_upload_part The auth token used is not valid. Call b2_get_upload_part_url again to get a new one.

Code expired_auth_token:

API Operation Description
b2_cancel_large_file The auth token used has expired. Call b2_authorize_account again to get a new one.
b2_copy_file
b2_copy_part
b2_create_bucket
b2_create_key
b2_delete_bucket
b2_delete_file_version
b2_delete_key
b2_download_file_by_id
b2_download_file_by_name
b2_finish_large_file
b2_get_download_authorization
b2_get_file_info
b2_get_upload_part_url
b2_get_upload_url
b2_hide_file
b2_list_buckets
b2_list_file_names
b2_list_file_versions
b2_list_keys
b2_list_parts
b2_list_unfinished_large_files
b2_start_large_file
b2_update_file_legal_hold
b2_update_file_retention
b2_upload_file The auth token used is not valid. Call b2_get_upload_url again to get a new one.
b2_upload_part The auth token used is not valid. Call b2_get_upload_part_url again to get a new one.

Code access_denied:

API Operation Description
b2_delete_file_version Access Denied. The delete was not allowed because File Lock is enabled on the file.

HTTP 403 (Forbidden)

Code cap_exceeded:

API Operation Description
b2_copy_file Class C transaction usage cap exceeded.
b2_copy_part
b2_update_file_legal_hold Class A transaction usage cap exceeded.
b2_update_file_retention
b2_upload_file

Code storage_cap_exceeded:

API Operation Description
b2_get_upload_part_url Class C transaction usage cap exceeded.
b2_get_upload_url

Code transaction_cap_exceeded:

API Operation Description
b2_authorize_account Class C transaction usage cap exceeded.

Code access_denied:

API Operation Description
b2_copy_file The provided customer-managed encryption key is wrong.
b2_copy_part
b2_download_file_by_id
b2_download_file_by_name

Code download_cap_exceeded:

API Operation Description
b2_download_file_by_id Class B transactions usage cap exceeded.
b2_download_file_by_name

HTTP 404 (Not Found)

Code not_found:

API Operation Description
b2_copy_file File is not in B2 Cloud Storage.
b2_copy_part
b2_download_file_by_id
b2_download_file_by_name
b2_get_file_info
b2_hide_file

HTTP 405 (Method Not Allowed)

Code method_not_allowed:

API Operation Description
b2_copy_file Only **POST** is supported.
b2_copy_part
b2_upload_file
b2_upload_part
b2_update_file_legal_hold This operation is not allowed because the specified file is a "hide marker."
b2_update_file_retention

HTTP 408 (Request Timeout)

Code request_timeout:

API Operation Description
b2_copy_file The service timed out reading the uploaded file.
b2_copy_part
b2_upload_file
b2_upload_part

HTTP 409 (Conflict)

Code conflict:

API Operation Description
b2_update_bucket The ifRevisionIs test failed.

HTTP 416 (Range Not Satisfiable)

Code range_not_satisfiable:

API Operation Description
b2_copy_file The Range header in the request is valid but cannot be satisfied for the file.
b2_copy_part
b2_download_file_by_id
b2_download_file_by_name

HTTP 429 (Too Many Requests)

B2 may limit API requests on a per-account basis.

HTTP 500 (Internal Server Error)

An unexpected error has occurred.

HTTP 503 (Service Unavailable)

Code service_unavailable:

API Operation Description
b2_get_download_authorization The service is temporarily unavailable. The message returned with the error will describe the problem.
b2_get_upload_url
b2_get_upload_part_url No uploads available in vault vaultId.
b2_upload_file Call b2_get_upload_url again to get a new auth token.
b2_upload_part Call b2_get_upload_part_url again to get a new auth token.

Code bad_request:

API Operation Description
b2_list_file_versions Timed out while iterating and skipping files.
b2_list_file_names