# File

The Files API is a standard HTTP API that allows you to read, write, list, and delete files and directories by referring to their URI. The API makes working with file content as raw bytes easier and more efficient.

The API supports [Unity Catalog volumes](https://docs.databricks.com/en/connect/unity-catalog/volumes.html), where files and directories to operate on are specified using their volume URI path, which follows the format `/Volumes/<catalog_name>/<schema_name>/<volume_name>/<path_to_file>`.

The Files API has two distinct endpoints, one for working with files (`/fs/files`) and another one for working with directories (`/fs/directories`). Both endpoints use the standard HTTP methods GET, HEAD, PUT, and DELETE to manage files and directories specified using their URI path. The path is always absolute.

Use of Files API may incur Databricks data transfer charges.

## Endpoints

### Get

- [HEAD /api/2.0/fs/files{file_path}](get-file-metadata.md)

### Create

- [PUT /api/2.0/fs/files{file_path}](upload-file.md)

### Delete

- [DELETE /api/2.0/fs/files{file_path}](delete-file.md)

### Create Directory

- [PUT /api/2.0/fs/directories{directory_path}](create-directory.md)

### Delete Directory

- [DELETE /api/2.0/fs/directories{directory_path}](delete-directory.md)

### Download File

- [GET /api/2.0/fs/files{file_path}](download-file.md)

### Get Directory Metadata

- [HEAD /api/2.0/fs/directories{directory_path}](get-directory-metadata.md)

### List Directory Contents

- [GET /api/2.0/fs/directories{directory_path}](list-directory-contents.md)
