GitLab API icon

GitLab API

Gitlab

Actions1062

Projects → getApiV4ProjectsIdRepositoryFilesFilePathBlame

AI-generated

Summary

Retrieve the blame information for a specific file in a GitLab project repository over a defined line range and 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 for which blame information is requested.
  • ref (required) — The name of the branch, tag, or commit SHA to reference for the blame operation.
  • range[start] (required) — The first line number of the file range to include in the blame.
  • range[end] (required) — The last line number of the file range to include in the blame.
  • skipAuthentication — Option to skip authentication, defaults to false.
  • baseUrl — Base URL of the GitLab instance, defaults to 'https://gitlab.com'.
  • method — HTTP method to use, defaults to GET.

Output shape

a JSON object containing the blame data from GitLab representing line-by-line attribution for the specified file range and ref.

The operation calls the GET method on the path '/api/v4/projects/{id}/repository/files/{file_path}/blame' with required path and query parameters. Authentication is required unless explicitly skipped. The returned data structure corresponds to GitLab's API blame endpoint response for the requested file and line range.

Links

Discussion