---
title: "Lists files and directories in a given directory. Symbolic links in the directory are returned with type FILE_TYPE_SYMLINK and are not followed."
method: GET
path: "/v1/{name}/filesystem:listDirectory"
tags: ["FilesystemService"]
---

# Lists files and directories in a given directory. Symbolic links in the directory are returned with type FILE_TYPE_SYMLINK and are not followed.

`GET /v1/{name}/filesystem:listDirectory`

## Request

- Base URL: `https://docs.h2o.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://docs.h2o.ai/v1/{name}/filesystem:listDirectory`
- Auth: none declared
- TypeScript: <https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/docs/v1/:name/filesystem:listDirectory/get.ts> (a function with typed inputs; its response is checked against the schema)

Authorization: Only the creator of the parent SandboxEngine is allowed to call this method.

## Path parameters

- `name` string, required

## Query parameters

- `path` string, required

## Response `200`

A successful response.

- V1ListDirectoryResponse: (-- api-linter: core::0132::response-unknown-fields=disabled aip.dev/not-precedent: ListDirectory is a custom method on a singleton resource, not a standard List method. The "files" field returns FileInfo objects, not a collection of a resource being listed. --) (-- api-linter: core::0158::response-next-page-token-field=disabled aip.dev/not-precedent: ListDirectory is a custom method on a singleton resource, not a standard List method. Pagination is not implemented because filesystem listings cannot be efficiently paginated in a stateless manner. --) Response from listing files.
  - `files` V1FileInfo[]: Output only. The list of files and directories.
    - `path` string: Output only. The absolute path of the file or directory.
    - `size` string, int64: Output only. The size of the file in bytes. For directories, this is typically 0 or the size of the directory metadata.
    - `type` 'FILE_TYPE_UNSPECIFIED' | 'FILE_TYPE_REGULAR' | 'FILE_TYPE_DIRECTORY' | 'FILE_TYPE_SYMLINK': FileType indicates the type of filesystem entry. - FILE_TYPE_UNSPECIFIED: The file type is not specified. - FILE_TYPE_REGULAR: A regular file. - FILE_TYPE_DIRECTORY: A directory. - FILE_TYPE_SYMLINK: A symbolic link.
    - `modifyTime` string, date-time: Output only. The last modification time of the file or directory (mtime).
    - `mode` string: Output only. Unix file mode and permission bits in octal notation. The format follows standard Unix permissions represented as a string. Examples: "0644" (rw-r--r--), "0755" (rwxr-xr-x), "0777" (rwxrwxrwx).

## Other responses

- `default`: An unexpected error response.

---

[API](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto.md) - [All operations](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/llms.txt) - [OpenAPI document](https://skmtc.dev/h2o/apis/ai-h2o-engine-sandbox-v1-filesystem-proto/revisions/297cfadc1d39?raw)
