---
title: "Read a workspace file's text"
method: GET
path: "/files/content"
tags: ["files"]
---

# Read a workspace file's text

`GET /files/content`

## Request

- Base URL: `https://www.dench.com/api/v1`
- URL: `https://www.dench.com/api/v1/files/content`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Read a workspace file's text.

## Query parameters

- `path` string, required: Workspace file path, e.g. /reports/q2.md. A leading /workspace/ mount prefix is stripped.
- `slug` string

## Response `200`

Successful response

- object, nullable: The file, or null when nothing exists at the path.
  - `path` string, required
  - `isDir` boolean, required
  - `virtual` boolean, required
  - `size` number, nullable, required
  - `mtime` number, nullable
  - `content` string, nullable, required: Inline text, or null for binary / uncached files.
  - `encoding` string, nullable, required
  - `contentHash` string, nullable
  - `downloadable` boolean, required

## Other responses

- `400`: Invalid request
- `401`: Missing or invalid authentication
- `404`: Operation or resource not found
- `500`: Server error

---

[API](https://skmtc.dev/dench/apis/dench-api.md) - [All operations](https://skmtc.dev/dench/apis/dench-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dench/apis/dench-api/revisions/4a145b38f19c?raw)
