Quick Start
Section titled “Quick Start”The Hoody Files API provides direct access to the filesystem through a path-addressed REST interface. All endpoints are rooted at /api/v1/files and operate on absolute filesystem paths. This page is an overview — see the linked detail pages for full parameter and response coverage of each operation.
URL shape
Section titled “URL shape”Every operation follows one of two URL patterns:
- Path-addressed verbs: an HTTP method on
/api/v1/files/{path}. The HTTP method selects the operation. For example,GET /api/v1/files/home/user/notes.txtreads a file, whilePUT /api/v1/files/home/user/notes.txtwrites to it. The path segment never contains a verb likereadorlist. - Explicit operation verbs: a few operations use
/api/v1/files/{operation}/{path}with a specific method — for examplePUT /api/v1/files/append/{path},POST /api/v1/files/copy/{path},POST /api/v1/files/move/{path},PATCH /api/v1/files/chmod/{path},PATCH /api/v1/files/chown/{path},GET /api/v1/files/glob/{path},GET /api/v1/files/grep/{path},GET /api/v1/files/realpath/{path}, andGET /api/v1/files/stat/{path}.
Operation groups
Section titled “Operation groups”The Files API is organized into four functional groups. Each group is documented in detail on its own page.
Reading files and listing directories
Section titled “Reading files and listing directories”Inspect the contents of the filesystem — read file bodies, list directory entries, resolve absolute paths, and inspect metadata.
GET /api/v1/files/{path}— read a file or list a directoryGET /api/v1/files/stat/{path}— file or directory metadataGET /api/v1/files/realpath/{path}— resolve symlinks to an absolute path
See Reading Files for full coverage.
Writing and updating files
Section titled “Writing and updating files”Create, overwrite, append, and patch file contents.
PUT /api/v1/files/{path}— write or overwrite a filePATCH /api/v1/files/{path}— apply a partial updatePUT /api/v1/files/append/{path}— append to an existing file
See File Operations for full coverage.
Organizing the filesystem
Section titled “Organizing the filesystem”Move, copy, delete, and change permissions or ownership of files and directories.
POST /api/v1/files/copy/{path}— copy a file or directoryPOST /api/v1/files/move/{path}— move or rename a file or directoryDELETE /api/v1/files/{path}— delete a file or directoryPATCH /api/v1/files/chmod/{path}— change POSIX permissionsPATCH /api/v1/files/chown/{path}— change owner and group
Searching the filesystem
Section titled “Searching the filesystem”Locate files by pattern and search file contents across the tree.
GET /api/v1/files/glob/{path}— match files by glob pattern (e.g.GET /api/v1/files/glob/src?pattern=**/*.ts)GET /api/v1/files/grep/{path}— search file contents by regular expression
Authentication
Section titled “Authentication”All Files endpoints require a valid bearer token passed in the Authorization header as Bearer <token>. Tokens are scoped to the authenticated identity and inherit its filesystem permissions.
Choosing the right endpoint
Section titled “Choosing the right endpoint”| If you need to… | Use |
|---|---|
| Read a file’s contents | GET /api/v1/files/{path} |
| List a directory | GET /api/v1/files/{path} (path is a directory) |
| Get size, mtime, or type | GET /api/v1/files/stat/{path} |
| Resolve symlinks | GET /api/v1/files/realpath/{path} |
| Create or overwrite a file | PUT /api/v1/files/{path} |
| Partially update a file | PATCH /api/v1/files/{path} |
| Append to a file | PUT /api/v1/files/append/{path} |
| Copy a file or directory | POST /api/v1/files/copy/{path} |
| Move or rename | POST /api/v1/files/move/{path} |
| Delete a file or directory | DELETE /api/v1/files/{path} |
| Change permissions | PATCH /api/v1/files/chmod/{path} |
| Change owner or group | PATCH /api/v1/files/chown/{path} |
| Find files by pattern | GET /api/v1/files/glob/{path} |
| Search file contents | GET /api/v1/files/grep/{path} |