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.
Name In Type Required Description directorypath string Yes Directory to search qquery string Yes Search 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 jsonquery string No Return JSON format instead of HTML. Literal empty value ""
curl -X GET " https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/projects?q=report&json= " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . search ( ' projects ' , { q : ' report ' , json : '' });
" href " : " /projects?q=report " ,
" name " : " report-2024-q1.pdf " ,
" name " : " report-2024-q2.pdf " ,
" uri_prefix " : " /projects/ " ,
" error " : " Search query exceeds 512 UTF-8 bytes "
Error Code Title Description Resolution SEARCH_QUERY_TOO_LONGSearch query too long q is limited to 512 UTF-8 bytes. Note this is a BYTE limit, not a character limit, and it is applied to the percent-decoded value both as received and after lowercasing — case folding can change a string’s byte length in either directionShorten the query. Non-ASCII characters consume 2-4 bytes each
" error " : " Search is not allowed 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
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.
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. Allowed: asc, desc
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 "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . glob ( ' src ' , { pattern : ' **/*.ts ' , max_results : 50 , sort : ' mtime ' , order : ' desc ' });
" error " : " Invalid glob pattern: unclosed brace "
" error " : " Search is not allowed "
" error " : " Path not found "
" error " : " Too many concurrent searches; retry later "
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.
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://{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 "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . grep ( ' src ' , { pattern : ' TODO ' , ignore_case : true , max_count : 10 });
" line " : " // TODO: refactor before release " ,
" context_after " : [ " export function run() { " ],
" context_before " : [ " import { foo } from './foo'; " ]
" total_files_matched " : 1 ,
" total_files_searched " : 87 ,
" error " : " Invalid regex pattern "
" error " : " Grep is not allowed "
" error " : " Path not found "
" error " : " Too many concurrent searches; retry later "
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.
Name In Type Required Description pathpath string Yes File or directory path to resolve
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 "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . realpath ( ' src/../lib/index.ts ' );
" path " : " /src/../lib/index.ts " ,
" real_path " : " /lib/index.ts "
" error " : " Too many levels of symbolic links "
Error Code Title Description Resolution INVALID_PATHInvalid path Path contains invalid characters or traversal attempts Provide a valid path without traversal characters ELOOPSymlink loop Too many levels of symbolic links (circular chain) Break the symlink cycle in the chain OPERATION_CONFLICTOperation conflict Cannot combine realpath with other query operations Call realpath without additional operations
" error " : " Resolved path is outside the serve root "
Error Code Title Description Resolution PERMISSION_DENIEDPermission denied Insufficient permissions to access the path Request access from the administrator PATH_ESCAPEPath escapes root Resolved canonical path is outside the serve root Use a path that stays within 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://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/stat/data/report.pdf " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . stat ( ' data/report.pdf ' );
" path " : " /data/report.pdf " ,
" error " : " File or directory not found "
Error Code Title Description Resolution FILE_NOT_FOUNDFile not found The specified path does not exist Verify the path is correct
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.
Name In Type Required Description imagepath string Yes Path to image file thumbnailquery string Yes Enable image processing. Literal empty value "" formatquery string No Output format. Default: "jpeg". Allowed: 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. Literal empty value "" bgquery string No Background color for transparency (hex RGB, e.g. ffffff for white)
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 "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . images . process ( ' assets/hero.png ' , { thumbnail : '' , format : ' webp ' , width : 800 , q : 80 });
Returns the processed image as a binary stream with Content-Type set to one of image/jpeg, image/png, image/webp, image/gif, image/bmp.
" error " : " Unsupported source image format "
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.
Name In Type Required Description pathpath string Yes Source path or destination directory backendquery string No Backend ID for remote operation mkdirquery string No Create directory. Literal empty value "" extractquery string No Extract archive. Empty value extracts all; non-empty value is a selective path to extract (e.g. src/ 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). Allowed: 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). Applies to mkdir/extract/download_from/copy_to
curl -X POST " https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/projects/2025?mkdir= " \
-H " Authorization: Bearer $HOODY_TOKEN "
curl -X POST " https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/downloads/release.tar.gz?extract=&dest=release " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . operate ( ' projects/2025 ' , { mkdir : '' });
await client . files . operate ( ' downloads/release.tar.gz ' , { extract : '' , dest : ' release ' });
" source " : " /drafts/post.md " ,
" destination " : " /published/post.md " ,
" message " : " Directory created "
" error " : " Source file or directory not found "
" error " : " Destination already exists "
" error " : " Failed to set create-owner on newly-created inode; operation rolled back "
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). Allowed: true, false ownerquery string No Create-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
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 "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . copy ( ' drafts/post.md ' , { copy_to : ' /published/post.md ' });
" source " : " /drafts/post.md " ,
" destination " : " /published/post.md " ,
" error " : " Copy is not allowed (upload flag required) "
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 or 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 plus --allowed-create-owners; refuses root. The moved inode itself preserves its existing owner. Absent uses the server default
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 "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . move ( ' drafts/post.md ' , { move_to : ' /published/post.md ' });
" source " : " /drafts/post.md " ,
" destination " : " /published/post.md " ,
" error " : " Move is not allowed (upload and delete flags required) "
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. The body is sent as application/octet-stream.
Name In Type Required Description pathpath string Yes Destination file path
Binary file contents (application/octet-stream).
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 " \
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . upload ( ' assets/logo.svg ' , fileBuffer );
File uploaded successfully.
" error " : " Upload is not allowed "
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. Literal empty value ""
curl -X PUT " https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/var/log/app.log?touch= " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . touch ( ' var/log/app.log ' , { touch : '' });
File created (did not exist).
Modification time updated (file already existed).
" error " : " Cannot touch a directory "
" error " : " Touch is not allowed "
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 (creating it if missing).
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. Literal empty value "" ownerquery string No Create-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).
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 " \
curl -X PUT " https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/var/log/app.log?append= " \
-H " Authorization: Bearer $HOODY_TOKEN " \
-H " Content-Type: application/octet-stream " \
--data-binary @new-lines.log
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . put ( ' assets/logo.svg ' , fileBuffer );
await client . files . put ( ' var/log/app.log ' , newLines , { append : '' });
" path " : " /var/log/app.log " ,
" path " : " /assets/logo.svg " ,
" message " : " File uploaded "
" error " : " Upload is not allowed "
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 plus allowlist; refuses root. Absent uses the server default
Binary data to append (application/octet-stream).
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
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . append ( ' var/log/app.log ' , newLines );
" path " : " /var/log/app.log " ,
" error " : " Upload is not allowed "
Error Code Title Description Resolution UPLOAD_FORBIDDENUpload not allowed Server is not configured to allow file uploads Contact administrator to enable --allow-upload flag
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.
Name In Type Required Description pathpath string Yes Target path X-Update-Rangeheader string No Set 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)
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 " \
curl -X PATCH " https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/var/log/app.log " \
-H " Authorization: Bearer $HOODY_TOKEN " \
-H " X-Update-Range: append " \
-H " Content-Type: application/octet-stream " \
--data-binary @new-lines.log
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . patch ( ' notes/old.txt ' , { name : ' new.txt ' });
await client . files . patch ( ' var/log/app.log ' , newLines , { ' X-Update-Range ' : ' append ' });
" error " : " Invalid chmod mode '999' (must be octal) "
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 is not allowed "
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 " : " File 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
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).
Name In Type Required Description pathpath string Yes File path backendquery string No Backend ID for remote file operations 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 plus --allowed-create-owners; cannot be root. The moved item keeps its own owner. Absent uses the server default 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)
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)
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 "
curl -X PATCH " https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/drafts/post.md " \
-H " Authorization: Bearer $HOODY_TOKEN " \
-H " Content-Type: application/json " \
-d ' {"move_to":"/published/post.md"} '
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . patchApi ( ' scripts/run.sh ' , {}, { chmod : ' 755 ' });
await client . files . patchApi ( ' drafts/post.md ' , { move_to : ' /published/post.md ' });
" path " : " /scripts/run.sh " ,
" error " : " Invalid chmod mode '999' (must be octal) "
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 " : " Operation is not allowed "
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 not found "
" error " : " Destination already exists "
Change file or directory permissions using an octal mode. Pass the mode value in the chmod query parameter, e.g. ?chmod=755. Unix only.
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://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/chmod/scripts/run.sh?chmod=755 " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . chmod ( ' scripts/run.sh ' , { chmod : ' 755 ' });
" path " : " /scripts/run.sh " ,
" error " : " Invalid chmod mode '999' (must be octal) "
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 is not allowed "
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 not found "
Change file or directory ownership. Pass owner:group in the chown query parameter, e.g. ?chown=user:group. The group is optional. Unix only.
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://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/chown/data/report.pdf?chown=alex:users " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . chown ( ' data/report.pdf ' , { chown : ' alex:users ' });
" path " : " /data/report.pdf " ,
" error " : " User 'alex' not found "
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 is not allowed "
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 not found "
Permanently delete a file or directory.
Name In Type Required Description pathpath string Yes Path to file or directory to delete
curl -X DELETE " https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/tmp/scratch.txt " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . deleteRecursive ( ' tmp/scratch.txt ' );
" error " : " Delete is not allowed "
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.
Name In Type Required Description pathpath string Yes File or directory path backendquery string No Backend ID for remote file deletion
curl -X DELETE " https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com/api/v1/files/tmp/scratch.txt " \
-H " Authorization: Bearer $HOODY_TOKEN "
import { HoodyClient } from ' hoody-sdk ' ;
const client = new HoodyClient ({ baseURL : ' https://{projectId}-{containerId}-files-1.{server}.containers.hoody.com ' , token : process . env . HOODY_TOKEN });
await client . files . delete ( ' tmp/scratch.txt ' );
" error " : " Delete is not allowed "
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