Skip to content

The Reading Files endpoints let you browse, download, and inspect files via HTTP GET requests. Use them to enumerate directory contents, download file payloads, retrieve hashes, run content searches (grep) and filename searches (glob), extract specific line ranges, and read historical revisions from the file journal. Two endpoint variants are available: a basic form at /{path} and a richer v1 form at /api/v1/files/{path} that exposes the full search and journal surface.

Returns a directory listing in HTML or JSON format, or downloads a file. For file paths, append ?download (or ?download=true) to force a Content-Disposition: attachment response. Use ?json for a machine-readable listing, ?hash for a SHA-256 digest, and ?base64 for base64-encoded content.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path
jsonquerystringNoReturn JSON format instead of HTML
simplequerystringNoReturn simple text listing
sortquerystringNoSort by field. Accepted values: name, mtime, size
orderquerystringNoSort order. Accepted values: asc, desc
hashquerystringNoGet SHA256 hash of file (returns plain text hash)
sha256querystringNoGet SHA256 hash of file (alias for hash)
base64querystringNoGet file content as base64 encoded string
editquerystringNoOpen file in Web UI editor (requires allow-upload permission)
viewquerystringNoView file in Web UI (read-only mode)
downloadquerystringNoFor file paths only: force browser download (Content-Disposition: attachment). Accepted values: empty (?download), 1, or true. For directory paths, triggers the URL download-manager operation.
content-typequerystringNoOverride Content-Type header for file downloads
historyquerystringNoList all revisions of a file. Returns JSON with revisions array, pagination via after_id. Mutually exclusive with at/revision/diff.
atquerystringNoRead file content at a point in time. Accepts RFC3339 timestamp or Unix milliseconds. Mutually exclusive with history/revision/diff. Composable with ?lines, ?hash, ?base64.
revisionqueryintegerNoRead file content by stable per-path sequence number. Mutually exclusive with history/at/diff. Composable with ?lines, ?hash, ?base64.
diffquerystringNoCompute unified diff between two versions. Requires from_seq or from_ts. Optional to_seq or to_ts (defaults to current file). Mutually exclusive with history/at/revision.
from_seqqueryintegerNoSource revision seq number for ?diff. Mutually exclusive with from_ts.
from_tsquerystringNoSource timestamp for ?diff (RFC3339 or Unix ms). Mutually exclusive with from_seq.
to_seqqueryintegerNoTarget revision seq number for ?diff. Mutually exclusive with to_ts. Default: current file on disk.
to_tsquerystringNoTarget timestamp for ?diff (RFC3339 or Unix ms). Mutually exclusive with to_seq.
after_idqueryintegerNoCursor for ?history pagination. Returns entries with id > after_id.
limitqueryintegerNoMax entries to return for ?history.
Terminal window
curl "https://api.hoody.com/workspace/projects?json&sort=name&order=asc"

Directory listings return JSON matching the DirectoryListing schema. File downloads return application/octet-stream with the raw binary content.

{
"allow_archive": true,
"allow_delete": false,
"allow_search": true,
"allow_upload": true,
"auth": true,
"dir_exists": true,
"href": "/workspace/projects",
"kind": "Index",
"paths": [
{
"mtime": 1716400000000,
"name": "README.md",
"path_type": "File",
"revisions": 12,
"size": 4321
},
{
"mtime": 1716390000000,
"name": "src",
"path_type": "Dir",
"revisions": null,
"size": 24
},
{
"mtime": 1716300000000,
"name": "package.json",
"path_type": "File",
"revisions": 5,
"size": 1208
}
],
"uri_prefix": "/api/v1/files",
"user": "alice"
}

Get a directory listing in JSON format, download a file, run grep/glob searches, extract a line range, or read historical revisions from the journal. The optional backend query parameter routes the request to a remote backend.

