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

path
string
required
The path to the file to read
ref
string
Branch name or commit SHA. If not specified, uses the repository’s default branch
ephemeral
string
When 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

404 Not Found
string
File or reference doesn’t exist
401 Unauthorized
string
Invalid JWT or missing git:read scope
400 Bad Request
string
Missing path parameter or invalid file path