---
title: "Reads a file of a published version"
method: GET
path: "/sources/{publicKey}/versions/{version}/files/{path}"
tags: ["Open source"]
---

# Reads a file of a published version

`GET /sources/{publicKey}/versions/{version}/files/{path}`

## Request

- Base URL: `https://genhttp.dev/api/v1`
- URL: `https://genhttp.dev/api/v1/sources/{publicKey}/versions/{version}/files/{path}`
- Auth: none declared

Its text, while it is UTF-8 text no longer than a megabyte, and either way where to fetch it as it is (`rawPath`).

## Path parameters

- `publicKey` string, required
- `version` integer, required
- `path` string, required

## Response `200`

The file, with its text where it is text

- SourceFileContentResponse: A file of a published version, with its text.
  - `Path` string: Its path below the project's folder
  - `Size` integer: How large it is, in bytes
  - `Kind` string: What it is: `code`, `resource`, `docs`, `tests`, `platform` or `project`
  - `Text` boolean: Whether it is text - which is then in `content`, unless it is longer than a megabyte
  - `Content` string, nullable: Its text, while it is text no longer than a megabyte
  - `RawPath` string: Where it is fetched as it is

## Other responses

- `204`: A response containing no body
- `404`: There is no published source at this public key, it has no such version, or the version has no such file.

---

[API](https://skmtc.dev/genhttp/apis/genhttp-lambda-api.md) · [All operations](https://skmtc.dev/genhttp/apis/genhttp-lambda-api/llms.txt) · [OpenAPI document](https://skmtc.dev/genhttp/apis/genhttp-lambda-api/revisions/8b36699e03df?raw)
