---
title: Read one workspace file
description: "One text file from the run's sandbox workspace (WIBLO-130)."
api_method: GET
api_path: "/v1/agent-runs/{runId}/workbench/files/content"
canonical_url: https://wiblo.app/docs/developers/api/agent-workbench/get-workbench-file-content
last_updated: 2026-07-28T17:12:38+02:00
md_url: https://wiblo.app/docs/developers/api/agent-workbench/get-workbench-file-content.md
---

# Read one workspace file

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

One text file from the run's sandbox workspace (WIBLO-130). Files over the 256KiB read window are served TRUNCATED to the window (`truncated: true`; `size` is the full on-disk size) — never rejected for size. Binary files and the hidden paths (`.git/`, `.wiblo/`, `.env.local`, unless the expose-hidden-paths dev toggle is on) are rejected. Traversal, absolute, and null-byte paths are 400 `INVALID_FILE_PATH` at both the API and the gateway. Per-user rate-limited at 120/60s.

## Path parameters

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

## Query parameters

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

## Request

**curl**

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

**TypeScript**

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

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

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

## Responses

**`200`** — The file's text content (possibly a truncated window). Returns `WorkbenchFileContentResponse`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `runId` | `string` | Yes |  |
| `path` | `string` | Yes |  |
| `content` | `string` | Yes |  |
| `size` | `integer` | Yes |  |
| `truncated` | `boolean` | Yes |  |

**`400`** — Invalid or hidden file path (`INVALID_FILE_PATH`), or the file is not text (`FILE_NOT_TEXT`). 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`.
