Skip to content
Report an issue

Buckets

BucketsService

Service for managing UiPath storage buckets.

Buckets are cloud storage containers that can be used to store and manage files used by automation processes.

create

create(
    name,
    *,
    description=None,
    identifier=None,
    folder_path=None,
    folder_key=None,
)

Create a new bucket.

Parameters:

Name Type Description Default
name str

Bucket name (must be unique within folder)

required
description Optional[str]

Optional description

None
identifier Optional[str]

UUID identifier (auto-generated if not provided)

None
folder_path Optional[str]

Folder to create bucket in

None
folder_key Optional[str]

Folder key

None

Returns:

Name Type Description
Bucket Bucket

Newly created bucket resource

Raises:

Type Description
Exception

If bucket creation fails

Examples:

>>> bucket = sdk.buckets.create("my-storage")
>>> bucket = sdk.buckets.create(
...     "data-storage",
...     description="Production data"
... )

create_async async

create_async(
    name,
    *,
    description=None,
    identifier=None,
    folder_path=None,
    folder_key=None,
)

Async version of create().

delete

delete(
    *,
    name=None,
    key=None,
    folder_path=None,
    folder_key=None,
)

Delete a bucket.

Parameters:

Name Type Description Default
name Optional[str]

Bucket name

None
key Optional[str]

Bucket identifier (UUID)

None
folder_path Optional[str]

Folder path

None
folder_key Optional[str]

Folder key

None

Raises:

Type Description
LookupError

If bucket is not found

Examples:

>>> sdk.buckets.delete(name="old-storage")
>>> sdk.buckets.delete(key="abc-123-def")

delete_async async

delete_async(
    *,
    name=None,
    key=None,
    folder_path=None,
    folder_key=None,
)

Async version of delete().

delete_file

delete_file(
    *,
    name=None,
    key=None,
    blob_file_path,
    folder_key=None,
    folder_path=None,
)

Delete a file from a bucket.

Parameters:

Name Type Description Default
name Optional[str]

Bucket name

None
key Optional[str]

Bucket identifier

None
blob_file_path str

Path to the file in the bucket

required
folder_key Optional[str]

Folder key

None
folder_path Optional[str]

Folder path

None

Examples:

>>> sdk.buckets.delete_file(name="my-storage", blob_file_path="data/file.txt")

delete_file_async async

delete_file_async(
    *,
    name=None,
    key=None,
    blob_file_path,
    folder_key=None,
    folder_path=None,
)

Delete a file from a bucket asynchronously.

Parameters:

Name Type Description Default
name Optional[str]

Bucket name

None
key Optional[str]

Bucket identifier

None
blob_file_path str

Path to the file in the bucket

required
folder_key Optional[str]

Folder key

None
folder_path Optional[str]

Folder path

None

Examples:

>>> await sdk.buckets.delete_file_async(name="my-storage", blob_file_path="data/file.txt")

download

download(
    *,
    name=None,
    key=None,
    blob_file_path,
    destination_path,
    folder_key=None,
    folder_path=None,
)

Download a file from a bucket.

Parameters:

Name Type Description Default
key Optional[str]

The key of the bucket.

None
name Optional[str]

The name of the bucket.

None
blob_file_path str

The path to the file in the bucket.

required
destination_path str

The local path where the file will be saved.

required
folder_key Optional[str]

The key of the folder where the bucket resides.

None
folder_path Optional[str]

The path of the folder where the bucket resides.

None

Raises:

Type Description
ValueError

If neither key nor name is provided.

Exception

If the bucket with the specified key is not found.

download_async async

download_async(
    *,
    name=None,
    key=None,
    blob_file_path,
    destination_path,
    folder_key=None,
    folder_path=None,
)

Download a file from a bucket asynchronously.

Parameters:

Name Type Description Default
key Optional[str]

The key of the bucket.

None
name Optional[str]

The name of the bucket.

None
blob_file_path str

The path to the file in the bucket.

required
destination_path str

The local path where the file will be saved.

required
folder_key Optional[str]

The key of the folder where the bucket resides.

None
folder_path Optional[str]

The path of the folder where the bucket resides.

None

Raises:

Type Description
ValueError

If neither key nor name is provided.

Exception

If the bucket with the specified key is not found.

exists

exists(name, *, folder_key=None, folder_path=None)

Check if bucket exists.

Parameters:

Name Type Description Default
name str

Bucket name

required
folder_key Optional[str]

Folder key

None
folder_path Optional[str]

Folder path

None

Returns:

Name Type Description
bool bool

True if bucket exists

Examples:

>>> if sdk.buckets.exists("my-storage"):
...     print("Bucket found")

exists_async async

exists_async(name, *, folder_key=None, folder_path=None)

Async version of exists().

exists_file

exists_file(
    *,
    name=None,
    key=None,
    blob_file_path,
    folder_key=None,
    folder_path=None,
)

Check if a file exists in a bucket.

Parameters:

Name Type Description Default
name Optional[str]

Bucket name

None
key Optional[str]

