GitLab API

GitlabTool

Actions1095

Branches → getApiV4ProjectsIdRepositoryBranches

AI-generated

Summary

Retrieve a list of branches from a specified GitLab project repository using the GitLab API v4.

Inputs

  • id (required) — The ID or URL-encoded path of the GitLab project whose repository branches you want to list.
  • page — Current page number of the results to fetch (pagination). Defaults to 1.
  • per_page — Number of branches to return per page. Defaults to 20.
  • search — Filter branches to those matching the provided search string.
  • regex — Filter branches using the provided regular expression.
  • sort — Sort the list of branches by 'name_asc', 'updated_asc', or 'updated_desc'.
  • page_token — The name of the branch to start pagination from.
  • baseUrl — Base URL for the GitLab instance; defaults to 'https://gitlab.com'.
  • skipAuthentication — Set to true to skip authentication; otherwise authentication using GitLab credentials is required.

Output shape

a list of branch objects from the project's repository

Supports pagination via 'page', 'per_page', and 'page_token'. Optional filtering by 'search' and 'regex' and sorting by specified fields are available. The operation issues a GET request to '/api/v4/projects/{id}/repository/branches' endpoint.

Links

Discussion