# Backblaze B2

> Store and share files in Backblaze B2 cloud storage: upload, download, copy, hide and delete files, make temporary download links, manage buckets, and start a workflow when a new file arrives.

App · 16 actions. Web page: https://docs.lodol.com/docs/integrations/backblaze-b2

## Actions

### Copy file

Copy a file to a new name, in the same bucket or another one, without downloading it. Up to 5 GB.

**Inputs**

- File ID to copy (`source_file_id`, text, required): The id of the file version to copy, from 'List files'.
- New file name (`new_file_name`, text, required): The whole path for the copy, such as archive/june.pdf.
- Copy into bucket (`destination_bucket_id`, text): Leave empty to copy within the same bucket.

**Outputs**

- `file` (object): The file

**Example output**

```json
{
  "file": {
    "action": "copy",
    "bucket_id": "50fe1b8473d9c3e0a2150a10",
    "content_type": "application/pdf",
    "file_id": "4_z50fe1b8473d9c3e0a2150a10_f414f47665c80ca4c_d20261112_m070703_c005",
    "file_info": {},
    "file_name": "archive/june.pdf",
    "is_folder": false,
    "md5": "94930f8536f8bb0bd9b4e8934ac8632f",
    "sha1": "ad8fb1e445c2bcb58b4ef698b6c7ffe0e871b62f",
    "size": 20480,
    "uploaded_at": "2026-11-12T07:07:03.725Z",
    "uploaded_at_ms": 1794467223725
  }
}
```

### Create bucket

Create a bucket. Names are unique across every Backblaze account, so a taken name is refused.

**Inputs**

- Bucket name (`bucket_name`, text, required): 6 to 50 letters, digits or hyphens, not starting with b2-. It cannot be changed later.
- Who can read its files (`bucket_type`, text): Private buckets need a key or a download link to read. Public ones need a payment method on the Backblaze account. Defaults to private. One of: `allPrivate` (Private (default)), `allPublic` (Public).

**Outputs**

- `bucket` (object): The bucket

**Example output**

```json
{
  "bucket": {
    "account_id": "0eb4393025a0",
    "bucket_id": "50fe1b8473d9c3e0a2150a10",
    "bucket_info": {},
    "bucket_name": "lodol-reports-2026",
    "bucket_type": "allPrivate",
    "cors_rules": [],
    "encryption": "SSE-B2",
    "file_lock_enabled": false,
    "lifecycle_rules": [],
    "revision": 2
  }
}
```

### Create download link

Make a temporary link anyone can use to download one file, even from a private bucket. It stops working after the time you pick.

**Inputs**

- Bucket (`bucket_id`, text, required): The bucket. Pick one, or give its name or id from an earlier step.
- File name (`file_name`, text, required): The file's whole path in the bucket, such as reports/june.pdf. 'List files' returns it.
- Valid for (hours) (`valid_for_hours`, number): 1 to 168 hours (one week). The default is 24. From 1 to 168. Default: `24`.

**Outputs**

- `bucket_id` (text): The bucket
- `expires_at` (text): When the link stops working (ISO 8601)
- `file_name` (text): The file's whole path
- `url` (text): The link. Anyone who has it can download the file until it expires
- `valid_for_hours` (number): How long the link works

**Example output**

```json
{
  "bucket_id": "50fe1b8473d9c3e0a2150a10",
  "expires_at": "2026-11-13T07:07:03.000Z",
  "file_name": "reports/june.pdf",
  "url": "https://f005.backblazeb2.com/file/lodol-reports-2026/reports/june.pdf?Authorization=EXAMPLE",
  "valid_for_hours": 24
}
```

### Delete bucket

Delete an empty bucket. Backblaze refuses if it still holds any file or version, so delete those first.

**Inputs**

- Bucket (`bucket_id`, text, required): The bucket. Pick one, or give its name or id from an earlier step.

**Outputs**

- `bucket` (object): The bucket, as it was
- `bucket_id` (text): The bucket deleted
- `deleted` (true/false): Always true once deleted

**Example output**

```json
{
  "bucket": {
    "account_id": "0eb4393025a0",
    "bucket_id": "50fe1b8473d9c3e0a2150a10",
    "bucket_info": {},
    "bucket_name": "lodol-reports-2026",
    "bucket_type": "allPrivate",
    "cors_rules": [],
    "encryption": "SSE-B2",
    "file_lock_enabled": false,
    "lifecycle_rules": [],
    "revision": 2
  },
  "bucket_id": "50fe1b8473d9c3e0a2150a10",
  "deleted": true
}
```

### Delete file version

Permanently delete one version of a file, or a hide marker to unhide the file. This cannot be undone.

