Skip to main content
Enumerates every file at the requested reference to help you build navigation or quick comparisons.
GET /api/v1/repos/files?ref=BRANCH_OR_SHA
Authorization: Bearer YOUR_JWT_TOKEN

Parameters

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

{
  "paths": ["README.md", "package.json", "src/index.js", "src/utils/helper.js"],
  "ref": "main"
}

Notes

  • Returns all files in the repository at the specified ref
  • Directories are not included in the list, only files
  • File paths are relative to the repository root
  • If no ref is specified, the repository’s default branch is used (typically main or master)
  • paths: Array of file paths in the repository
  • ref: The resolved reference (branch name or commit SHA) that was used

Error Responses

404 Not Found
string
Reference doesn’t exist. This includes newly created repos that haven’t been pushed to yet, since they don’t have any branches.
401 Unauthorized
string
Invalid JWT or missing git:read scope