Skip to content

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.

NameInTypeRequiredDescription
directorypathstringYesDirectory to search within
qquerystringYesSearch query (case-insensitive filename match)
jsonquerystringNoReturn JSON format instead of HTML
Terminal window
curl -X GET "https://api.example.com/documents?q=report&json"

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.

NameInTypeRequiredDescription
imagepathstringYesPath to image file
thumbnailquerystringYesEnable image processing
formatquerystringNoOutput format (default: jpeg) — one of jpeg, png, webp, gif, bmp
sizequerystringNoWidth×Height in pixels (max: 2000×2000)
widthqueryintegerNoWidth in pixels (height auto-calculated)
heightqueryintegerNoHeight in pixels (width auto-calculated)
resizequerystringNoResize mode: fit (preserve aspect, fit within), fill (exact size, crop), cover (cover area), exact (force dimensions) — default: fit
qualityquerystringNoResize algorithm quality: low (box filter), medium (bilinear), high (Lanczos3) — default: medium
qqueryintegerNoJPEG/WebP quality (1-100, higher is better quality) — default: 85
blurquerynumberNoGaussian blur radius (0-50)
grayscalequerystringNoConvert to grayscale/black-and-white
bgquerystringNoBackground color for transparency (hex RGB, e.g., ffffff for white)
Terminal window
curl -X GET "https://api.example.com/photos/landscape.png?thumbnail=&width=800&format=webp&q=80" \
-o landscape-800.webp

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.

NameInTypeRequiredDescription
pathpathstringYesDirectory path to search within
patternquerystringYesGlob pattern (e.g. **/*.rs, src/**/*.{ts,tsx}, *.md)
max_resultsqueryintegerNoMaximum entries to return — default: 1000
max_depthqueryintegerNoMaximum directory recursion depth — default: 50
max_files_scannedqueryintegerNoMaximum filesystem entries to scan — default: 100000
timeoutqueryintegerNoSearch timeout in seconds — default: 30
no_ignorequerybooleanNoBypass .gitignore filtering — default: false
sortquerystringNoSort results by: mtime (modification time), name, or size — default: mtime
orderquerystringNoSort order. Default: desc for mtime, asc for name/size — one of asc, desc
Terminal window
curl -X GET "https://api.example.com/api/v1/files/glob/src?pattern=**/*.ts&max_results=50"

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.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path to search
patternquerystringYesSearch pattern (regex by default, literal if fixed_string=true)
ignore_casequerybooleanNoCase-insensitive matching — default: false
fixed_stringquerybooleanNoTreat pattern as literal string, not regex — default: false
globquerystringNoFilter files by glob pattern (e.g. *.rs, *.{ts,tsx})
contextqueryintegerNoNumber of context lines before and after each match — default: 0
max_countqueryintegerNoMaximum matches per file — default: 50
max_matchesqueryintegerNoTotal maximum matches across all files — default: 500
max_depthqueryintegerNoMaximum directory recursion depth — default: 50
max_filesizequeryintegerNoSkip files larger than this (bytes) — default: 10485760
timeoutqueryintegerNoSearch timeout in seconds — default: 30
no_ignorequerybooleanNoBypass .gitignore filtering — default: false
Terminal window
curl -X GET "https://api.example.com/api/v1/files/grep/src?pattern=TODO&context=2&max_count=20"

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.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path to resolve
Terminal window
curl -X GET "https://api.example.com/api/v1/files/realpath/docs/../README.md"

Get detailed metadata (stat) for a single file or directory without downloading content. Returns name, type, size, modification time, permissions, ownership, and symlink information.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path
Terminal window
curl -X GET "https://api.example.com/api/v1/files/stat/README.md"

Perform various file operations: create directory, extract archive, download from URL, move, or copy. Pass the operation as a query parameter.

NameInTypeRequiredDescription
pathpathstringYesTarget file or directory path
backendquerystringNoBackend ID for remote operations
mkdirquerystringNoCreate directory
extractquerystringNoExtract archive. Empty value extracts all; non-empty value is a selective path to extract (e.g. src/main.rs or lib/)
destquerystringNoDestination directory name for extraction (default: archive name without extension)
download_fromquerystringNoDownload file from remote URL
move_toquerystringNoMove file/directory to destination path
copy_toquerystringNoCopy file/directory to destination path
overwritequerystringNoAllow overwriting existing destination (for copy) — one of true, false
ownerquerystringNoCreate-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.
Terminal window
curl -X POST "https://api.example.com/api/v1/files/projects/new-app?mkdir="

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.