**Inputs**

- File name (`file_name`, text, required): The file's whole path in the bucket, such as reports/june.pdf. 'List files' returns it.
- File ID (`file_id`, text, required): The file version's id, from 'List files' or an earlier step.

**Outputs**

- `deleted` (true/false): Always true once deleted
- `file_id` (text): The version deleted
- `file_name` (text): The file's name

**Example output**

```json
{
  "deleted": true,
  "file_id": "4_z50fe1b8473d9c3e0a2150a10_f414f47665c80ca4c_d20261112_m070703_c005",
  "file_name": "reports/june.pdf"
}
```

### Download file

Download a file and save it to this workspace's files, so later steps can attach or read it. Up to 100 MB. Give a file ID to get one older version.

**Inputs**

- Bucket (`bucket_id`, text, required): The bucket. Pick one, or give its name or id from an earlier step.
- File name (`file_name`, text, required): The file's whole path in the bucket, such as reports/june.pdf. 'List files' returns it.
- File ID (`file_id`, text): Only to get one specific older version. Leave empty for the current file.

**Outputs**

- `content_type` (text): The file's type
- `document_ref` (text): The saved file, usable as a file in later steps
- `file_id` (text): The version's id in Backblaze
- `file_name` (text): The whole path in the bucket
- `filename` (text): The file's name without its folder
- `sha1` (text): The file's SHA-1 checksum
- `size_bytes` (number): Its size in bytes
- `url` (text): A link to the saved copy

**Example output**

```json
{
  "content_type": "application/pdf",
  "document_ref": "doc_0123456789abcdef0123456789abcdef",
  "file_id": "4_z50fe1b8473d9c3e0a2150a10_f414f47665c80ca4c_d20261112_m070703_c005",
  "file_name": "reports/june.pdf",
  "filename": "june.pdf",
  "sha1": "ad8fb1e445c2bcb58b4ef698b6c7ffe0e871b62f",
  "size_bytes": 20480,
  "url": "/actions/core/serve-document/doc_0123456789abcdef0123456789abcdef"
}
```

### Get account info

Show the Backblaze account the key belongs to and what the key may do: its capabilities and any bucket or folder it is limited to.

**Inputs**: None.

**Outputs**

- `account_id` (text): The Backblaze account id
- `api_url` (text): The account's API address
- `capabilities` (list): What the key is allowed to do
- `download_url` (text): The account's file download address
- `restricted_to_buckets` (list): The buckets the key is limited to, empty if it can use all
- `restricted_to_prefix` (text): The folder the key is limited to, empty if none

**Example output**

```json
{
  "account_id": "0eb4393025a0",
  "api_url": "https://api005.backblazeb2.com",
  "capabilities": [
    "listBuckets",
    "listFiles",
    "readFiles",
    "writeFiles"
  ],
  "download_url": "https://f005.backblazeb2.com",
  "restricted_to_buckets": [],
  "restricted_to_prefix": ""
}
```

### Get bucket

Get one bucket: its type, settings and lifecycle rules.

**Inputs**

- Bucket (`bucket_id`, text, required): The bucket. Pick one, or give its name or id from an earlier step.

**Outputs**

- `bucket` (object): The bucket

**Example output**

```json
{
  "bucket": {
    "account_id": "0eb4393025a0",
    "bucket_id": "50fe1b8473d9c3e0a2150a10",
    "bucket_info": {},
    "bucket_name": "lodol-reports-2026",
    "bucket_type": "allPrivate",
    "cors_rules": [],
    "encryption": "SSE-B2",
    "file_lock_enabled": false,
    "lifecycle_rules": [],
    "revision": 2
  }
}
```

### Get file info

Get a file version's name, size, type, checksum and upload time.

**Inputs**

- File ID (`file_id`, text, required): The file version's id, from 'List files' or an earlier step.

**Outputs**

- `file` (object): The file

**Example output**

```json
{
  "file": {
    "action": "upload",
    "bucket_id": "50fe1b8473d9c3e0a2150a10",
    "content_type": "application/pdf",
    "file_id": "4_z50fe1b8473d9c3e0a2150a10_f414f47665c80ca4c_d20261112_m070703_c005",
    "file_info": {},
    "file_name": "reports/june.pdf",
    "is_folder": false,
    "md5": "94930f8536f8bb0bd9b4e8934ac8632f",
    "sha1": "ad8fb1e445c2bcb58b4ef698b6c7ffe0e871b62f",
    "size": 20480,
    "uploaded_at": "2026-11-12T07:07:03.725Z",
    "uploaded_at_ms": 1794467223725
  }
}
```

### Hide file

