Skip to content

The Agent Files API provides workspace-scoped access to file and search operations. Use these endpoints to list directories, read file contents, check git status, and perform name, text, or symbol searches across a workspace.

All endpoints are scoped to a workspace via the {workspaceID} path parameter.

Returns the files and directories at a given path within a workspace.

GET /api/v1/workspaces/{workspaceID}/files/file

NameInTypeRequiredDescription
workspaceIDpathstringYesThe workspace identifier
pathquerystringYesThe directory path to list, relative to the workspace root

Returns an array of agent_FileNode objects describing each entry at the requested path.

[
{
"name": "index.ts",
"path": "src/index.ts",
"absolute": "/home/user/project/src/index.ts",
"type": "file",
"ignored": false
},
{
"name": "utils",
"path": "src/utils",
"absolute": "/home/user/project/src/utils",
"type": "directory",
"ignored": false
}
]

FileNode fields

FieldTypeRequiredDescription
namestringYesThe file or directory name
pathstringYesThe path relative to the workspace root
absolutestringYesThe absolute path on disk
typestringYesOne of "file", "directory"
ignoredbooleanYesWhether the entry is matched by ignore rules
Terminal window
curl -X GET "https://api.hoody.com/v1/workspaces/ws_abc123/files/file?path=src" \
-H "Authorization: Bearer <token>"

Reads the content of a file, returning text, a unified diff, or base64-encoded binary data.

GET /api/v1/workspaces/{workspaceID}/files/file/content

NameInTypeRequiredDescription
workspaceIDpathstringYesThe workspace identifier
pathquerystringYesThe file path, relative to the workspace root

Returns an agent_FileContent object.

{
"type": "text",
"content": "export function hello() {\n return 'world';\n}\n",
"diff": "@@ -1,3 +1,3 @@\n export function hello() {\n- return 'hello';\n+ return 'world';\n }\n",
"patch": {
"oldFileName": "src/index.ts",
"newFileName": "src/index.ts",
"oldHeader": "a/src/index.ts",
"newHeader": "b/src/index.ts",
"hunks": [
{
"oldStart": 1,
"oldLines": 3,
"newStart": 1,
"newLines": 3,
"lines": [
" export function hello() {",
"- return 'hello';",
"+ return 'world';",
" }"
]
}
],
"index": "abc1234"
},
"encoding": "base64",
"mimeType": "text/typescript"
}

FileContent fields

FieldTypeRequiredDescription
typestringYesOne of "text", "binary"
contentstringYesThe file content (text or base64-encoded)
diffstringNoA unified diff representing changes
patchobjectNoStructured patch data with old/new file names and hunks
encodingstringNoAlways "base64" when the file is binary
mimeTypestringNoThe detected MIME type of the file
Terminal window
curl -X GET "https://api.hoody.com/v1/workspaces/ws_abc123/files/file/content?path=src/index.ts" \
-H "Authorization: Bearer <token>"

Returns the git status of all files in the project, including added, removed, and modified line counts.

GET /api/v1/workspaces/{workspaceID}/files/file/status

NameInTypeRequiredDescription
workspaceIDpathstringYesThe workspace identifier

Returns an array of agent_File objects.

[
{
"path": "src/index.ts",
"added": 5,
"removed": 2,
"status": "modified"
},
{
"path": "src/new-file.ts",
"added": 20,
"removed": 0,
"status": "added"
},
{
"path": "src/old-file.ts",
"added": 0,
"removed": 45,
"status": "deleted"
}
]

File fields

FieldTypeRequiredDescription
pathstringYesThe file path relative to the workspace root
addedintegerYesNumber of lines added
removedintegerYesNumber of lines removed
statusstringYesOne of "added", "deleted", "modified"
Terminal window
curl -X GET "https://api.hoody.com/v1/workspaces/ws_abc123/files/file/status" \
-H "Authorization: Bearer <token>"

Searches for a text pattern across files using ripgrep. Returns matching lines with file path, line number, and submatch positions.

GET /api/v1/workspaces/{workspaceID}/files/find

NameInTypeRequiredDescription
workspaceIDpathstringYesThe workspace identifier
patternquerystringYesThe ripgrep pattern to search for

Returns an array of match objects.

[
{
"path": {
"text": "src/utils/helpers.ts"
},
"lines": {
"text": "export function formatDate(date: Date) {"
},
"line_number": 12,
"absolute_offset": 345,
"submatches": [
{
"match": {
"text": "formatDate"
},
"start": 17,
"end": 27
}
]
}
]

Match fields

FieldTypeRequiredDescription
pathobjectYesObject containing the matching file’s text path
linesobjectYesObject containing the full matching line’s text
line_numbernumberYesThe 1-based line number of the match
absolute_offsetnumberYesThe absolute byte offset of the match in the file
submatchesarrayYesIndividual submatch ranges within the line
Terminal window
curl -X GET "https://api.hoody.com/v1/workspaces/ws_abc123/files/find?pattern=formatDate" \
-H "Authorization: Bearer <token>"

Searches for files or directories by name or glob pattern within a workspace.

GET /api/v1/workspaces/{workspaceID}/files/find/file

NameInTypeRequiredDescription
workspaceIDpathstringYesThe workspace identifier
queryquerystringYesThe name or glob pattern to match
dirsquerystringNoRestrict results to directories. Allowed values: "true", "false"
typequerystringNoRestrict the result type. Allowed values: "file", "directory"
limitqueryintegerNoMaximum number of results to return

Returns an array of file path strings.

[
"src/index.ts",
"src/utils/index.ts",
"tests/index.test.ts"
]
Terminal window
curl -X GET "https://api.hoody.com/v1/workspaces/ws_abc123/files/find/file?query=index.ts" \
-H "Authorization: Bearer <token>"

Searches for workspace symbols — functions, classes, variables, and other language constructs — using LSP.

GET /api/v1/workspaces/{workspaceID}/files/find/symbol

NameInTypeRequiredDescription
workspaceIDpathstringYesThe workspace identifier
queryquerystringYesThe symbol name or query string to search for

Returns an array of agent_Symbol objects.

[
{
"name": "formatDate",
"kind": 12,
"location": {
"uri": "file:///src/utils/helpers.ts",
"range": {
"start": {
"line": 11,
"character": 0
},
"end": {
"line": 13,
"character": 1
}
}
}
}
]

Symbol fields

FieldTypeRequiredDescription
namestringYesThe symbol name
kindnumberYesThe LSP symbol kind code
locationobjectYesThe symbol’s source location, with a uri and range
Terminal window
curl -X GET "https://api.hoody.com/v1/workspaces/ws_abc123/files/find/symbol?query=formatDate" \
-H "Authorization: Bearer <token>"