---
title: "Read runtime sandbox file"
method: POST
path: "/context/runtime/content"
tags: ["Context - Runtime"]
---

# Read runtime sandbox file

`POST /context/runtime/content`

Read a UTF-8 file from the workspace runtime sandbox. Returns the file content.

## Request body

- object — Read a file from the workspace runtime sandbox.
  - `path` string, required — Path of the file to read in the runtime sandbox, relative to the workspace working directory.
  - `startLine` integer — 1-indexed inclusive line at which to start reading. Defaults to the first line of the file.
  - `endLine` integer — 1-indexed inclusive line at which to stop reading. Defaults to the last line of the file. Must be greater than or equal to `startLine` when both are provided.

## Response `200`

Successful response

- object
  - `path` string, required
  - `content` string, required — UTF-8 decoded content of the requested line range.
  - `startLine` integer, required — 1-indexed inclusive start line of the returned slice (after clamping to the file's bounds).
  - `endLine` integer, required — 1-indexed inclusive end line of the returned slice. Equals `startLine - 1` when the requested range starts past the end of the file.
  - `totalLines` integer, required — Total number of lines in the underlying file.

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `404` — Not found
- `500` — Internal server error

---

[API](https://skmtc.net/getcargo/apis/cargo-api.md) · [All operations](https://skmtc.net/getcargo/apis/cargo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/getcargo/cargo-api/revisions/1d5a19e01d83/schema)
