> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapengine.io/llms.txt
> Use this file to discover all available pages before exploring further.

# List Directory

> List entries of a workspace directory.

## Overview

Returns the immediate children of a workspace directory. Pass an empty `path` (or omit it) to list the workspace root. The listing is not recursive — use `GET /fs/zip` to get the full tree as an archive.

## Path Parameters

<ParamField path="id" type="string" required={true}>
  Browser session ID (UUID).
</ParamField>

## Query Parameters

<ParamField query="path" type="string">
  Workspace-relative directory path. Empty or omitted lists the workspace root.
</ParamField>

## Example Request

<CodeGroup>
  ```bash cURL (root) theme={null}
  curl -G "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/fs/dir" \
    -H "Authorization: Bearer $SCRAPENGINE_API_KEY"
  ```

  ```bash cURL (subdirectory) theme={null}
  curl -G "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/fs/dir" \
    -H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
    --data-urlencode "path=downloads"
  ```
</CodeGroup>

## Response

### Success Response (200)

<ResponseField name="path" type="string">
  The listed workspace-relative directory path.
</ResponseField>

<ResponseField name="entries" type="array">
  Entries in the directory. Each entry contains:

  * `name` (string) — basename of the entry.
  * `path` (string) — workspace-relative path of the entry.
  * `type` (string) — one of `file`, `dir`, `symlink`, `other`.
  * `size` (integer) — size in bytes (0 for directories).
  * `mode` (integer) — Unix mode.
  * `mtime` (string) — last modified timestamp (ISO 8601).
</ResponseField>

**Example Response:**

```json theme={null}
{
  "path": "downloads",
  "entries": [
    {
      "name": "invoice.pdf",
      "path": "downloads/invoice.pdf",
      "type": "file",
      "size": 20813,
      "mode": 420,
      "mtime": "2026-04-24T09:12:44Z"
    }
  ]
}
```

### Error Responses

| Status | Description                                |
| ------ | ------------------------------------------ |
| `400`  | Invalid path.                              |
| `401`  | Unauthorized — invalid or missing API key. |
| `404`  | Session or directory not found.            |
