Skip to content
Hoody.com

The file operations API covers day-to-day work of moving, mutating, and inspecting files in a container. It includes upload, touch, append, move, copy, delete, chmod, chown, plus content and filename search (glob, grep, realpath, stat) and on-the-fly image processing. Most endpoints accept an optional owner query parameter for create-time ownership on newly created inodes; chmod and chown are Unix-only. All endpoints are served from the container-scoped files service.

Search a directory for files matching a query. Returns an HTML index by default, or JSON when ?json is supplied. The q query parameter is limited to 512 UTF-8 BYTES after percent-decoding, measured both before and after Unicode lowercasing — case folding can change a string’s byte length in either direction. Longer queries are rejected with 400 rather than truncated.

NameInTypeRequiredDescription
directorypathstringYesDirectory 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 empty value ""
Terminal window
curl -X GET "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/projects?q=report&json=" \
-H "Authorization: Bearer $HOODY_TOKEN"

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

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. Allowed: asc, desc
Terminal window
curl -X GET "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/glob/src?pattern=**%2F*.ts&max_results=50&sort=mtime&order=desc" \
-H "Authorization: Bearer $HOODY_TOKEN"

Search file contents using a regex pattern. Backed by ripgrep with .gitignore support, binary file detection, and configurable budgets. Returns matching lines plus 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://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/grep/src?pattern=TODO&ignore_case=true&max_count=10" \
-H "Authorization: Bearer $HOODY_TOKEN"

Resolve a file or directory path to its canonical absolute form by following all symbolic links and resolving all ./.. segments. 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://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/realpath/src/../lib/index.ts" \
-H "Authorization: Bearer $HOODY_TOKEN"

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://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/stat/data/report.pdf" \
-H "Authorization: Bearer $HOODY_TOKEN"

On-the-fly image processing with format conversion, resizing, and effects. Supports JPEG, PNG, WebP, GIF, and BMP input and output. Works for both local files and remote cloud storage backends. The response carries Cache-Control: public, max-age=3600.

NameInTypeRequiredDescription
imagepathstringYesPath to image file
thumbnailquerystringYesEnable image processing. Literal empty value ""
formatquerystringNoOutput format. Default: "jpeg". Allowed: 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. Literal empty value ""
bgquerystringNoBackground color for transparency (hex RGB, e.g. ffffff for white)
Terminal window
curl -X GET "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/assets/hero.png?thumbnail=&format=webp&width=800&q=80" \
-H "Authorization: Bearer $HOODY_TOKEN"

Multi-purpose endpoint that performs one of: create directory (?mkdir=), extract archive (?extract=), download from URL (?download_from=), move (?move_to=), or copy (?copy_to=). The operation is selected by which query flag is provided.

NameInTypeRequiredDescription
pathpathstringYesSource path or destination directory
backendquerystringNoBackend ID for remote operation
mkdirquerystringNoCreate directory. Literal empty value ""
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: 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). Applies to mkdir/extract/download_from/copy_to
Terminal window
curl -X POST "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/projects/2025?mkdir=" \
-H "Authorization: Bearer $HOODY_TOKEN"

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). Allowed: true, false
ownerquerystringNoCreate-time owner (user[:group]/uid[:gid]) for newly-created copies. Requires --allow-chown plus allowlist; refuses root. Overwritten existing files preserve their owner. Absent uses the server default
Terminal window
curl -X POST "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/copy/drafts/post.md?copy_to=%2Fpublished%2Fpost.md" \
-H "Authorization: Bearer $HOODY_TOKEN"

Move or rename a file or 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 plus --allowed-create-owners; refuses root. The moved inode itself preserves its existing owner. Absent uses the server default
Terminal window
curl -X POST "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/move/drafts/post.md?move_to=%2Fpublished%2Fpost.md" \
-H "Authorization: Bearer $HOODY_TOKEN"

