File operations provide a comprehensive set of endpoints for managing files and directories — uploading, modifying, deleting, searching, and inspecting them. Use these endpoints to integrate file management directly into your applications, with support for both local storage and remote cloud backends.
Search for files matching a query string. Returns HTML by default, or JSON when ?json is supplied. Matches are case-insensitive filename matches.
Name In Type Required Description directorypath string Yes Directory to search within qquery string Yes Search query (case-insensitive filename match) jsonquery string No Return JSON format instead of HTML
curl -X GET " https://api.example.com/documents?q=report&json "
const results = await client . files . search ( {
"name" : " monthly-reports " ,
"uri_prefix" : " /documents/ " ,
"user" : " user@example.com "
"error" : " Search is not enabled on this server " ,
Error Code Title Description Resolution SEARCH_FORBIDDENSearch operation not allowed Server is not configured to allow file searching Contact administrator to enable —allow-search flag INSUFFICIENT_PERMISSIONSInsufficient permissions User account does not have search permissions for this path Contact administrator for search permissions or authenticate with different account
Process and convert images on the fly. Supports JPEG, PNG, WebP, GIF, and BMP input/output, with resizing, quality control, blur, grayscale, and background color options. Works for both local files and all 60+ remote cloud storage backends.
Name In Type Required Description imagepath string Yes Path to image file thumbnailquery string Yes Enable image processing formatquery string No Output format (default: jpeg) — one of jpeg, png, webp, gif, bmp sizequery string No Width×Height in pixels (max: 2000×2000) widthquery integer No Width in pixels (height auto-calculated) heightquery integer No Height in pixels (width auto-calculated) resizequery string No Resize mode: fit (preserve aspect, fit within), fill (exact size, crop), cover (cover area), exact (force dimensions) — default: fit qualityquery string No Resize algorithm quality: low (box filter), medium (bilinear), high (Lanczos3) — default: medium qquery integer No JPEG/WebP quality (1-100, higher is better quality) — default: 85 blurquery number No Gaussian blur radius (0-50) grayscalequery string No Convert to grayscale/black-and-white bgquery string No Background color for transparency (hex RGB, e.g., ffffff for white)
curl -X GET " https://api.example.com/photos/landscape.png?thumbnail=&width=800&format=webp&q=80 " \
const image = await client . files . images . process ( {
image: " photos/landscape.png " ,
"description" : " Processed image returned as binary data with Content-Type matching the requested format. Cache-Control: public, max-age=3600 "
"error" : " Unsupported image format " ,
Find files and directories matching a glob pattern. Supports recursive patterns (**/*.rs), brace expansion ({ts,tsx}), character classes [a-z], and standard wildcards (*). Returns file metadata sorted by modification time (newest first) by default. Respects .gitignore by default.
Name In Type Required Description pathpath string Yes Directory path to search within patternquery string Yes Glob pattern (e.g. **/*.rs, src/**/*.{ts,tsx}, *.md) max_resultsquery integer No Maximum entries to return — default: 1000 max_depthquery integer No Maximum directory recursion depth — default: 50 max_files_scannedquery integer No Maximum filesystem entries to scan — default: 100000 timeoutquery integer No Search timeout in seconds — default: 30 no_ignorequery boolean No Bypass .gitignore filtering — default: false sortquery string No Sort results by: mtime (modification time), name, or size — default: mtime orderquery string No Sort order. Default: desc for mtime, asc for name/size — one of asc, desc
curl -X GET " https://api.example.com/api/v1/files/glob/src?pattern=**/*.ts&max_results=50 "
const results = await client . files . glob ( {
"name" : " src/utils/helpers.ts " ,
"error" : " Invalid glob pattern " ,
"error" : " Search is not enabled on this server " ,
"error" : " Path not found " ,
"error" : " Too many concurrent searches " ,
Search file or directory contents using regex patterns. Powered by ripgrep with .gitignore support, binary file detection, and configurable limits. Returns matching lines with optional context.
Name In Type Required Description pathpath string Yes File or directory path to search patternquery string Yes Search pattern (regex by default, literal if fixed_string=true) ignore_casequery boolean No Case-insensitive matching — default: false fixed_stringquery boolean No Treat pattern as literal string, not regex — default: false globquery string No Filter files by glob pattern (e.g. *.rs, *.{ts,tsx}) contextquery integer No Number of context lines before and after each match — default: 0 max_countquery integer No Maximum matches per file — default: 50 max_matchesquery integer No Total maximum matches across all files — default: 500 max_depthquery integer No Maximum directory recursion depth — default: 50 max_filesizequery integer No Skip files larger than this (bytes) — default: 10485760 timeoutquery integer No Search timeout in seconds — default: 30 no_ignorequery boolean No Bypass .gitignore filtering — default: false
curl -X GET " https://api.example.com/api/v1/files/grep/src?pattern=TODO&context=2&max_count=20 "
const results = await client . files . grep ( {
"context_after" : [ " return result; " ],
"context_before" : [ " function calculate() { " ],
"line" : " // TODO: handle edge case " ,
"path" : " src/utils/math.ts "
"total_files_matched" : 1 ,
"total_files_searched" : 84 ,
"error" : " Invalid regex pattern " ,
"error" : " Grep is not enabled on this server " ,
"error" : " Path not found " ,
"error" : " Too many concurrent searches " ,
Resolve a file or directory path to its canonical absolute form by following all symbolic links and resolving all ./.. segments. Equivalent to POSIX realpath(3) or Node.js fs.realpath(). The returned real_path is relative to the serve root. Returns 404 if the path does not exist, 400 for circular symlinks (ELOOP), and 403 if the resolved path escapes the serve root.
Name In Type Required Description pathpath string Yes File or directory path to resolve
curl -X GET " https://api.example.com/api/v1/files/realpath/docs/../README.md "
const result = await client . files . realpath ( {
path: " docs/../README.md "
"path" : " docs/../README.md " ,
"real_path" : " /README.md "
"error" : " Symlink loop detected " ,
Error Code Title Description Resolution INVALID_PATHInvalid path Path contains invalid characters or traversal attempts — ELOOPSymlink loop Too many levels of symbolic links (circular chain) — OPERATION_CONFLICTOperation conflict Cannot combine realpath with other query operations —
"error" : " Resolved path is outside serve root " ,
Error Code Title Description Resolution PERMISSION_DENIEDPermission denied Insufficient permissions to access the path — PATH_ESCAPEPath escapes root Resolved canonical path is outside the serve root —
"error" : " Path not found " ,
Error Code Title Description Resolution PATH_NOT_FOUNDPath not found The path does not exist or contains a broken symlink Verify the path exists and all symlinks in the chain are valid
Get detailed metadata (stat) for a single file or directory without downloading content. Returns name, type, size, modification time, permissions, ownership, and symlink information.
Name In Type Required Description pathpath string Yes File or directory path
curl -X GET " https://api.example.com/api/v1/files/stat/README.md "
const metadata = await client . files . stat ( {
"error" : " File not found " ,
Error Code Title Description Resolution FILE_NOT_FOUNDFile not found The specified path does not exist Verify the path is correct
Perform various file operations: create directory, extract archive, download from URL, move, or copy. Pass the operation as a query parameter.
Name In Type Required Description pathpath string Yes Target file or directory path backendquery string No Backend ID for remote operations mkdirquery string No Create directory extractquery string No Extract archive. Empty value extracts all; non-empty value is a selective path to extract (e.g. src/main.rs or lib/) destquery string No Destination directory name for extraction (default: archive name without extension) download_fromquery string No Download file from remote URL move_toquery string No Move file/directory to destination path copy_toquery string No Copy file/directory to destination path overwritequery string No Allow overwriting existing destination (for copy) — one of true, false ownerquery string No Create-time owner for newly-created inodes as user[:group] or uid[:gid]. Requires —allow-chown and must resolve to an entry in —allowed-create-owners; refuses root (uid/gid 0). Absent → the server default create owner. Applies to mkdir/extract/download_from/copy_to.
curl -X POST " https://api.example.com/api/v1/files/projects/new-app?mkdir= "
curl -X POST " https://api.example.com/api/v1/files/downloads/release.tar.gz?extract= "
curl -X POST " https://api.example.com/api/v1/files/data.csv?download_from=https://example.com/data.csv "
await client . files . operate ({
path: " projects/new-app " ,
await client . files . operate ({
path: " downloads/release.tar.gz " ,
"source" : " /data/old.csv " ,
"destination" : " /data/new.csv " ,
"message" : " Directory created " ,
"error" : " Source file or directory not found " ,
"error" : " Destination already exists " ,
Copy a file or directory to a new location. Supports recursive directory copy. Auto-creates parent directories at destination. Use ?overwrite=true to replace existing destination.
Name In Type Required Description pathpath string Yes Source file or directory path copy_toquery string Yes Destination path to copy the file/directory to overwritequery string No Allow overwriting existing destination (default: false) — one of true, false ownerquery string No Create-time owner (user[:group]/uid[:gid]) for newly-created copies. Requires —allow-chown + allowlist; refuses root. Overwritten existing files preserve their owner. Absent → server default.
curl -X POST " https://api.example.com/api/v1/files/copy/src/index.ts?copy_to=backup/index.ts "
const result = await client . files . copy ( {
copy_to: " backup/index.ts "
"destination" : " backup/index.ts " ,
"source" : " src/index.ts " ,
"error" : " Copy operations are not enabled on this server " ,
Error Code Title Description Resolution COPY_FORBIDDENCopy not allowed Server requires —allow-upload flag for copy operations Contact administrator to enable —allow-upload flag
"error" : " Source file or directory not found " ,
Error Code Title Description Resolution SOURCE_NOT_FOUNDSource not found The source path does not exist Verify the source path is correct
"error" : " Destination already exists " ,
Error Code Title Description Resolution DESTINATION_EXISTSDestination conflict A file or directory already exists at the destination path Use ?overwrite=true to replace or choose a different destination
Move or rename a file/directory to a new location. Works across directories. Auto-creates parent directories at destination. Requires both upload and delete permissions.
Name In Type Required Description pathpath string Yes Source file or directory path move_toquery string Yes Destination path to move the file/directory to ownerquery string No Create-time owner (user[:group]/uid[:gid]) for newly-created destination PARENT directories. Requires —allow-chown + —allowed-create-owners; refuses root. The moved inode itself preserves its existing owner. Absent → server default.
curl -X POST " https://api.example.com/api/v1/files/move/draft.md?move_to=published/draft.md "
const result = await client . files . move ( {
move_to: " published/draft.md "
"destination" : " published/draft.md " ,
"error" : " Move operations are not enabled on this server " ,
Error Code Title Description Resolution MOVE_FORBIDDENMove not allowed Server requires both —allow-upload and —allow-delete flags for move operations Contact administrator to enable both flags
"error" : " Source file or directory not found " ,
Error Code Title Description Resolution SOURCE_NOT_FOUNDSource not found The source path does not exist Verify the source path is correct
"error" : " Destination already exists " ,
Error Code Title Description Resolution DESTINATION_EXISTSDestination conflict A file or directory already exists at the destination path Delete the existing file first or choose a different destination
Upload a file to the server. Creates new files or overwrites existing ones.
Name In Type Required Description pathpath string Yes Destination file path
Sends the file content as application/octet-stream binary data.
curl -X PUT " https://api.example.com/uploads/report.pdf " \
-H " Content-Type: application/octet-stream " \
--data-binary @report.pdf
const result = await client . files . upload ( {
path: " uploads/report.pdf " ,
"description" : " File uploaded successfully "
"error" : " Upload operations are not enabled on this server " ,
Error Code Title Description Resolution UPLOAD_FORBIDDENUpload operation not allowed Server is not configured to allow file uploads Contact administrator to enable —allow-upload flag
Create an empty file if it does not exist, or update the modification time if it does. Cannot be used on directories.
Name In Type Required Description pathpath string Yes File path to touch touchquery string Yes Flag to indicate touch operation
curl -X PUT " https://api.example.com/logs/today.txt?touch= "
await client . files . touch ({
"description" : " File created (did not exist) "
"description" : " Modification time updated (file already existed) "
"error" : " Cannot touch a directory " ,
"error" : " Touch operations are not enabled on this server " ,
Error Code Title Description Resolution TOUCH_FORBIDDENTouch operation not allowed Server is not configured to allow touch operations Contact administrator to enable —allow-touch flag
Upload a file to the server or to a remote backend. Use ?append to append to an existing file instead of overwriting.
Name In Type Required Description pathpath string Yes Destination file path backendquery string No Backend ID for remote upload appendquery string No Append body to end of existing file (create if missing) instead of overwriting ownerquery string No Create-time owner (user[:group]/uid[:gid]) for a newly-created file. Requires —allow-chown + —allowed-create-owners; refuses root. Overwrites/appends to an existing file preserve its owner. Absent → server default.
Sends the file content as application/octet-stream binary data.
curl -X PUT " https://api.example.com/api/v1/files/uploads/data.csv " \
-H " Content-Type: application/octet-stream " \
const result = await client . files . put ( {
path: " uploads/data.csv " ,
"path" : " logs/server.log " ,
"message" : " File uploaded successfully " ,
"path" : " uploads/data.csv " ,
"error" : " Upload operations are not enabled on this server " ,
Error Code Title Description Resolution UPLOAD_FORBIDDENUpload operation not allowed Server is not configured to allow file uploads Contact administrator to enable —allow-upload flag INSUFFICIENT_PERMISSIONSInsufficient permissions User account does not have upload permissions for this path Contact administrator for write permissions or authenticate with different account
Append binary data to the end of an existing file. Creates the file if it does not exist. Auto-creates parent directories.
Name In Type Required Description pathpath string Yes File path ownerquery string No Create-time owner (user[:group]/uid[:gid]) when this append creates a new file. Requires —allow-chown + allowlist; refuses root. Absent → server default.
Sends the file content as application/octet-stream binary data.
curl -X PUT " https://api.example.com/api/v1/files/append/logs/server.log " \
-H " Content-Type: application/octet-stream " \
--data-binary " New log line\n "
const result = await client . files . append ( {
body: Buffer . from ( " New log line \n " )
"path" : " logs/server.log " ,
"error" : " Upload operations are not enabled on this server " ,
Error Code Title Description Resolution UPLOAD_FORBIDDENUpload not allowed Server is not configured to allow file uploads Contact administrator to enable —allow-upload flag
Supports resumable uploads, appending to files, changing file permissions (Unix only), changing file ownership (Unix only), and renaming files or directories.
Name In Type Required Description pathpath string Yes File or directory path X-Update-Rangeheader string No Set to append to append data to the end of the file. Perfect for logs and incremental writes. Example: curl -X PATCH -H 'X-Update-Range: append' --data-binary @data.txt http://server/file.log
The request body is one of:
ChmodRequest ({ "mode": "755" }) — change file permissions
ChownRequest ({ "owner": "user", "group": "users" }) — change file ownership
RenameRequest ({ "name": "new-filename.txt" }) — rename file or directory
Binary application/octet-stream — for resumable uploads or appending (use X-Update-Range: append header)
curl -X PATCH " https://api.example.com/script.sh " \
-H " Content-Type: application/json " \
curl -X PATCH " https://api.example.com/old-name.txt " \
-H " Content-Type: application/json " \
-d ' {"name": "new-name.txt"} '
curl -X PATCH " https://api.example.com/logs/server.log " \
-H " X-Update-Range: append " \
-H " Content-Type: application/octet-stream " \
--data-binary " New log line\n "
await client . files . patch ({
await client . files . patch ({
data: { name: " new-name.txt " }
"description" : " Operation successful "
"error" : " Invalid permissions format " ,
Error Code Title Description Resolution INVALID_OPERATIONInvalid operation The requested operation is not valid or parameters are malformed Check request format and ensure valid operation parameters INVALID_PERMISSIONS_FORMATInvalid permissions format Chmod mode must be valid octal format (e.g., 755, 644) Use valid octal permission format
"error" : " Operation not allowed on this server " ,
Error Code Title Description Resolution OPERATION_FORBIDDENOperation not allowed Server is not configured to allow this operation (chmod/chown/rename/upload) Contact administrator to enable appropriate flags INSUFFICIENT_PERMISSIONSInsufficient permissions User account does not have permissions for this operation Contact administrator for required permissions
"error" : " A file with the target name already exists " ,
Error Code Title Description Resolution FILE_EXISTSFile already exists Cannot rename - a file or directory with the target name already exists Choose a different name or delete the existing file first NAME_CONFLICTName conflict The target filename conflicts with an existing entry Use a unique filename or remove conflicting file
Modify file properties or move/rename via REST API v1. Supports chmod (?chmod=755), chown (?chown=user:group), rename (JSON body with name), and cross-directory move (JSON body with move_to).
Name In Type Required Description pathpath string Yes File path backendquery string No Backend ID for remote file operations chmodquery string No Set file permissions using octal mode value (e.g., ?chmod=755) chownquery string No Set file ownership (e.g., ?chown=user:group or ?chown=user) ownerquery string No Create-time owner (user[:group]/uid[:gid]) for newly-created destination parent directories on a JSON-body move_to. Requires —allow-chown + —allowed-create-owners; cannot be root. The moved item keeps its own owner. Absent → server default.
The request body is one of:
MoveRequest ({ "move_to": "/new/dir/file.txt" }) — move file to a new path
RenameRequest ({ "name": "new-filename.txt" }) — rename file in place
curl -X PATCH " https://api.example.com/api/v1/files/script.sh?chmod=755 "
curl -X PATCH " https://api.example.com/api/v1/files/script.sh?chown=user:staff "
curl -X PATCH " https://api.example.com/api/v1/files/old/path.txt " \
-H " Content-Type: application/json " \
-d ' {"move_to": "/new/dir/path.txt"} '
// Change permissions via query
await client . files . patchApi ({
await client . files . patchApi ({
data: { move_to: " /new/dir/path.txt " }
"error" : " Invalid chmod mode " ,
Error Code Title Description Resolution INVALID_MODEInvalid chmod mode The chmod mode value is not valid octal notation Use octal notation like 755 or 644 (max 7777) INVALID_OWNERInvalid owner or group The specified user or group could not be resolved Verify the username/group exists on the system
"error" : " chmod not allowed on this server " ,
Error Code Title Description Resolution CHMOD_FORBIDDENChmod not allowed Server is not configured to allow chmod operations Contact administrator to enable —allow-chmod flag CHOWN_FORBIDDENChown not allowed Server is not configured to allow chown operations Contact administrator to enable —allow-chown flag
"error" : " File or directory not found " ,
"error" : " Destination already exists " ,
Change file or directory permissions using octal mode (Unix only). Pass the mode value in the chmod query parameter, e.g., ?chmod=755.
Name In Type Required Description pathpath string Yes File or directory path chmodquery string Yes Octal permission mode (e.g., 755, 644, 0755)
curl -X PATCH " https://api.example.com/api/v1/files/chmod/script.sh?chmod=755 "
const result = await client . files . chmod ( {
"error" : " Invalid chmod mode " ,
Error Code Title Description Resolution INVALID_MODEInvalid chmod mode The mode value is not valid octal notation Use octal notation like 755 or 644 (max 7777) UNIX_ONLYUnix only chmod is only supported on Unix systems Use a Unix-based server
"error" : " chmod not allowed on this server " ,
Error Code Title Description Resolution CHMOD_FORBIDDENChmod not allowed Server is not configured to allow chmod operations Contact administrator to enable —allow-chmod flag
"error" : " File or directory not found " ,
Change file or directory ownership (Unix only). Pass owner:group in the chown query parameter, e.g., ?chown=user:group. Group is optional.
Name In Type Required Description pathpath string Yes File or directory path chownquery string Yes Owner and optional group (e.g., user:group, user, :group, or UID:GID)
curl -X PATCH " https://api.example.com/api/v1/files/chown/data.csv?chown=app:staff "
const result = await client . files . chown ( {
"error" : " Invalid owner or group " ,
Error Code Title Description Resolution INVALID_OWNERInvalid owner The specified user could not be resolved Verify the username or UID exists on the system INVALID_GROUPInvalid group The specified group could not be resolved Verify the group name or GID exists on the system UNIX_ONLYUnix only chown is only supported on Unix systems Use a Unix-based server
"error" : " chown not allowed on this server " ,
Error Code Title Description Resolution CHOWN_FORBIDDENChown not allowed Server is not configured to allow chown operations Contact administrator to enable —allow-chown flag
"error" : " File or directory not found " ,
Permanently delete a file or directory. Recursive — deleting a directory removes its contents.
Name In Type Required Description pathpath string Yes Path to file or directory to delete
curl -X DELETE " https://api.example.com/old/draft.txt "
const result = await client . files . deleteRecursive ( {
"message" : " File deleted successfully " ,
"error" : " Delete operations are not enabled on this server " ,
Error Code Title Description Resolution DELETE_FORBIDDENDelete operation not allowed Server is not configured to allow file deletion Contact administrator to enable —allow-delete flag
"error" : " File or directory not found " ,
Delete a file or directory from the server or a remote backend. Supports a backend query parameter to target a specific cloud storage backend.
Name In Type Required Description pathpath string Yes Path to file or directory to delete backendquery string No Backend ID for remote file deletion
curl -X DELETE " https://api.example.com/api/v1/files/old/draft.txt "
const result = await client . files . delete ( {
"message" : " File deleted successfully " ,
"error" : " Delete operations are not enabled on this server " ,
Error Code Title Description Resolution DELETE_FORBIDDENDelete operation not allowed Server is not configured to allow file deletion Contact administrator to enable —allow-delete flag INSUFFICIENT_PERMISSIONSInsufficient permissions User account does not have delete permissions for this path Contact administrator for write permissions
"error" : " File or directory not found " ,
Error Code Title Description Resolution FILE_NOT_FOUNDFile or directory not found The specified path does not exist in storage or backend Verify the path is correct and the file exists