Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Backblaze
https://www.backblaze.com/apidocs
Admin
Backblaze API Documentation
Tokens:
279,687
Snippets:
1,483
Trust Score:
10
Update:
2 weeks ago
Context
Chat
Benchmark
65.27
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### ListRoles (GET) Example Response Source: https://www.backblaze.com/apidocs/listroles-get Example XML response for the ListRoles (GET) operation. Shows a single role with path, name, ID, ARN, and creation date, plus IsTruncated and RequestId metadata. ```xml <ListRolesResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <ListRolesResult> <Roles> <member> <Path>/service/</Path> <RoleName>analytics-role</RoleName> <RoleId>AROAEXAMPLE123456789</RoleId> <Arn>arn:aws:iam::123456789012:role/service/analytics-role</Arn> <CreateDate>2026-02-03T21:10:00Z</CreateDate> </member> </Roles> <IsTruncated>false</IsTruncated> </ListRolesResult> <ResponseMetadata> <RequestId>req-1234567890</RequestId> </ResponseMetadata> </ListRolesResponse> ``` -------------------------------- ### Shell: curl --request GET Source: https://www.backblaze.com/apidocs/bz-list-computers Example of a GET request to the bz_list_computers endpoint using curl. The command is incomplete in the source, showing only the initial line. ```shell curl --request GET \ ``` -------------------------------- ### Example response with versioning enabled Source: https://www.backblaze.com/apidocs/s3-get-bucket-versioning The response returns a 200 NO CONTENT status with an XML body containing the VersioningConfiguration. The example shows the Status as 'Enabled'. ```custom <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Status>Enabled</Status> </VersioningConfiguration> ``` -------------------------------- ### Example response for ListAccessKeys (GET) Source: https://www.backblaze.com/apidocs/listaccesskeys-get Shows the XML response returned by the ListAccessKeys operation when the request succeeds. The response includes AccessKeyMetadata with member entries for each access key, an IsTruncated flag, and a ResponseMetadata block with a RequestId. ```xml <ListAccessKeysResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <ListAccessKeysResult> <AccessKeyMetadata> <member> <UserName>reporting-user</UserName> <AccessKeyId>AKIAIOSFODNN7EXAMPLE</AccessKeyId> <Status>Active</Status> <CreateDate>2026-02-03T21:10:00Z</CreateDate> </member> <member> <UserName>reporting-user</UserName> <AccessKeyId>AKIAIOSFODNN7OLDKEY</AccessKeyId> <Status>Inactive</Status> <CreateDate>2025-12-01T09:00:00Z</CreateDate> </member> </AccessKeyMetadata> <IsTruncated>false</IsTruncated> </ListAccessKeysResult> <ResponseMetadata> <RequestId>req-1234567890</RequestId> </ResponseMetadata> </ListAccessKeysResponse> ``` -------------------------------- ### Example file list in bucket Source: https://www.backblaze.com/apidocs/b2-list-file-names List of example file names in a bucket used to illustrate prefix and delimiter behavior. ```text photos/alice.jpg photos/alfred.jpg photos/cats/fluffy.jpg photos/cats/mittens.jpg photos/dogs/spot.jpg photos/lilly.jpg ``` -------------------------------- ### CreateUser Example Response Source: https://www.backblaze.com/apidocs/createuser Example XML response for the CreateUser operation, showing the structure with CreateUserResult, User details, and ResponseMetadata. ```xml <CreateUserResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <CreateUserResult> <User> <Path>/service/</Path> <UserName>reporting-user</UserName> <UserId>AIDAEXAMPLE123456789</UserId> <Arn>arn:aws:iam::123456789012:user/service/reporting-user</Arn> <CreateDate>2026-02-03T21:10:00Z</CreateDate> </User> </CreateUserResult> <ResponseMetadata> <RequestId>req-1234567890</RequestId> </ResponseMetadata> </CreateUserResponse> ``` -------------------------------- ### Example request for GetBucketPolicy Source: https://www.backblaze.com/apidocs/getbucketpolicy HTTP GET request to retrieve the bucket policy. The endpoint is `GET /{bucket}/?policy` on `s3.{region}.backblazeb2.com`. The `policy` query parameter must be present as `?policy` with no value. ```http GET /analytics-bucket/?policy HTTP/1.1 Host: s3.us-west-002.backblazeb2.com ``` -------------------------------- ### CreateAccessKey Example Response Source: https://www.backblaze.com/apidocs/createaccesskey Example XML response for the CreateAccessKey operation. The secret access key is returned only in this response. Users are limited to two access keys. ```xml <CreateAccessKeyResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <CreateAccessKeyResult> <AccessKey> <UserName>reporting-user</UserName> <AccessKeyId>AKIAIOSFODNN7EXAMPLE</AccessKeyId> <Status>Active</Status> <SecretAccessKey>wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY</SecretAccessKey> <CreateDate>2026-02-03T21:10:00Z</CreateDate> </AccessKey> </CreateAccessKeyResult> <ResponseMetadata> <RequestId>req-1234567890</RequestId> </ResponseMetadata> </CreateAccessKeyResponse> ``` -------------------------------- ### Example response with CORS configuration XML Source: https://www.backblaze.com/apidocs/s3-get-bucket-cors The response body contains the CORS configuration in XML format. The example shows a single CORSRule with allowed origin, methods, headers, and caching settings. ```custom <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <CORSRule> <AllowedOrigin>https://www.example.com</AllowedOrigin> <AllowedMethod>POST</AllowedMethod> <AllowedMethod>GET</AllowedMethod> <AllowedHeader>*</AllowedHeader> <ExposeHeader>x-amz-server-side-encryption</ExposeHeader> <MaxAgeSeconds>3600</MaxAgeSeconds> </CORSRule> </CORSConfiguration> ``` -------------------------------- ### List Parts Example Request (curl) Source: https://www.backblaze.com/apidocs/s3-list-parts Sends a GET request to the S3-compatible API to list parts of a multipart upload. The `uploadId` query parameter is required, and `max-parts` and `part-number-marker` are optional. ```shell curl --location 'https://s3.<region>.backblazeb2.com/:bucket/:key?uploadId=' ``` -------------------------------- ### Example response for ListRolePolicies (GET) Source: https://www.backblaze.com/apidocs/listrolepolicies-get Shows the XML response returned by the ListRolePolicies operation, listing inline policy names attached to a role. The response includes a PolicyNames list, an IsTruncated flag, and a ResponseMetadata block with a RequestId. ```xml <ListRolePoliciesResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <ListRolePoliciesResult> <PolicyNames> <member>analytics-read-only</member> <member>analytics-write</member> </PolicyNames> <IsTruncated>false</IsTruncated> </ListRolePoliciesResult> <ResponseMetadata> <RequestId>req-1234567890</RequestId> </ResponseMetadata> </ListRolePoliciesResponse> ``` -------------------------------- ### Example Request: curl to list buckets Source: https://www.backblaze.com/apidocs/s3-list-buckets Sends a GET request to the S3-compatible API endpoint to list all buckets in the account. The response is returned in alphabetical order by bucket name. ```shell curl --location 'https://s3.<your-region>.backblazeb2.com/' ``` -------------------------------- ### S3 List Objects V2 Example Request (curl) Source: https://www.backblaze.com/apidocs/s3-list-objects-v2 Sends a GET request to list up to 1,000 objects in a bucket, sorted alphabetically by key. The `list-type=2` query parameter is required for V2 object list. Replace `<your-region>` and `my-bucket-name` with your actual region and bucket name. ```shell curl --location 'https://s3.<your-region>.backblazeb2.com/my-bucket-name/?list-type=2' ``` -------------------------------- ### ListAccounts 200 response example Source: https://www.backblaze.com/apidocs/listaccounts-under-organization-1 Example JSON response for a successful ListAccounts request. Shows the structure of the accounts array and nextPageToken. ```json { "accounts": [ { "name": "accounts/912345678901", "accountId": "912345678901", "parent": "organizations/org-acme-prod", "organization": "organizations/org-acme-prod", "displayName": "tenant-prod", "billingAccount": "billingAccounts/456", "state": "ACTIVE", "suspensionReasons": [], "etag": "BwXk9a2J8p0=", "createTime": "2026-02-03T21:10:00Z", "updateTime": "2026-02-03T21:15:00Z", "deleteTime": null, "purgeTime": null } ], "nextPageToken": "eyJwYWdlIjoyfQ==" } ``` -------------------------------- ### GetCallerIdentity (GET) Example Response Source: https://www.backblaze.com/apidocs/getcalleridentity-get Example XML response returned by the GetCallerIdentity operation. Contains the UserId, Account, Arn, and RequestId for the credentials used to call the API. ```xml <GetCallerIdentityResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/"> <GetCallerIdentityResult> <UserId>AROAEXAMPLE123456789:session-001</UserId> <Account>123456789012</Account> <Arn>arn:aws:sts::123456789012:assumed-role/analytics-role/session-001</Arn> </GetCallerIdentityResult> <ResponseMetadata> <RequestId>req-1234567890</RequestId> </ResponseMetadata> </GetCallerIdentityResponse> ``` -------------------------------- ### CreateRole Example Response Source: https://www.backblaze.com/apidocs/createrole Example XML response from the CreateRole API call. Shows the structure of the returned role details including Path, RoleName, RoleId, Arn, CreateDate, and AssumeRolePolicyDocument. ```xml <CreateRoleResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> <CreateRoleResult> <Role> <Path>/service/</Path> <RoleName>analytics-role</RoleName> <RoleId>AROAEXAMPLE123456789</RoleId> <Arn>arn:aws:iam::123456789012:role/service/analytics-role</Arn> <CreateDate>2026-02-03T21:10:00Z</CreateDate> <AssumeRolePolicyDocument>{...}</AssumeRolePolicyDocument> </Role> </CreateRoleResult> <ResponseMetadata> <RequestId>req-1234567890</RequestId> </ResponseMetadata> </CreateRoleResponse> ``` -------------------------------- ### S3 Get Object Lock Configuration - Example Response (XML) Source: https://www.backblaze.com/apidocs/s3-get-object-lock-configuration Example response body showing the Object Lock configuration with ObjectLockEnabled set to 'Enabled' and a default retention rule with GOVERNANCE mode and 14 days. The response status is 200 NO CONTENT. ```custom <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ObjectLockConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <ObjectLockEnabled>Enabled</ObjectLockEnabled> <Rule> <DefaultRetention> <Mode>GOVERNANCE</Mode> <Days>14</Days> </DefaultRetention> </Rule> </ObjectLockConfiguration> ``` -------------------------------- ### Example Request: POST to initiate multipart upload Source: https://www.backblaze.com/apidocs/s3-create-multipart-upload Use this curl command to initiate a multipart upload. The request must include the 'uploads' parameter and the bucket and key path variables. The response returns an uploadId used for subsequent part uploads. ```shell curl --location --request POST 'https://s3.<your-region>.backblazeb2.com/my-bucket-name/object-1?uploads=null' ``` -------------------------------- ### XML response for get object ACL Source: https://www.backblaze.com/apidocs/s3-get-object-acl Example response body in XML format showing the access control policy with owner and grant information. ```custom <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Owner> <ID>15f935cf4dcb</ID> <DisplayName></DisplayName> </Owner> <AccessControlList> <Grant> <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"> <ID>15f935cf4dcb</ID> <DisplayName></DisplayName> </Grantee> <Permission>FULL_CONTROL</Permission> </Grant> </AccessControlList> </AccessControlPolicy> ``` -------------------------------- ### Example Response: 200 OK Source: https://www.backblaze.com/apidocs/s3-put-lifecycle-configuration Successful response to the lifecycle configuration request, returning HTTP 200 with empty body and standard S3 headers. ```HTTP HTTP/1.1 200 OK x-amz-id-2: r+qR7+nhXtJDDIJ0JJYcd+1j5nM/rUFiiiZ/fNbDOsd3JUE8NWMLNHXmvPfwMpdc x-amz-request-id: 9E26D08072A8EF9E Date: Wed, 14 May 2014 02:11:22 GMT Content-Length: 0 Server: AmazonS3 ``` -------------------------------- ### S3 Get Object Lock Configuration - Example Request (curl) Source: https://www.backblaze.com/apidocs/s3-get-object-lock-configuration Sends a GET request to the S3-compatible API endpoint to retrieve the Object Lock configuration for a bucket. The request must include the 'object-lock' query parameter and the bucket name in the path. ```shell curl --location 'https://s3.<your-region>.backblazeb2.com/my-bucket-name/?object-lock=null' ``` -------------------------------- ### Complete Multipart Upload Example Response (XML) Source: https://www.backblaze.com/apidocs/s3-complete-multipart-upload Example 200 OK response body showing the completed multipart upload result, including bucket, ETag, key, and location. ```shell <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <CompleteMultipartUploadResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Bucket>my-bucket-name</Bucket> <ETag>"3729bf569924c845dfe90bfe6281a9ff-1"</ETag> <Key>object-1</Key> <Location>/my-bucket-name/object-1</Location> </CompleteMultipartUploadResult> ``` -------------------------------- ### List with prefix '' and delimiter '/' Source: https://www.backblaze.com/apidocs/b2-list-file-names Output when using prefix "" (all files) and delimiter "/", returning a single folder entry. ```text folder photos/ ``` -------------------------------- ### GET /b2api/v4/b2_list_unfinished_large_files Source: https://www.backblaze.com/apidocs/b2-list-unfinished-large-files Lists information about large file uploads that have been started but not finished or canceled. Uploads are listed in the order they were started, with the oldest first. This call returns at most 1000 entries and can be called repeatedly to scan through all uploads for a bucket. ```APIDOC ## [GET] /b2api/v4/b2_list_unfinished_large_files ### Description Lists information about large file uploads that have been started, but have not been finished or canceled. Uploads are listed in the order they were started, with the oldest one first. This call returns at most 1000 entries, but it can be called repeatedly to scan through all of the uploads for a bucket. Each time you call, it returns a `nextFileId` that can be used as the starting point for the next call. ### Method GET ### Endpoint /b2api/v4/b2_list_unfinished_large_files ### Parameters #### Header Parameters - **Authorization** (string) - Required - An account authorization token, obtained from b2_authorize_account. The token must have the `listFiles` capability. #### Query Parameters - **bucketId** (string) - Required - The bucket to look for file names in. - **namePrefix** (string) - Optional - When a `namePrefix` is provided, only files whose names match the prefix will be returned. When using an application key that is restricted to a name prefix, you must provide a prefix here that is at least as restrictive. - **startFileId** (string, uuid) - Optional - The first upload to return. If there is an upload with this ID, it will be returned in the list. If not, the first upload after this the first one after this ID. - **maxFileCount** (integer) - Optional - The maximum number of files to return from this call. The default value is 100, and the maximum allowed is 100. ### Response #### Success Response (200) The request succeeded. The response headers include the Content-Type that was specified when the file was uploaded. They also include the X-Bz-FileName and X-Bz-Content-Sha1 headers, plus X-Bz-Info-* headers for any custom file info that was provided with the upload. The X-Bz-FileName uses percent-encoding, as if it were a URL parameter. Response body (application/json): - **files** (array of object) - An array of objects, each one describing one unfinished file. (See below.) - **accountId** (string) - The account that owns the file. Example: ACCOUNT_ID - **action** (string) - One of "start", "upload", "hide", "folder", or other values added in the future. "upload" means a file that was uploaded to B2 Cloud Storage. "start" means that a large file has been started, but not finished or canceled. "hide" means a file version marking the file as hidden, so that it will not show up in b2_list_file_names. "folder" is used to indicate a virtual folder when listing files. Example: start - **bucketId** (string) - The bucket that the file is in. Example: 4a48fe8875c6214145260818 - **contentLength** (integer) - The number of bytes stored in the file. Only useful when the action is "upload". Always 0 when the action is "start", "hide", or "folder". Example: 0 - **contentSha1** (string) - The SHA1 of the bytes stored in the file as a 40-digit hex string. Large files do not have SHA1 checksums, and the value is "none". The value is null when the action is "hide" or "folder". Example: none - **contentMd5** (string) - (Description not provided in source) ``` -------------------------------- ### List with prefix 'photos/' and delimiter '/' Source: https://www.backblaze.com/apidocs/b2-list-file-names Output when using prefix "photos/" and delimiter "/", showing uploads and folders. ```text upload photos/alice.jpg upload photos/alfred.jpg folder photos/cats/ folder photos/dogs/ upload photos/lilly.jpg ``` -------------------------------- ### Example Request: curl GET with legal-hold parameter Source: https://www.backblaze.com/apidocs/s3-get-object-legal-hold Use this curl command to retrieve the legal hold status of an object. The request must include the 'legal-hold' query parameter and requires AWS Signature authorization. ```shell curl --location 'https://s3.<your-region>.backblazeb2.com/my-bucket-name/object-1?legal-hold=null' ``` -------------------------------- ### Example response with retention settings Source: https://www.backblaze.com/apidocs/s3-get-object-retention Shows the XML response body returned on success (200 OK). Contains the retention mode and retain-until date. ```custom <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Retention xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Mode>COMPLIANCE</Mode> <RetainUntilDate>2022-02-02T23:56:06.538Z</RetainUntilDate> </Retention> ``` -------------------------------- ### Example Request: S3 Lifecycle Configuration XML Source: https://www.backblaze.com/apidocs/s3-put-lifecycle-configuration Shows a valid S3 lifecycle configuration with paired Expiration rules for each prefix, NoncurrentVersionExpiration, and AbortIncompleteMultipartUpload. The rules must be enabled and use Filter with Prefix. This example includes two rules for the 'logs/' prefix to satisfy the Expiration Rule Pairing Requirement. ```XML <?xml version="1.0" encoding="UTF-8"?> <LifecycleConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Rule> <ID>expire-logs-after-30-days</ID> <Filter> <Prefix>logs/</Prefix> </Filter> <Status>Enabled</Status> <Expiration> <Days>30</Days> </Expiration> </Rule> <Rule> <ID>expire-logs-delete-markers</ID> <Filter> <Prefix>logs/</Prefix> </Filter> <Status>Enabled</Status> <Expiration> <ExpiredObjectDeleteMarker>true</ExpiredObjectDeleteMarker> </Expiration> </Rule> <Rule> <ID>delete-old-versions-after-90-days</ID> <Filter> <Prefix>documents/</Prefix> </Filter> <Status>Enabled</Status> <NoncurrentVersionExpiration> <NoncurrentDays>90</NoncurrentDays> </NoncurrentVersionExpiration> </Rule> <Rule> <ID>abort-incomplete-uploads</ID> <Filter> <Prefix></Prefix> </Filter> <Status>Enabled</Status> <AbortIncompleteMultipartUpload> <DaysAfterInitiation>7</DaysAfterInitiation> </AbortIncompleteMultipartUpload> </Rule> </LifecycleConfiguration> ``` -------------------------------- ### POST /b2api/v3/b2_reserve_trial_create_account Source: https://www.backblaze.com/apidocs/b2-reserve-trial-create-account Creates a new Backblaze B2 account and starts a B2 reserve trial. The new account will receive an invitation email to reset their password, and the trial provides time-limited access to all B2 Reserve features. ```APIDOC ## [POST] /b2api/v3/b2_reserve_trial_create_account ### Description This operation creates a new Backblaze B2 account and starts a B2 reserve trial. A B2 Reserve Trial gives an end user time-limited access to all of B2 Reserve's product features for evaluation. New Backblaze accounts will receive an invitation email asking them to reset their password. The account will be fully functional and can be closed or converted to a paid account at the end of the B2 Reserve Trial. ### Method POST ### Endpoint /b2api/v3/b2_reserve_trial_create_account ### Parameters #### Header Parameters - **Authorization** (string) - Required - An account authorization token, obtained from b2_authorize_account. #### Request Body - **email** (string) - Required - Email for the new B2 account. Example: user@example.com - **region** (string) - Optional - Backblaze will pick a region if not specified. There are currently 4 regions available: `us-west`, `us-east`, `ca-east`, and `eu-central`. Example: us-east - **term** (integer) - Required - The duration (in days) of the trial period. This value must be between 7 and 30 (inclusive). Example: 15 - **storage** (integer) - Required - The amount of storage required in TB. This value must be between 1 and 50 (inclusive). Example: 12 ### Response #### Success Response (200) - **accountId** (string) - Account Id of the newly created B2 account. Example: YOUR_ACCOUNT_ID - **applicationKey** (string) - An application key for the new account that can be used to call Backblaze B2 APIs. This application key only has access to the bucket returned in the response. This key is also limited to API calls that read, write, and delete files, as well as update bucket settings. Example: 1007f472a08996e163314b339960f30c32cda969be - **applicationKeyId** (string) - An application key ID for the new account. Example: 8a0231e9032b - **s3Endpoint** (string) - The endpoint domain for Backblaze S3-Compatible API. The endpoint has the format: `s3.<region>.backblazeb2.com`. Example: s3.us-west-004.backblazeb2.com - **startDate** (string) - The trial start date uses the ISO 8601 date format (yyyy-MM-dd). The date is in the UTC timezone. Example: 2026-12-16 - **endDate** (string) - The trial end date is calculated by adding the start date plus the number of days in the terms of the request. Trials expire at the start of the day. The end date uses the ISO 8601 date format (yyyy-MM-dd). The date is in the UTC timezone. Example: 2026-12-25 - **email** (string) - Email for the new Backblaze B2 account. Example: user@example.com - **bucketName** (string) - Bucket name that is accessible using the returned application key. Used with the Backblaze S3-Compatible API. Example: myBucketName - **bucketId** (string) - Bucket ID that is accessible using the returned application key. Used with the B2 Native API. Example: e1256f0973908bfc71ed0c1z #### Error Response (400) - **status** (integer) - The numeric HTTP status code. Always matches the status in the HTTP response. Example: 400 - **code** (string) - A single-identifier code that identifies the error. Example: invalid_bucket_name - **message** (string) - A human-readable message, in English, saying what went wrong. Example: bucket name is too long #### Error Response (401) - **status** (integer) - The numeric HTTP status code. Always matches the status in the HTTP response. - **code** (string) - A single-identifier code that identifies the error. Example: unauthorized - **message** (string) - A human-readable message, in English, saying what went wrong. #### Error Response (403) - **status** (integer) - The numeric HTTP status code. Always matches the status in the HTTP response. - **code** (string) - A single-identifier code that identifies the error. Example: access_denied - **message** (string) - A human-readable message, in English, saying what went wrong. ``` -------------------------------- ### GET /b2api/v4/b2_list_file_versions Source: https://www.backblaze.com/apidocs/b2-list-file-versions Lists all versions of files in a bucket, including hidden and started large files. The response includes file metadata and can be filtered by folder using a delimiter. ```APIDOC ## [GET] /b2api/v4/b2_list_file_versions ### Description Lists all versions of files in a bucket, including hidden and started large files. The response includes file metadata and can be filtered by folder using a delimiter. ### Method GET ### Endpoint /b2api/v4/b2_list_file_versions ### Parameters #### Query Parameters - **delimiter** (string) - Optional - The delimiter character used to break file names into folders. Files returned will be limited to those within the top folder, or any one subfolder. Defaults to NULL. Folder names will also be returned. ### Response #### Success Response (200) The request succeeded. The response headers include the Content-Type that was specified when the file was uploaded. They also include the X-Bz-FileName and X-Bz-Content-Sha1 headers, plus X-Bz-Info-* headers for any custom file info that was provided with the upload. The X-Bz-FileName uses percent-encoding, as if it were a URL parameter. **Content-Type:** application/json **Response Body:** - **files** (array of object) - An array of objects, each one describing one file or folder. (See below.) Each file object contains: - **accountId** (string) - The account that owns the file. - **action** (string) - One of "start", "upload", "hide", "folder", or other values added in the future. "upload" means a file that was uploaded to B2 Cloud Storage. "start" means that a large file has been started, but not finished or canceled. "hide" means a file version marking the file as hidden, so that it will not show up in b2_list_file_names. "folder" is used to indicate a virtual folder when listing files. - **bucketId** (string) - The bucket that the file is in. - **contentLength** (integer) - The number of bytes stored in the file. Only useful when the action is "upload". Always 0 when the action is "start", "hide", or "folder". - **contentSha1** (string) - The SHA1 of the bytes stored in the file as a 40-digit hex string. Large files do not have SHA1 checksums, and the value is "none". The value is null when the action is "hide" or "folder". - **contentMd5** (string) - The MD5 of the bytes stored in the file as a 32-digit hex string. Not all files have an MD5 checksum, so this field is optional, and set to null for files that do not have one. Large files do not have MD5 checksums, and the value is null. The value is also null when the action is "hide" or "folder". - **contentType** (string) - When the action is "upload" or "start", the MIME type of the file, as specified when the file was uploaded. For "hide" action, always "application/x-bz-hide-marker". For "folder" action, always null. - **fileId** (string) - The unique identifier for this version of this file. Used with b2_get_file_info, b2_download_file_by_id, and b2_delete_file_version. The value is null when for action "folder". - **fileInfo** (object) - The custom information that was uploaded with the file. This is a JSON object, holding the name/value pairs that were uploaded with the file. - **fileName** (string) - The name of this file, which can be used with b2_download_file_by_name. - **fileRetention** (object) - The Object Lock retention settings for this file, if any. This field is filtered based on application key capabilities; the `readFileRetentions` capability is required to access the value. See Object Lock for more details on response structure. This field is omitted when the action is "hide" or "folder". - **isClientAuthorizedToRead** (boolean) - **value** (object) - **mode** (string) - **retainUntilTimestamp** (integer) - **legalHold** (object) #### Response Example ```json [ { "accountId": "ACCOUNT_ID", "action": "upload", "bucketId": "b2f6f21365e1d29f6c580f18", "contentLength": 7, "contentSha1": "dc724af18fbdd4e59189f5fe768a5f8311527050", "contentType": "text/plain", "fileId": "4_zb2f6f21365e1d29f6c580f18_f10904e5ca06493a1_d20180914_m223119_c002_v0001094_t0002", "fileInfo": { "src_last_modified_millis": "1536964184056" }, "fileName": "testing.txt", "fileRetention": { "isClientAuthorizedToRead": true, "value": { "mode": null, "retainUntilTimestamp": null } }, "legalHold": { "isClientAuthorizedToRead": true, "value": null }, "serverSideEncryption": { "algorithm": "AES256", "mode": "SSE-C" }, "uploadTimestamp": "1536964279000" }, { "accountId": "ACCOUNT_ID", "action": "upload", "bucketId": "b2f6f21365e1d29f6c580f18", "contentLength": 8, "contentSha1": "596b29ec9afea9e461a20610d150939b9c399d93", "contentType": "text/plain", "fileId": "4_zb2f6f21365e1d29f6c580f18_f10076875fe98d4af_d20180914_m223128_c002_v0001108_t0050", "fileInfo": { "src_last_modified_millis": "1536964200750" }, "fileName": "testing2.txt", "fileRetention": { "isClientAuthorizedToRead": true, "value": { "mode": null, "retainUntilTimestamp": null } }, "legalHold": { "isClientAuthorizedToRead": true, "value": null }, "serverSideEncryption": { "algorithm": "AES256", "mode": "SSE-B2" }, "uploadTimestamp": "1536964288000" } ] ``` ``` -------------------------------- ### Example response for List Multipart Uploads Source: https://www.backblaze.com/apidocs/s3-list-multipart-uploads Example 200 OK response body showing the XML structure returned by the List Multipart Uploads operation. It includes bucket name, max uploads, truncation flag, and details of each in-progress upload such as key, upload ID, initiator, owner, and storage class. ```xml <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ListMultipartUploadsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <Bucket>my-bucket-name-metadaddy</Bucket> <MaxUploads>1000</MaxUploads> <IsTruncated>false</IsTruncated> <Upload> <Initiated>2022-01-28T23:27:20Z</Initiated> <Initiator> <ID>15f935cf4dcb</ID> </Initiator> <Key>object-1</Key> <Owner> <ID>15f935cf4dcb</ID> </Owner> <StorageClass>STANDARD</StorageClass> <UploadId>4_z6145af89f355ac2f74ed0c1b_f2006887251b080dd_d20220128_m232720_c004_v0402000_t0046</UploadId> </Upload> <Upload> <Initiated>2022-01-28T23:29:12Z</Initiated> <Initiator> <ID>15f935cf4dcb</ID> </Initiator> <Key>object-2</Key> <Owner> <ID>15f935cf4dcb</ID> </Owner> <StorageClass>STANDARD</StorageClass> <UploadId>4_f2006887251b080dd213ed0c1b_f2006887251b080dd_d20220128_m232720_c004_v0402000_t0046</UploadId> </Upload> </ListMultipartUploadsResult> ``` -------------------------------- ### GET /b2api/v4/b2_list_file_names Source: https://www.backblaze.com/apidocs/b2-list-file-names Lists the names of all files in a bucket, starting at a given name. This endpoint is used to enumerate files and folders in a bucket, with optional filtering by prefix and delimiter. ```APIDOC ## [GET] /b2api/v4/b2_list_file_names ### Description Lists the names of all files in a bucket, starting at a given name. This endpoint is used to enumerate files and folders in a bucket, with optional filtering by prefix and delimiter. ### Method GET ### Endpoint /b2api/v4/b2_list_file_names ### Parameters #### Header Parameters - **Authorization** (string) - Required - An account authorization token, obtained from b2_authorize_account. The token must have the `listFiles` capability. #### Query Parameters - **bucketId** (string) - Required - The bucket to look for file names in. Returned by b2_list_buckets. - **startFileName** (string) - Optional - The first file name to return. If there is a file with this name, it will be returned in the list. If not, the first file name after this the first one after this name. - **maxFileCount** (integer) - Optional - The maximum number of files to return from this call. The default value is 100, and the maximum is 10000. Passing in 0 means to use the default of 100. - **prefix** (string) - Optional - Files returned will be limited to those with the given prefix. Defaults to the empty string, which matches all files. - **delimiter** (string) - Optional - Files returned will be limited to those within the top folder, or any one subfolder. Defaults to NULL. Folder names will also be returned. The delimiter character will be used to "break" file names into folders. ### Response #### Success Response (200) The request succeeded. The response headers include the Content-Type that was specified when the file was uploaded. They also include the X-Bz-FileName and X-Bz-Content-Sha1 headers, plus X-Bz-Info-* headers for any custom file info that was provided with the upload. The X-Bz-FileName uses percent-encoding, as if it were a URL parameter. **Response Body** (application/json) - **files** (Array of object) - An array of objects, each one describing one file or folder. (See below.) - **accountId** (string) - The account that owns the file. - **action** (string) - One of "start", "upload", "hide", "folder", or other values added in the future. "upload" means a file that was uploaded to B2 Cloud Storage. "start" means that a large file has been started, but not finished or canceled. "hide" means a file version marking the file as hidden, so that it will not show up in b2_list_file_names. "folder" is used to indicate a virtual folder when listing files. - **bucketId** (string) - The bucket that the file is in. - **contentLength** (integer) - The number of bytes stored in the file. Only useful when the action is "upload". Always 0 when the action is "start", "hide", or "folder". - **contentSha1** (string) - The SHA1 of the bytes stored in the file as a 40-digit hex string. Large files do not have SHA1 checksums, and the value is "none". The value is null when the action is "hide" or "folder". - **contentMd5** (string) - The MD5 of the bytes stored in the file as a 32-digit hex string. Not all files have an MD5 checksum, so this field is optional, and set to null for files that do not have one. Large files do not have MD5 checksums, and the value is null. The value is also null when the action is "hide" or "folder". - **contentType** (string) - The content type of the file. #### Response Example ```json [ { "accountId": "ACCOUNT_ID", "action": "upload", "bucketId": "b2f6f21365e1d29f6c580f18", "contentLength": 7, "contentSha1": "dc724af18fbdd4e59189f5fe768a5f8311527050", "contentType": "text/plain", "fileId": "4_zb2f6f21365e1d29f6c580f18_f10904e5ca06493a1_d20180914_m223119_c002_v0001094_t0002", "fileInfo": { "src_last_modified_millis": "1536964184056" }, "fileName": "testing.txt", "fileRetention": { "isClientAuthorizedToRead": true, "value": { "mode": null, "retainUntilTimestamp": null } }, "legalHold": { "isClientAuthorizedToRead": true, "value": null }, "serverSideEncryption": { "algorithm": "AES256", "mode": "SSE-C" }, "uploadTimestamp": "1536964279000" }, { "accountId": "ACCOUNT_ID", "action": "upload", "bucketId": "b2f6f21365e1d29f6c580f18", "contentLength": 8, "contentSha1": "596b29ec9afea9e461a20610d150939b9c399d93", "contentType": "text/plain", "fileId": "4_zb2f6f21365e1d29f6c580f18_f10076875fe98d4af_d20180914_m223128_c002_v0001108_t0050", "fileInfo": { "src_last_modified_millis": "1536964200750" }, "fileName": "testing2.txt", "fileRetention": { "isClientAuthorizedToRead": true, "value": { "mode": null, "retainUntilTimestamp": null } }, "legalHold": { "isClientAuthorizedToRead": true, "value": null }, "serverSideEncryption": { "algorithm": "AES256", "mode": "SSE-B2" }, "uploadTimestamp": "1536964288000" } ] ``` ``` -------------------------------- ### Example response XML for List Object Versions Source: https://www.backblaze.com/apidocs/s3-list-object-versions Shows the 200 OK response body containing version metadata, including delete markers and object versions. The response includes ETags, version IDs, and storage class information. ```custom <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ListVersionsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> <DeleteMarker> <IsLatest>true</IsLatest> <Key>object-2</Key> <LastModified>2022-01-28T23:40:31.000Z</LastModified> <Owner> <ID>15f935cf4dcb</ID> <DisplayName></DisplayName> </Owner> <VersionId>4_z6145af89f355ac2f74ed0c1b_f40057de773908ada_d20220128_m234031_c004_v0402002_t0050</VersionId> </DeleteMarker> <IsTruncated>false</IsTruncated> <MaxKeys>1000</MaxKeys> <Name>my-bucket-name</Name> <Version> <ETag>"85f30635602dc09bd85957a6e82a2c21"</ETag> <IsLatest>true</IsLatest> <Key>object-1</Key> <LastModified>2022-01-28T23:24:07.000Z</LastModified> <Owner> <ID>15f935cf4dcb</ID> <DisplayName></DisplayName> </Owner> <Size>11</Size> <StorageClass>STANDARD</StorageClass> <VersionId>4_z6145af89f355ac2f74ed0c1b_f4030346ce9e208f0_d20220128_m232407_c004_v0402005_t0021</VersionId> </Version> <Version> <ETag>"85f30635602dc09bd85957a6e82a2c21"</ETag> <IsLatest>false</IsLatest> <Key>object-1</Key> <LastModified>2022-01-28T23:12:33.000Z</LastModified> <Owner> <ID>15f935cf4dcb</ID> <DisplayName></DisplayName> </Owner> <Size>11</Size> <StorageClass>STANDARD</StorageClass> <VersionId>4_z6145af89f355ac2f74ed0c1b_f416a807037a7ee2a_d20220128_m231233_c004_v0402000_t0056</VersionId> </Version> </ListVersionsResult> ``` -------------------------------- ### Loop through all file names using b2_list_file_names Source: https://www.backblaze.com/apidocs/b2-list-file-names Pseudo-code loop that repeatedly calls b2_list_file_names, starting with startFileName = null, processing each file name, and using response.nextFileName for the next call until response.startFileName is null. This scans through all file names in a bucket, returning at most 10,000 names per call. ```pseudocode startFileName = null while true: response = b2_list_file_names(bucketId = ..., startFileName = startFileName) for file in response.files: process_one_file_name(file) if response.startFileName == null: break startFileName = response.nextFileName ```