GitLab API

GitlabTool

Actions1095

Projects → getApiV4ProjectsIdRepositoryFilesFilePathBlame

AI-generated

Summary

Retrieve line-by-line blame information for a specified file in a GitLab project repository over a defined line range and reference.

Inputs

  • id (required) — The project ID or URL-encoded project path identifying the GitLab project.
  • file_path (required) — The URL-encoded path to the file within the project repository.
  • ref (required) — The branch, tag, or commit SHA to query the file on.
  • range[start] (required) — The starting line number of the file range to retrieve blame information for.
  • range[end] (required) — The ending line number of the file range to retrieve blame information for.

Output shape

a single JSON object representing the blame details for the specified file and line range, including committing authorship data per line

The operation corresponds to an HTTP GET method call to the GitLab API endpoint /api/v4/projects/{id}/repository/files/{file_path}/blame. The response includes blame data scoped to the given file path, reference, and line range. Authentication is required unless explicitly skipped.

Links

Discussion