Hide a file so it no longer appears in 'List files' or downloads by name. Its data stays, and deleting the hide marker with 'Delete file version' brings it back.

**Inputs**

- Bucket (`bucket_id`, text, required): The bucket. Pick one, or give its name or id from an earlier step.
- File name (`file_name`, text, required): The file's whole path in the bucket, such as reports/june.pdf. 'List files' returns it.

**Outputs**

- `file` (object): The file

**Example output**

```json
{
  "file": {
    "action": "hide",
    "bucket_id": "50fe1b8473d9c3e0a2150a10",
    "content_type": "application/x-bz-hide-marker",
    "file_id": "4_z50fe1b8473d9c3e0a2150a10_f414f47665c80ca4c_d20261112_m070703_c005",
    "file_info": {},
    "file_name": "reports/june.pdf",
    "is_folder": false,
    "md5": "94930f8536f8bb0bd9b4e8934ac8632f",
    "sha1": "ad8fb1e445c2bcb58b4ef698b6c7ffe0e871b62f",
    "size": 0,
    "uploaded_at": "2026-11-12T07:07:03.725Z",
    "uploaded_at_ms": 1794467223725
  }
}
```

### List application keys

List the account's application keys with their capabilities, restrictions and expiry. Never shows a key's secret.

**Inputs**

- How many (`max_key_count`, number): How many keys to return, 1 to 1000. The default is 100. From 1 to 1000.
- Start at key ID (`start_key_id`, text): The 'next_key_id' from an earlier page, to get the page after it.

**Outputs**

- `count` (number): How many keys are in this page
- `keys` (list): The account's application keys
- `next_key_id` (text): Pass this as 'Start at key ID' for the next page; empty on the last page

**Example output**

```json
{
  "count": 1,
  "keys": [
    {
      "bucket_ids": [],
      "capabilities": [
        "listBuckets",
        "listFiles",
        "readFiles",
        "writeFiles"
      ],
      "expires_at": null,
      "key_id": "0050eb4393025a00000000001",
      "key_name": "Lodol",
      "name_prefix": null
    }
  ],
  "next_key_id": ""
}
```

### List buckets

List the account's buckets, optionally only private or only public ones.

**Inputs**

- Type (`bucket_type`, text): Which buckets to list. Defaults to every bucket. One of: `all` (Every bucket (default)), `allPrivate` (Private buckets), `allPublic` (Public buckets).

**Outputs**

- `buckets` (list): The buckets
- `count` (number): How many buckets

**Example output**

```json
{
  "buckets": [
    {
      "account_id": "0eb4393025a0",
      "bucket_id": "50fe1b8473d9c3e0a2150a10",
      "bucket_info": {},
      "bucket_name": "lodol-reports-2026",
      "bucket_type": "allPrivate",
      "cors_rules": [],
      "encryption": "SSE-B2",
      "file_lock_enabled": false,
      "lifecycle_rules": [],
      "revision": 2
    }
  ],
  "count": 1
}
```

### List file versions

List every version of every file in a bucket, newest first for each name, including hide markers and files that were overwritten.

**Inputs**

- Bucket (`bucket_id`, text, required): The bucket. Pick one, or give its name or id from an earlier step.
- Folder (`prefix`, text): Only files whose name starts with this, such as reports/. Leave empty for the whole bucket.
- How many (`max_file_count`, number): How many files to return, 1 to 1000. The default is 100. From 1 to 1000.
- Start at file name (`start_file_name`, text): The 'next_file_name' from an earlier page, to get the page after it. Leave empty for the first page.
- Start at file ID (`start_file_id`, text): The 'next_file_id' from an earlier page. Use it together with 'Start at file name'.

**Outputs**

- `count` (number): How many files are in this page
- `files` (list): The file versions in this page
- `next_file_id` (text): Pass this as 'Start at file ID' with the name for the next page; empty on the last page
- `next_file_name` (text): Pass this as 'Start at file name' for the next page; empty on the last page

**Example output**

```json
{
  "count": 1,
  "files": [
    {
      "action": "upload",
      "bucket_id": "50fe1b8473d9c3e0a2150a10",
      "content_type": "application/pdf",
      "file_id": "4_z50fe1b8473d9c3e0a2150a10_f414f47665c80ca4c_d20261112_m070703_c005",
      "file_info": {},
      "file_name": "reports/june.pdf",
      "is_folder": false,
      "md5": "94930f8536f8bb0bd9b4e8934ac8632f",
      "sha1": "ad8fb1e445c2bcb58b4ef698b6c7ffe0e871b62f",
      "size": 20480,
      "uploaded_at": "2026-11-12T07:07:03.725Z",
      "uploaded_at_ms": 1794467223725
    }
  ],
  "next_file_id": "",
  "next_file_name": ""
}
```

