Skip to content
Hoody.com

The File Operations endpoints manage the lifecycle of files in your containers: searching, uploading, modifying, copying, moving, and deleting. Use these endpoints when you need to write or restructure files, run targeted searches, or apply POSIX-style permission changes. Image processing and bulk file operations are exposed alongside standard CRUD.

All operations run against the per-container file service hostname. Substitute projectId, containerId, and server with your container’s values.

Search a directory for filenames matching a query. Results are returned as HTML by default; pass ?json= to receive JSON.

NameInTypeRequiredDescription
directorypathstringYesDirectory path to search.
qquerystringYesSearch query (case-insensitive filename match). Maximum 512 BYTES of UTF-8 after form/percent decoding, measured both before and after Unicode lowercasing — lowercasing can change a string’s byte length in either direction. Longer queries are rejected with 400; they are not truncated. Note this is a byte limit, not a character limit, so it is deliberately not expressed as maxLength.
jsonquerystringNoReturn JSON format instead of HTML. Literal value must be an empty string ("").

This endpoint takes no request body.

Terminal window
curl -X GET "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/data/projects?q=config&json="

Find files and directories matching a glob pattern within a directory. Supports recursive patterns (**/*.rs), brace expansion ({ts,tsx}), character classes ([a-z]), and standard wildcards (*). Results are sorted by modification time (newest first) by default and respect .gitignore.

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. Allowed values: asc, desc. Default: desc for mtime, asc for name/size.

This endpoint takes no request body.

Terminal window
curl -X GET "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/glob/workspace/src?pattern=**/*.rs&max_results=200"

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 (10 MB).
timeoutqueryintegerNoSearch timeout in seconds. Default: 30.
no_ignorequerybooleanNoBypass .gitignore filtering. Default: false.

This endpoint takes no request body.

Terminal window
curl -X GET "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/grep/workspace?pattern=TODO&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.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path to resolve.

This endpoint takes no request body.

Terminal window
curl -X GET "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/realpath/data/projects/legacy/../current/script.sh"

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.

This endpoint takes no request body.

Terminal window
curl -X GET "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/stat/data/file.txt"

Process and convert images on-the-fly with format conversion, resizing, and effects. Supports JPEG, PNG, WebP, GIF, and BMP input and output. Works for both local files and all 60+ remote cloud storage backends.

NameInTypeRequiredDescription
imagepathstringYesPath to image file.
thumbnailquerystringYesEnable image processing. Literal value must be an empty string ("").
formatquerystringNoOutput format. Allowed values: jpeg, png, webp, gif, bmp. Default: "jpeg".
sizequerystringNoWidth by Height in pixels (max: 2000 by 2000).
widthqueryintegerNoWidth in pixels (height auto-calculated).
heightqueryintegerNoHeight in pixels (width auto-calculated).
resizequerystringNoResize mode. Allowed values: fit (preserve aspect, fit within), fill (exact size, crop), cover (cover area), exact (force dimensions). Default: "fit".
qualityquerystringNoResize algorithm quality. Allowed values: 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. Literal value must be an empty string ("").
bgquerystringNoBackground color for transparency (hex RGB, e.g. ffffff for white).

This endpoint takes no request body.

Terminal window
curl -X GET "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/photos/cover.jpg?thumbnail=&format=webp&size=800x600&q=80"

Perform various file operations through a single endpoint. Pass one of the following query flags to select the operation: mkdir, extract, download_from, move_to, or copy_to.

NameInTypeRequiredDescription
pathpathstringYesTarget path.
backendquerystringNoBackend ID for remote storage operations.
mkdirquerystringNoCreate directory. Literal value must be an empty string ("").
extractquerystringNoExtract archive. Empty value extracts all; non-empty value is a selective path to extract (e.g. src/ 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). Allowed values: 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 means the server default create owner. Applies to mkdir, extract, download_from, and copy_to.

This endpoint takes no request body.

Terminal window
curl -X POST "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/data/new-folder?mkdir="

Copy a file or directory to a new location. Supports recursive directory copy. Auto-creates parent directories at the destination. Use ?overwrite=true to replace an existing destination.

NameInTypeRequiredDescription
pathpathstringYesSource file or directory path.
copy_toquerystringYesDestination path to copy the file/directory to.
overwritequerystringNoAllow overwriting existing destination. Allowed values: true, false. Default: false.
ownerquerystringNoCreate-time owner (user[:group]/uid[:gid]) for newly-created copies. Requires --allow-chown and allowlist; refuses root. Overwritten existing files preserve their owner. Absent means server default.

This endpoint takes no request body.

Terminal window
curl -X POST "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/copy/src/notes.txt?copy_to=/dst/notes.txt"

Move or rename a file or directory to a new location. Works across directories. Auto-creates parent directories at the 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 and --allowed-create-owners; refuses root. The moved inode itself preserves its existing owner. Absent means server default.

This endpoint takes no request body.

Terminal window
curl -X POST "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/move/src/notes.txt?move_to=/archive/notes.txt"

Upload a file to the server. Creates a new file or overwrites an existing one.

NameInTypeRequiredDescription
pathpathstringYesDestination file path.

Binary body — the raw file contents (application/octet-stream).

Terminal window
curl -X PUT "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/uploads/data.bin" \
--data-binary @./local-file.bin

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. Literal value must be an empty string ("").

This endpoint takes no request body.

Terminal window
curl -X PUT "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/tmp/marker.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. Literal value must be an empty string ("").
ownerquerystringNoCreate-time owner (user[:group]/uid[:gid]) for a newly-created file. Requires --allow-chown and --allowed-create-owners; refuses root. Overwrites and appends to an existing file preserve its owner. Absent means server default.

Binary body — the raw file contents (application/octet-stream).

Terminal window
curl -X PUT "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/logs/app.log?append=" \
--data-binary @./incremental.log

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 and allowlist; refuses root. Absent means server default.

Binary body — the raw data to append (application/octet-stream).

Terminal window
curl -X PUT "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/append/logs/app.log" \
--data-binary "request_id=abc123 status=200 latency_ms=42"

Multi-purpose file operation endpoint. Send a JSON body to change permissions (chmod), ownership (chown), or rename the file; send an octet-stream body to perform a resumable upload or append (set the X-Update-Range: append header for appends).

NameInTypeRequiredDescription
pathpathstringYesTarget file path.
X-Update-RangeheaderstringNoSet to append to append data to the end of the file. Perfect for logs and incremental writes. Literal value: append.

One of the following JSON bodies, or a raw binary body for resumable uploads.

Chmod request (changes Unix permissions):

FieldTypeRequiredDescription
modestringYesOctal permission mode (e.g. "755", "644").
{
"mode": "755"
}

Chown request (changes Unix ownership):

FieldTypeRequiredDescription
ownerstringNoUsername or UID.
groupstringNoGroup name or GID.
{
"owner": "alice",
"group": "staff"
}

Rename request (renames in place):

FieldTypeRequiredDescription
namestringYesNew filename (cannot contain path separators).
{
"name": "new-filename.txt"
}

For resumable uploads or appends, send raw binary in the body and use the X-Update-Range: append header to append.

Terminal window
# Rename via JSON body
curl -X PATCH "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/data/old-name.txt" \
-H "Content-Type: application/json" \
-d '{"name": "new-name.txt"}'
# Append via binary body
curl -X PATCH "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/logs/app.log" \
-H "X-Update-Range: append" \
--data-binary "incremental line"

REST v1 variant of file property modification. 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.
ownerquerystringNoCreate-time owner (user[:group]/uid[:gid]) for newly-created destination parent directories on a JSON-body move_to. Requires --allow-chown and --allowed-create-owners; cannot be root. The moved item keeps its own owner. Absent means server default.
chmodquerystringNoSet file permissions using octal mode value (e.g. ?chmod=755).
chownquerystringNoSet file ownership (e.g. ?chown=user:group or ?chown=user).

One of the following JSON bodies.

Move request (moves the file to a new path):

FieldTypeRequiredDescription
move_tostringYesFull destination path.
{
"move_to": "/new/dir/file.txt"
}

Rename request (renames the file in place):

FieldTypeRequiredDescription
namestringYesNew filename (cannot contain path separators).
{
"name": "renamed.txt"
}
Terminal window
# chmod via query
curl -X PATCH "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/data/script.sh?chmod=755"
# rename via JSON body
curl -X PATCH "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/data/old-name.txt" \
-H "Content-Type: application/json" \
-d '{"name": "renamed.txt"}'

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

This endpoint takes no request body.

Terminal window
curl -X PATCH "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/chmod/data/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).

This endpoint takes no request body.

Terminal window
curl -X PATCH "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/chown/data/file.txt?chown=alice:staff"

Permanently delete a file or directory.

NameInTypeRequiredDescription
pathpathstringYesPath to file or directory to delete.

This endpoint takes no request body.

Terminal window
curl -X DELETE "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/tmp/old-file.txt"

Delete a file or directory from the server or a remote backend.

NameInTypeRequiredDescription
pathpathstringYesPath to delete.
backendquerystringNoBackend ID for remote file deletion.

This endpoint takes no request body.

Terminal window
curl -X DELETE "https://proj-abc123-cont-xyz789-files-1.eu-west-1.containers.hoody.icu/api/v1/files/tmp/old-file.txt"