NameInTypeRequiredDescription
pathpathstringYesFile or directory path
backendquerystringNoBackend ID for remote file access
hashquerystringNoGet SHA256 hash of file
sha256querystringNoGet SHA256 hash of file (alias for hash)
base64querystringNoGet file content as base64
previewquerystringNoPreview archive contents (for zip/tar files). Alias: ?contents
contentsquerystringNoAlias for ?preview — list archive contents
statquerystringNoGet file/directory metadata (stat) without downloading content
thumbnailquerystringNoGenerate thumbnail (not yet implemented in API v1, returns 501)
grepquerystringNoSearch file/directory contents for regex pattern (or literal if fixed_string=true). Requires --allow-grep.
ignore_casequerybooleanNoCase-insensitive grep matching. Default: false
fixed_stringquerybooleanNoTreat grep pattern as literal string, not regex. Default: false
globquerystringNoFind files matching glob pattern (e.g. **/*.rs, src/**/*.{ts,tsx}). Requires --allow-search. Directory paths only.
contextqueryintegerNoNumber of context lines before/after each grep match. Default: 0
max_countqueryintegerNoMax matches per file for grep. Default: 50
max_matchesqueryintegerNoTotal max matches across all files for grep. Default: 500
max_depthqueryintegerNoDirectory recursion depth for grep. Default: 50
max_filesizequeryintegerNoSkip files larger than this (bytes) during grep. Default: 10485760
timeoutqueryintegerNoGrep timeout in seconds. Default: 30
no_ignorequerybooleanNoBypass .gitignore filtering during grep. Default: false
max_resultsqueryintegerNoMax entries returned for glob search. Default: 1000
max_files_scannedqueryintegerNoMax filesystem entries scanned during glob search. Default: 100000
sortquerystringNoSort glob results by: mtime (default), name, or size
orderquerystringNoSort order for glob results. Default: desc for mtime, asc for name/size. Accepted values: asc, desc
linesquerystringNoExtract specific lines from a file. Formats: 10-50 (range, 1-indexed inclusive), 100 (single line), -20 (last 20 lines / tail), 50- (line 50 to end). Returns text/plain with X-Line-Range header. X-Total-Lines header included when naturally known (scan reached EOF). Max 100,000 lines or 64MB per request.
historyquerystringNoList all revisions of a file. Returns JSON with revisions array, pagination via after_id. Mutually exclusive with at/revision/diff.
atquerystringNoRead file content at a point in time. Accepts RFC3339 timestamp or Unix milliseconds. Mutually exclusive with history/revision/diff. Composable with ?lines, ?hash, ?base64.
revisionqueryintegerNoRead file content by stable per-path sequence number. Mutually exclusive with history/at/diff. Composable with ?lines, ?hash, ?base64.
diffquerystringNoCompute unified diff between two versions. Requires from_seq or from_ts. Optional to_seq or to_ts (defaults to current file). Mutually exclusive with history/at/revision.
from_seqqueryintegerNoSource revision seq number for ?diff. Mutually exclusive with from_ts.
from_tsquerystringNoSource timestamp for ?diff (RFC3339 or Unix ms). Mutually exclusive with from_seq.
to_seqqueryintegerNoTarget revision seq number for ?diff. Mutually exclusive with to_ts. Default: current file on disk.
to_tsquerystringNoTarget timestamp for ?diff (RFC3339 or Unix ms). Mutually exclusive with to_seq.
after_idqueryintegerNoCursor for ?history pagination. Returns entries with id > after_id.
limitqueryintegerNoMax entries to return for ?history. Default: 100
zipquerystringNoDownload a directory as a streaming zip archive (bare flag, e.g. ?zip). Local directories only; requires —allow-archive. Same behavior as the WebDAV-style /{directory}?zip.
Terminal window
curl "https://api.hoody.com/api/v1/files/workspace/api-docs?grep=export+function&ignore_case=true&context=2&max_count=50"

Returns a directory listing, grep/glob results, line-range content, file revision history, historical content, or a unified diff depending on the query parameters used. File downloads return application/octet-stream.

Directory listing:

{
"allow_archive": true,
"allow_delete": false,
"allow_search": true,
"allow_upload": true,
"auth": true,
"dir_exists": true,
"href": "/workspace/api-docs",
"kind": "Index",
"paths": [
{
"mtime": 1716400000000,
"name": "README.md",
"path_type": "File",
"revisions": 12,
"size": 4321
},
{
"mtime": 1716390000000,
"name": "src",
"path_type": "Dir",
"revisions": null,
"size": 24
}
],
"uri_prefix": "/api/v1/files",
"user": "alice"
}

Grep results:

{
"duration_ms": 142,
"matches": [
{
"column_byte": 6,
"context_after": ["function foo() {"],
"context_before": ["// utility module"],
"line": "export function greet(name) {",
"line_number": 12,
"path": "/workspace/api-docs/src/utils.ts"
}
],
"path": "/workspace/api-docs",
"pattern": "export function",
"total_files_matched": 1,
"total_files_searched": 42,
"total_matches": 1,
"truncated": false
}

Glob results:

{
"count": 2,
"duration_ms": 18,
"entries": [
{
"is_dir": false,
"modified": 1716400000,
"name": "/workspace/api-docs/src/index.ts",
"size": 2104
},
{
"is_dir": false,
"modified": 1716350000,
"name": "/workspace/api-docs/src/utils.ts",
"size": 872
}
],
"path": "/workspace/api-docs",
"pattern": "src/**/*.ts",
"total_scanned": 87,
"truncated": false
}