Upload a file to the server. Creates new files or overwrites existing ones. The body is sent as application/octet-stream.

NameInTypeRequiredDescription
pathpathstringYesDestination file path

Binary file contents (application/octet-stream).

Terminal window
curl -X PUT "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/assets/logo.svg" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @logo.svg

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 empty value ""
Terminal window
curl -X PUT "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/var/log/app.log?touch=" \
-H "Authorization: Bearer $HOODY_TOKEN"

Upload a file to the server or to a remote backend. Use ?append to append to an existing file instead of overwriting (creating it if missing).

NameInTypeRequiredDescription
pathpathstringYesDestination file path
backendquerystringNoBackend ID for remote upload
appendquerystringNoAppend body to end of existing file (create if missing) instead of overwriting. Literal empty value ""
ownerquerystringNoCreate-time owner (user[:group]/uid[:gid]) for a newly-created file. Requires --allow-chown plus --allowed-create-owners; refuses root. Overwrites/appends to an existing file preserve its owner. Absent uses the server default

Binary file contents (application/octet-stream).

Terminal window
curl -X PUT "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/assets/logo.svg" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @logo.svg

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 plus allowlist; refuses root. Absent uses the server default

Binary data to append (application/octet-stream).

Terminal window
curl -X PUT "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/append/var/log/app.log" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @new-lines.log

Resumable upload and append to files, change file permissions (Unix only), change file ownership (Unix only), or rename a file or directory. For incremental writes, set the X-Update-Range: append header to append data to the end of the file.

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

Either a JSON object matching one of ChmodRequest, ChownRequest, or RenameRequest, or an application/octet-stream binary payload when using the X-Update-Range: append header.

  • ChmodRequest{ "mode": "755" } (required)
  • ChownRequest{ "owner": "user", "group": "users" }
  • RenameRequest{ "name": "new-filename.txt" } (required; cannot contain path separators)
Terminal window
curl -X PATCH "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/notes/old.txt" \
-H "Authorization: Bearer $HOODY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"new.txt"}'

REST API v1 variant of file modification. Supports ?chmod=755, ?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 plus --allowed-create-owners; cannot be root. The moved item keeps its own owner. Absent uses the server default
chmodquerystringNoSet file permissions using octal mode value (e.g. ?chmod=755)
chownquerystringNoSet file ownership (e.g. ?chown=user:group or ?chown=user)

A JSON object matching one of MoveRequest or RenameRequest.

  • MoveRequest{ "move_to": "/new/dir/file.txt" } (required)
  • RenameRequest{ "name": "new-filename.txt" } (required; cannot contain path separators)
Terminal window
curl -X PATCH "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/scripts/run.sh?chmod=755" \
-H "Authorization: Bearer $HOODY_TOKEN"

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

NameInTypeRequiredDescription
pathpathstringYesFile or directory path
chmodquerystringYesOctal permission mode (e.g. 755, 644, 0755)
Terminal window
curl -X PATCH "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/chmod/scripts/run.sh?chmod=755" \
-H "Authorization: Bearer $HOODY_TOKEN"

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

NameInTypeRequiredDescription
pathpathstringYesFile or directory path
chownquerystringYesOwner and optional group (e.g. user:group, user,:group, or UID:GID)
Terminal window
curl -X PATCH "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/chown/data/report.pdf?chown=alex:users" \
-H "Authorization: Bearer $HOODY_TOKEN"

Permanently delete a file or directory.

NameInTypeRequiredDescription
pathpathstringYesPath to file or directory to delete
Terminal window
curl -X DELETE "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/tmp/scratch.txt" \
-H "Authorization: Bearer $HOODY_TOKEN"

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

NameInTypeRequiredDescription
pathpathstringYesFile or directory path
backendquerystringNoBackend ID for remote file deletion
Terminal window
curl -X DELETE "https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/tmp/scratch.txt" \
-H "Authorization: Bearer $HOODY_TOKEN"