### List files

List the files in a bucket, or in one folder of it, in name order. Hidden files are not listed.

**Inputs**

- Bucket (`bucket_id`, text, required): The bucket. Pick one, or give its name or id from an earlier step.
- Folder (`prefix`, text): Only files whose name starts with this, such as reports/. Leave empty for the whole bucket.
- Show folders (`folder_view`, true/false): On: show each folder inside the path as one entry instead of listing every file in it.
- How many (`max_file_count`, number): How many files to return, 1 to 1000. The default is 100. From 1 to 1000.
- Start at file name (`start_file_name`, text): The 'next_file_name' from an earlier page, to get the page after it. Leave empty for the first page.

**Outputs**

- `count` (number): How many files are in this page
- `files` (list): The files in this page
- `next_file_name` (text): Pass this as 'Start at file name' for the next page; empty on the last page

**Example output**

```json
{
  "count": 1,
  "files": [
    {
      "action": "upload",
      "bucket_id": "50fe1b8473d9c3e0a2150a10",
      "content_type": "application/pdf",
      "file_id": "4_z50fe1b8473d9c3e0a2150a10_f414f47665c80ca4c_d20261112_m070703_c005",
      "file_info": {},
      "file_name": "reports/june.pdf",
      "is_folder": false,
      "md5": "94930f8536f8bb0bd9b4e8934ac8632f",
      "sha1": "ad8fb1e445c2bcb58b4ef698b6c7ffe0e871b62f",
      "size": 20480,
      "uploaded_at": "2026-11-12T07:07:03.725Z",
      "uploaded_at_ms": 1794467223725
    }
  ],
  "next_file_name": ""
}
```

### Update bucket

Change who can read a bucket's files, its default Cache-Control, or when its files are hidden and deleted. Only what you fill in changes.

**Inputs**

- Bucket (`bucket_id`, text, required): The bucket. Pick one, or give its name or id from an earlier step.
- Who can read its files (`bucket_type`, text): Leave empty to keep it as it is. One of: `allPrivate` (Private (default)), `allPublic` (Public).
- Default Cache-Control (`default_cache_control`, text): Sent with downloads of the bucket's files, such as max-age=3600. Leave empty to keep it.
- Hide files after (days) (`hide_after_days`, number): Hide every file this many days after it was uploaded. Leave empty to keep the current rule. From 1 to 3650.
- Delete hidden files after (days) (`delete_hidden_after_days`, number): Permanently delete a file this many days after it was hidden. Leave empty to keep the current rule. From 1 to 3650.

**Outputs**

- `bucket` (object): The bucket

**Example output**

```json
{
  "bucket": {
    "account_id": "0eb4393025a0",
    "bucket_id": "50fe1b8473d9c3e0a2150a10",
    "bucket_info": {
      "Cache-Control": "max-age=3600"
    },
    "bucket_name": "lodol-reports-2026",
    "bucket_type": "allPrivate",
    "cors_rules": [],
    "encryption": "SSE-B2",
    "file_lock_enabled": false,
    "lifecycle_rules": [],
    "revision": 3
  }
}
```

### Upload file

Upload a file to a bucket from text or from a file. A file already at that name is kept as an older version. Up to 100 MB.

**Inputs**

- Bucket (`bucket_id`, text, required): The bucket. Pick one, or give its name or id from an earlier step.
- File name (`file_name`, text, required): The whole path to save it as, such as reports/june.pdf. Folders need no setup.
- Text content (`content`, text): Text to save as the file. Use this or 'File', not both.
- File (`file`, text): The file to save: upload one, or pick one an earlier step made. Use this or 'Text content', not both.
- Content type (`content_type`, text): A type such as application/pdf. Empty: Backblaze works it out from the file name.

**Outputs**

- `file` (object): The file

**Example output**

```json
{
  "file": {
    "action": "upload",
    "bucket_id": "50fe1b8473d9c3e0a2150a10",
    "content_type": "application/pdf",
    "file_id": "4_z50fe1b8473d9c3e0a2150a10_f414f47665c80ca4c_d20261112_m070703_c005",
    "file_info": {},
    "file_name": "reports/june.pdf",
    "is_folder": false,
    "md5": "94930f8536f8bb0bd9b4e8934ac8632f",
    "sha1": "ad8fb1e445c2bcb58b4ef698b6c7ffe0e871b62f",
    "size": 20480,
    "uploaded_at": "2026-11-12T07:07:03.725Z",
    "uploaded_at_ms": 1794467223725
  }
}
```
