---
title: "Read a file"
method: POST
path: "/v2/sandboxes/sessions/{sessionId}/fs/read"
tags: ["sandboxes"]
---

# Read a file

`POST /v2/sandboxes/sessions/{sessionId}/fs/read`

Downloads the contents of a file from a session's filesystem. The file content is returned as a binary stream with appropriate Content-Disposition headers for file download.

## Path parameters

- `sessionId` string, required — The unique identifier of the session to read the file from.

## Query parameters

- `teamId` string
- `slug` string

## Request body

- object
  - `cwd` string — The base directory for resolving relative paths. If not specified, paths are resolved from the sandbox home directory.
  - `path` string, required — The path of the file to read. Can be absolute or relative to the working directory.

## Response `200`

## Other responses

- `400` — One of the provided values in the request body is invalid. One of the provided values in the request query is invalid.
- `401` — The request is not authorized.
- `403` — You do not have permission to access this resource.
- `404`
- `410`
- `422`
- `429`
- `500`

---

[API](https://skmtc.net/vercel/apis/api.md) · [All operations](https://skmtc.net/vercel/apis/api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/vercel/api/versions/61d1ba3f6dac/schema)