Bucket identifier

None
blob_file_path str

Path to the file in the bucket (cannot be empty)

required
folder_key Optional[str]

Folder key

None
folder_path Optional[str]

Folder path

None

Returns:

Name Type Description
bool bool

True if file exists, False otherwise

Note

This method uses short-circuit iteration to stop at the first match, making it memory-efficient even for large buckets. It will raise LookupError if the bucket itself doesn't exist.

Raises:

Type Description
ValueError

If blob_file_path is empty or whitespace-only

LookupError

If bucket is not found

Examples:

>>> if sdk.buckets.exists_file(name="my-storage", blob_file_path="data/file.csv"):
...     print("File exists")
>>> # Check in specific folder
>>> exists = sdk.buckets.exists_file(
...     name="my-storage",
...     blob_file_path="reports/2024/summary.pdf",
...     folder_path="Production"
... )

exists_file_async async

exists_file_async(
    *,
    name=None,
    key=None,
    blob_file_path,
    folder_key=None,
    folder_path=None,
)

Async version of exists_file().

Parameters:

Name Type Description Default
name Optional[str]

Bucket name

None
key Optional[str]

Bucket identifier

None
blob_file_path str

Path to the file in the bucket (cannot be empty)

required
folder_key Optional[str]

Folder key

None
folder_path Optional[str]

Folder path

None

Returns:

Name Type Description
bool bool

True if file exists, False otherwise

Raises:

Type Description
ValueError

If blob_file_path is empty or whitespace-only

LookupError

If bucket is not found

Examples:

>>> if await sdk.buckets.exists_file_async(name="my-storage", blob_file_path="data/file.csv"):
...     print("File exists")

get_files

get_files(
    *,
    name=None,
    key=None,
    prefix="",
    recursive=False,
    file_name_glob=None,
    folder_key=None,
    folder_path=None,
)

Get files using OData GetFiles API (Studio-compatible).

This method uses the GetFiles API which is used by UiPath Studio activities. Use this when you need: - Recursive directory traversal - Glob pattern filtering (e.g., "*.pdf") - Compatibility with Studio activity behavior

Parameters:

Name Type Description Default
name Optional[str]

Bucket name

None
key Optional[str]

Bucket identifier

None
prefix str

Directory path to filter files (default: root)

''
recursive bool

Recurse subdirectories for flat view (default: False)

False
file_name_glob Optional[str]

File filter pattern (e.g., ".pdf", "data_.csv")

None
folder_key Optional[str]

Folder key

None
folder_path Optional[str]

Folder path

None

Returns:

Type Description
Iterator[BucketFile]

Iterator[BucketFile]: Iterator of files matching criteria

Raises:

Type Description
ValueError

If neither name nor key is provided

LookupError

If bucket not found

Exception

For API errors or invalid responses

Note

For large buckets with 10,000+ files, consider using list_files() which uses more efficient cursor-based pagination.

Examples:

>>> # Get all PDF files recursively
>>> for file in sdk.buckets.get_files(
...     name="my-storage",
...     recursive=True,
...     file_name_glob="*.pdf"
... ):
...     print(f"{file.path} - {file.size} bytes")
>>>
>>> # Get files in specific directory
>>> files = list(sdk.buckets.get_files(
...     name="my-storage",
...     prefix="reports/"
... ))

get_files_async async

get_files_async(
    *,
    name=None,
    key=None,
    prefix="",
    recursive=False,
    file_name_glob=None,
    folder_key=None,
    folder_path=None,
)

Async version of get_files().

See get_files() for detailed documentation.

Examples:

>>> async for file in sdk.buckets.get_files_async(
...     name="my-storage",
...     recursive=True,
...     file_name_glob="*.pdf"
... ):
...     print(file.path)

list

list(*, folder_path=None, folder_key=None, name=None)

List buckets with auto-pagination.

Parameters:

Name Type Description Default
folder_path Optional[str]

Folder path to filter buckets

None
folder_key Optional[str]

Folder key (mutually exclusive with folder_path)

None
name Optional[str]

Filter by bucket name (contains match)

None

Yields:

Name Type Description
Bucket Bucket

Bucket resource instances

Examples:

>>> # List all buckets
>>> for bucket in sdk.buckets.list():
...     print(bucket.name)
>>>
>>> # Filter by folder
>>> for bucket in sdk.buckets.list(folder_path="Production"):
...     print(bucket.name)
>>>
>>> # Filter by name
>>> for bucket in sdk.buckets.list(name="invoice"):
...     print(bucket.name)

list_async async

list_async(*, folder_path=None, folder_key=None, name=None)

Async version of list() with auto-pagination.

list_files

list_files(
    *,
    name=None,
    key=None,
    prefix="",
    folder_key=None,
    folder_path=None,
)

List files in a bucket.

Parameters:

Name Type Description Default
name Optional[str]

Bucket name

None
key Optional[str]

Bucket identifier

None
prefix str

Filter files by prefix

''
folder_key Optional[str]

Folder key

None
folder_path Optional[str]

