Skip to main content
Streams the bytes for a single file at any branch, tag, or commit.
GET /api/v1/repos/file?path=FILE_PATH&ref=BRANCH_OR_SHA
Authorization: Bearer YOUR_JWT_TOKEN

Parameters

ParameterTypeDescription
pathRequiredThe path to the file to read
refOptionalBranch name or commit SHA. If not specified, uses the repository’s default branch
ephemeralOptionalWhen true, resolves the ref under the ephemeral namespace

JWT Requirements

  • The JWT must include the repository in the repo claim
  • Requires git:read scope

Response

Returns raw file bytes as a streaming response with appropriate Content-Type header.

Notes

  • Returns raw file bytes as streaming response
  • If no ref is specified, the repository’s default branch is used (typically main)

Error Responses

StatusDescription
404 Not FoundFile or reference doesn’t exist
401 UnauthorizedInvalid JWT or missing git:read scope
400 Bad RequestMissing path parameter or invalid file path