GitLab API icon

GitLab API

Gitlab

Actions1062

Projects → getApiV4ProjectsIdRepositoryTree

AI-generated

Summary

Retrieve the repository tree of a specified project by its ID or URL-encoded path, optionally filtered by branch/tag, path within the repository, and pagination parameters.

Inputs

  • id (required) — The ID or URL-encoded path of the project to get the repository tree from.
  • ref — The name of a repository branch or tag; if omitted, the default branch is used.
  • path — The specific path within the repository tree to retrieve.
  • recursive — Whether to obtain the tree recursively.
  • page — The current page number for paginated responses.
  • per_page — Number of items per page in the paginated response.
  • pagination — The pagination method to use; can be 'legacy', 'keyset', or 'none' (only valid if recursive is true).
  • page_token — Record token to start keyset pagination from.

Output shape

a list of repository tree items (files and directories) for the given project and query parameters

Results are paginated according to the query parameters. Recursive retrieval is supported. Authentication is required unless skipped explicitly.

Links

Discussion