GitLab API icon

GitLab API

Gitlab

Actions1062

Projects → getApiV4UsersUserIdProjects

AI-generated

Summary

Retrieve projects owned or accessible by a specific user identified by user ID or username, with support for multiple optional filters and sorting parameters to refine the results.

Inputs

  • user_id (required) — The ID or username of the user whose projects are to be retrieved.
  • order_by — Field by which to order the returned projects, such as creation date or name.
  • sort — Sort order direction, ascending or descending.
  • archived — Filter projects by archived status.
  • visibility — Filter projects by visibility level (private, internal, public).
  • search — Search term to filter projects by name or description.
  • search_namespaces — Include ancestor namespaces when applying the search filter.
  • owned — Limit result to projects owned by the authenticated user.
  • starred — Limit result to projects starred by the authenticated user.
  • imported — Limit result to projects imported by the authenticated user.
  • membership — Limit result to projects the current user is a member of.
  • with_issues_enabled — Filter projects that have issues enabled.
  • with_merge_requests_enabled — Filter projects that have merge requests enabled.
  • with_programming_language — Filter projects using the specified programming language.
  • min_access_level — Filter projects by minimum access level of the authenticated user.
  • id_after — Filter projects with IDs greater than this value.
  • id_before — Filter projects with IDs less than this value.
  • last_activity_after — Filter projects with last activity after this ISO8601 datetime.
  • last_activity_before — Filter projects with last activity before this ISO8601 datetime.
  • repository_storage — Filter projects by repository storage shard (admin only).
  • topic — Filter projects that have all specified comma-separated topics.
  • topic_id — Filter projects by associated topic ID.
  • updated_before — Filter projects updated before this ISO8601 datetime.
  • updated_after — Filter projects updated after this ISO8601 datetime.
  • include_pending_delete — Include projects pending deletion (admin only).
  • wiki_checksum_failed — Filter projects where the wiki checksum has failed.
  • repository_checksum_failed — Filter projects where the repository checksum has failed.
  • include_hidden — Include hidden projects (admin only).
  • marked_for_deletion_on — Filter projects marked for deletion on this date.
  • page — Page number for paginated results.
  • per_page — Number of projects per page for pagination.
  • simple — Return simplified project objects with only ID, URL, name, and path.
  • statistics — Include detailed project statistics in the response.
  • with_custom_attributes — Include any custom attributes defined on projects.

Output shape

a list of project objects as returned by the GitLab API v4 endpoint /users/{user_id}/projects

Supports various query parameters for filtering and pagination which affect the returned list. The shape of each project object reflects GitLab's standard project representation, optionally simplified if the 'simple' parameter is true. Errors or access issues depend on authentication and permissions associated with the API credential.

Examples

Example 1: Get all public projects owned by user 'john_doe' sorted by creation date descending

Set user_id to 'john_doe', visibility to 'public', order_by to 'created_at', and sort to 'desc'.

Example 2: Retrieve first 10 starred projects of a user by ID

Set user_id to the user's numeric ID, starred to true, per_page to 10, and page to 1.

Links

Discussion