Folder path

None

Returns:

Type Description
Iterator[BucketFile]

Iterator[BucketFile]: Iterator of files in the bucket

Note

Returns an iterator for memory efficiency. Use list() to materialize all results: files = list(sdk.buckets.list_files(name="my-storage"))

This method automatically handles pagination, fetching up to 500 files per request.

Examples:

>>> for file in sdk.buckets.list_files(name="my-storage"):
...     print(file.path)
>>> files = list(sdk.buckets.list_files(name="my-storage", prefix="data/"))

list_files_async async

list_files_async(
    *,
    name=None,
    key=None,
    prefix="",
    folder_key=None,
    folder_path=None,
)

List files in a bucket asynchronously.

Parameters:

Name Type Description Default
name Optional[str]

Bucket name

None
key Optional[str]

Bucket identifier

None
prefix str

Filter files by prefix

''
folder_key Optional[str]

Folder key

None
folder_path Optional[str]

Folder path

None

Returns:

Type Description
AsyncIterator[BucketFile]

AsyncIterator[BucketFile]: Async iterator of files in the bucket

Note

Returns an async iterator for memory efficiency. Use list comprehension to materialize: files = [f async for f in sdk.buckets.list_files_async(name="my-storage")]

This method automatically handles pagination, fetching up to 500 files per request.

Examples:

>>> async for file in sdk.buckets.list_files_async(name="my-storage"):
...     print(file.path)
>>> files = [f async for f in sdk.buckets.list_files_async(name="my-storage", prefix="data/")]

retrieve

retrieve(
    *,
    name=None,
    key=None,
    folder_key=None,
    folder_path=None,
)

Retrieve bucket information by its name.

Parameters:

Name Type Description Default
name Optional[str]

The name of the bucket to retrieve.

None
key Optional[str]

The key of the bucket.

None
folder_key Optional[str]

The key of the folder where the bucket resides.

None
folder_path Optional[str]

The path of the folder where the bucket resides.

None

Returns:

Name Type Description
Bucket Bucket

The bucket resource instance.

Raises:

Type Description
ValueError

If neither bucket key nor bucket name is provided.

Exception

If the bucket with the specified name is not found.

Examples:

>>> bucket = sdk.buckets.retrieve(name="my-storage")
>>> print(bucket.name, bucket.identifier)

retrieve_async async

retrieve_async(
    *,
    name=None,
    key=None,
    folder_key=None,
    folder_path=None,
)

Asynchronously retrieve bucket information by its name.

Parameters:

Name Type Description Default
name Optional[str]

The name of the bucket to retrieve.

None
key Optional[str]

The key of the bucket.

None
folder_key Optional[str]

The key of the folder where the bucket resides.

None
folder_path Optional[str]

The path of the folder where the bucket resides.

None

Returns:

Name Type Description
Bucket Bucket

The bucket resource instance.

Raises:

Type Description
ValueError

If neither bucket key nor bucket name is provided.

Exception

If the bucket with the specified name is not found.

Examples:

>>> bucket = await sdk.buckets.retrieve_async(name="my-storage")
>>> print(bucket.name, bucket.identifier)

upload

upload(
    *,
    key=None,
    name=None,
    blob_file_path,
    content_type=None,
    source_path=None,
    content=None,
    folder_key=None,
    folder_path=None,
)

Upload a file to a bucket.

Parameters:

Name Type Description Default
key Optional[str]

The key of the bucket.

None
name Optional[str]

The name of the bucket.

None
blob_file_path str

The path where the file will be stored in the bucket.

required
content_type Optional[str]

The MIME type of the file. For file inputs this is computed dynamically. Default is "application/octet-stream".

None
source_path Optional[str]

The local path of the file to upload.

None
content Optional[Union[str, bytes]]

The content to upload (string or bytes).

None
folder_key Optional[str]

The key of the folder where the bucket resides.

None
folder_path Optional[str]

The path of the folder where the bucket resides.

None

Raises:

Type Description
ValueError

If neither key nor name is provided.

Exception

If the bucket with the specified key or name is not found.

upload_async async

upload_async(
    *,
    key=None,
    name=None,
    blob_file_path,
    content_type=None,
    source_path=None,
    content=None,
    folder_key=None,
    folder_path=None,
)

Upload a file to a bucket asynchronously.

Parameters:

Name Type Description Default
key Optional[str]

The key of the bucket.

None
name Optional[str]

The name of the bucket.

None
blob_file_path str

The path where the file will be stored in the bucket.

required
content_type Optional[str]

The MIME type of the file. For file inputs this is computed dynamically. Default is "application/octet-stream".

None
source_path Optional[str]

The local path of the file to upload.

None
content Optional[Union[str, bytes]]

The content to upload (string or bytes).

None
folder_key Optional[str]

The key of the folder where the bucket resides.

None
folder_path Optional[str]

The path of the folder where the bucket resides.

None

Raises:

Type Description
ValueError

If neither key nor name is provided.

Exception

If the bucket with the specified key or name is not found.