GitLab API

GitlabTool

Actions1095

Projects → getApiV4ProjectsIdRepositoryFilesFilePathRaw

AI-generated

Summary

Retrieve the raw content of a file in a GitLab project's repository via a direct API call to the GitLab instance.

Inputs

  • id (required) — The project ID or URL-encoded path (e.g., 'gitlab-org/gitlab') used to specify the project containing the file.
  • file_path (required) — The URL-encoded path to the file within the repository (e.g., 'lib%2Fclass%2Erb').
  • ref — The name of the branch, tag, or commit SHA to retrieve the file from; if omitted, the default branch is used.
  • lfs — Boolean flag indicating whether to retrieve the binary data for a file that is a Git Large File Storage (LFS) pointer.
  • method — HTTP method to use for the API call; defaults to GET.
  • baseUrl — The base URL of the GitLab instance; defaults to 'https://gitlab.com'.
  • skipAuthentication — If true, disables authentication for this API call.

Output shape

a single binary file representing the raw content of the specified repository file

The raw file content is returned directly without JSON wrapping. If the file is an LFS pointer and 'lfs' is true, the binary data will correspond to the actual file content. Errors or non-200 responses are not wrapped and will be surfaced as request errors.

Links

Discussion