---
title: List one workspace directory
description: "ONE directory of the run's sandbox workspace (lazy, per expanded folder — WIBLO-130 rework for the multi-repo layout)."
api_method: GET
api_path: "/v1/agent-runs/{runId}/workbench/files"
canonical_url: https://wiblo.app/docs/developers/api/agent-workbench/get-workbench-files
last_updated: 2026-07-28T17:31:44+02:00
md_url: https://wiblo.app/docs/developers/api/agent-workbench/get-workbench-files.md
---

# List one workspace directory

`GET /v1/agent-runs/{runId}/workbench/files`

ONE directory of the run's sandbox workspace (lazy, per expanded folder — WIBLO-130 rework for the multi-repo layout). `path` is workspace-root-relative; absent/empty = the root, where every checkout is a folder. Entries are typed (dirs-first, symlinks resolved), capped per directory. Runtime state (`.wiblo/`), `.git/`, and env files (`.env.local`) are never listed unless the backend's expose-hidden-paths dev toggle is on. Requires a live sandbox session. Per-user rate-limited at 120/60s.

## Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `runId` | `string` | Yes |  |

## Query parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `path` | `string` | No |  |

## Request

**curl**

```bash
curl https://api.wiblo.app/v1/agent-runs/{runId}/workbench/files \
  -H "Authorization: Bearer $WIBLO_TOKEN"
```

**TypeScript**

```ts
import { createSdk, getWorkbenchFiles } from "@workspace/sdk"

const sdk = createSdk({ baseUrl: "https://api.wiblo.app" })

const { data, error } = await getWorkbenchFiles({
  client: sdk,
  path: { runId: "..." },
})
```

## Responses

**`200`** — The directory listing. Returns `WorkbenchFileListResponse`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `runId` | `string` | Yes |  |
| `path` | `string` | Yes |  |
| `entries` | `array<WorkbenchDirEntry>` | Yes |  |
| `truncated` | `boolean` | Yes |  |

**`400`** — Invalid or hidden directory path, or the path is not a directory (`INVALID_FILE_PATH`). Returns `ApiErrorEnvelope`.

**`401`** — No valid session cookie or `wbl_*` bearer was present. Returns `ApiErrorEnvelope`.

**`404`** — No run visible to the caller with this id (`AGENT_RUN_NOT_FOUND`). Returns `ApiErrorEnvelope`.

**`409`** — No live sandbox session holds the worktree (`AGENT_SANDBOX_UNAVAILABLE`). Returns `ApiErrorEnvelope`.

**`422`** — Path param failed UUID validation (`INVALID_PARAMS`). Returns `ApiErrorEnvelope`.

**`429`** — Rate limit exceeded. The body's `error.code` is `RATE_LIMITED` and `error.details.retry_after` is the same number of seconds as the `Retry-After` header. Returns `ApiErrorEnvelope`.

### The WorkbenchDirEntry object

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | `string` | Yes |  |
| `type` | `"file" \| "dir"` | Yes |  |
| `link` | `boolean` | No |  |
