trait FoldersTrait

Enables you to manage the folders in your cloud.

Learn more: Folders method - Admin API

Properties

ApiClient $apiClient Defined in AdminApi class.

Methods

rootFolders(array $options = [])

Lists all root folders.

subFolders(string $ofFolderPath, array $options = [])

Lists sub-folders.

createFolder(string $path)

Creates a new empty folder.

deleteFolder(string $path)

Deletes an empty folder.

Details

ApiResponse rootFolders(array $options = [])

Lists all root folders.

Parameters

Name Type Description
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

See also

https://cloudinary.com/documentation/admin_api#get_root_folders

ApiResponse subFolders(string $ofFolderPath, array $options = [])

Lists sub-folders.

Returns the name and path of all the sub-folders of a specified parent folder. Limited to 2000 results.

Parameters

Name Type Description
$ofFolderPath string The parent folder
$options array The optional parameters. See the Admin API documentation.

Return Value

ApiResponse

Exceptions

ApiError

See also

https://cloudinary.com/documentation/admin_api#get_subfolders

ApiResponse createFolder(string $path)

Creates a new empty folder.

Parameters

Name Type Description
$path string The full path of the new folder to create.

Return Value

ApiResponse

Exceptions

ApiError

See also

https://cloudinary.com/documentation/admin_api#create_folder

ApiResponse deleteFolder(string $path)

Deletes an empty folder.

The specified folder cannot contain any assets, but can have empty descendant sub-folders.

Parameters

Name Type Description
$path string The full path of the empty folder to delete.

Return Value

ApiResponse

Exceptions

ApiError

See also

https://cloudinary.com/documentation/admin_api#delete_folder