GitLab API icon

GitLab API

Gitlab

Actions1062

Projects → getApiV4ProjectsIdRepositoryFilesFilePathRaw

AI-generated

Summary

Retrieve the raw content of a specific file in a GitLab project's repository by specifying the project ID, file path, and optionally the branch, tag, or commit reference.

Inputs

  • id (required) — The project ID or URL-encoded project path (e.g., 'gitlab-org/gitlab').
  • file_path (required) — The URL-encoded path to the file in the repository (e.g., 'lib%2Fclass%2Erb').
  • ref — The name of the branch, tag, or commit from which to retrieve the file. Defaults to the repository's default branch if omitted.
  • lfs — Boolean flag to retrieve the binary data for a file that is a Git Large File Storage (LFS) pointer. Defaults to false.
  • method — The HTTP method to use for the request. Defaults to GET and typically GET is used.
  • skipAuthentication — Option to skip authentication for this request. Defaults to false.

Output shape

binary file content

Returns the raw binary content of the specified file in the repository. The response is the file payload with no wrapping metadata.

Links

Discussion