NameInTypeRequiredDescription
pathpathstringYesSource file or directory path
copy_toquerystringYesDestination path to copy the file/directory to
overwritequerystringNoAllow overwriting existing destination (default: false) — one of true, false
ownerquerystringNoCreate-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.
Terminal window
curl -X POST "https://api.example.com/api/v1/files/copy/src/index.ts?copy_to=backup/index.ts"

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.

NameInTypeRequiredDescription
pathpathstringYesSource file or directory path
move_toquerystringYesDestination path to move the file/directory to
ownerquerystringNoCreate-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.
Terminal window
curl -X POST "https://api.example.com/api/v1/files/move/draft.md?move_to=published/draft.md"

Upload a file to the server. Creates new files or overwrites existing ones.

NameInTypeRequiredDescription
pathpathstringYesDestination file path

Sends the file content as application/octet-stream binary data.

Terminal window
curl -X PUT "https://api.example.com/uploads/report.pdf" \
-H "Content-Type: application/octet-stream" \
--data-binary @report.pdf

Create an empty file if it does not exist, or update the modification time if it does. Cannot be used on directories.

NameInTypeRequiredDescription
pathpathstringYesFile path to touch
touchquerystringYesFlag to indicate touch operation
Terminal window
curl -X PUT "https://api.example.com/logs/today.txt?touch="

Upload a file to the server or to a remote backend. Use ?append to append to an existing file instead of overwriting.

NameInTypeRequiredDescription
pathpathstringYesDestination file path
backendquerystringNoBackend ID for remote upload
appendquerystringNoAppend body to end of existing file (create if missing) instead of overwriting
ownerquerystringNoCreate-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.

Terminal window
curl -X PUT "https://api.example.com/api/v1/files/uploads/data.csv" \
-H "Content-Type: application/octet-stream" \
--data-binary @data.csv

Append binary data to the end of an existing file. Creates the file if it does not exist. Auto-creates parent directories.

NameInTypeRequiredDescription
pathpathstringYesFile path
ownerquerystringNoCreate-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.

Terminal window
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"

Supports resumable uploads, appending to files, changing file permissions (Unix only), changing file ownership (Unix only), and renaming files or directories.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path
X-Update-RangeheaderstringNoSet 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)
Terminal window
curl -X PATCH "https://api.example.com/script.sh" \
-H "Content-Type: application/json" \
-d '{"mode": "755"}'

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).

NameInTypeRequiredDescription
pathpathstringYesFile path
backendquerystringNoBackend ID for remote file operations
chmodquerystringNoSet file permissions using octal mode value (e.g., ?chmod=755)
chownquerystringNoSet file ownership (e.g., ?chown=user:group or ?chown=user)
ownerquerystringNoCreate-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
Terminal window
curl -X PATCH "https://api.example.com/api/v1/files/script.sh?chmod=755"

Change file or directory permissions using octal mode (Unix only). Pass the mode value in the chmod query parameter, e.g., ?chmod=755.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path
chmodquerystringYesOctal permission mode (e.g., 755, 644, 0755)
Terminal window
curl -X PATCH "https://api.example.com/api/v1/files/chmod/script.sh?chmod=755"

Change file or directory ownership (Unix only). Pass owner:group in the chown query parameter, e.g., ?chown=user:group. Group is optional.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path
chownquerystringYesOwner and optional group (e.g., user:group, user, :group, or UID:GID)
Terminal window
curl -X PATCH "https://api.example.com/api/v1/files/chown/data.csv?chown=app:staff"

Permanently delete a file or directory. Recursive — deleting a directory removes its contents.

NameInTypeRequiredDescription
pathpathstringYesPath to file or directory to delete
Terminal window
curl -X DELETE "https://api.example.com/old/draft.txt"

Delete a file or directory from the server or a remote backend. Supports a backend query parameter to target a specific cloud storage backend.

NameInTypeRequiredDescription
pathpathstringYesPath to file or directory to delete
backendquerystringNoBackend ID for remote file deletion
Terminal window
curl -X DELETE "https://api.example.com/api/v1/files/old/draft.txt"