packages

List all packages for a project

Lists all packages for a specified project. All package types are included in results. Unauthenticated requests return only packages of public projects. By default, packages with default, deprecated, and error status are returned. Use the status parameter to view other packages.

get/api/v4/projects/{id}/packages

Request

  • Base URL
    https://gitlab.com
  • Auth
    none declared

Path parameters

idstring required

The ID or URL-encoded path of the project

Query parameters

pageinteger

Current page number

per_pageinteger

Number of items per page

order_by'created_at' | 'name' | 'version' | 'type'

Return packages ordered by created_at, name, version or type fields.

sort'asc' | 'desc'

Return packages sorted in asc or desc order.

package_type'maven' | 'npm' | 'conan' | 'nuget' | 'pypi' | 'composer' | 'generic' | 'golang' | 'debian' | 'rubygems' | 'helm' | 'terraform_module' | 'rpm' | 'ml_model' | 'cargo'

Return packages of a certain type

package_namestring

Return packages with this name

package_versionstring

Return packages with this version

include_versionlessboolean

Returns packages without a version

status'default' | 'hidden' | 'processing' | 'error' | 'pending_destruction' | 'deprecated'

Return packages with specified status

Response

List all packages for a project

idinteger required
namestring required
conan_package_namestring
versionstring required
package_typestring required
statusstring required
created_atstring date-time required
last_downloaded_atstring date-time required
creator_idinteger required

ID of the user who created the package

project_idinteger
project_pathstring
tagsstring required

Example response

[
  {
    "id": 1,
    "name": "@foo/bar",
    "version": "1.0.3",
    "package_type": "npm",
    "status": "default",
    "created_at": "2022-09-16T12:47:31.949Z",
    "last_downloaded_at": "2022-09-19T11:32:35.169Z",
    "creator_id": 1,
    "project_id": 2,
    "project_path": "gitlab/foo/bar",
    "pipeline": {
      "id": 1,
      "iid": 2,
      "project_id": 3,
      "sha": "0ec9e58fdfca6cdd6652c083c9edb53abc0bad52",
      "ref": "feature-branch",
      "status": "success",
      "source": "push",
      "created_at": "2022-10-21T16:49:48.000+02:00",
      "updated_at": "2022-10-21T16:49:48.000+02:00",
      "web_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/pipelines/61",
      "user": {
        "id": 1,
        "username": "admin",
        "public_email": "john@example.com",
        "name": "Administrator",
        "state": "active",
        "avatar_url": "https://gravatar.com/avatar/1",
        "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
        "custom_attributes": [
          {
            "key": "foo",
            "value": "bar"
          }
        ],
        "web_url": "https://gitlab.example.com/root"
      }
    },
    "pipelines": {
      "id": 1,
      "iid": 2,
      "project_id": 3,
      "sha": "0ec9e58fdfca6cdd6652c083c9edb53abc0bad52",
      "ref": "feature-branch",
      "status": "success",
      "source": "push",
      "created_at": "2022-10-21T16:49:48.000+02:00",
      "updated_at": "2022-10-21T16:49:48.000+02:00",
      "web_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/pipelines/61",
      "user": {
        "id": 1,
        "username": "admin",
        "public_email": "john@example.com",
        "name": "Administrator",
        "state": "active",
        "avatar_url": "https://gravatar.com/avatar/1",
        "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
        "custom_attributes": [
          {
            "key": "foo",
            "value": "bar"
          }
        ],
        "web_url": "https://gitlab.example.com/root"
      }
    },
    "versions": {
      "pipeline": {
        "id": 1,
        "iid": 2,
        "project_id": 3,
        "sha": "0ec9e58fdfca6cdd6652c083c9edb53abc0bad52",
        "ref": "feature-branch",
        "status": "success",
        "source": "push",
        "created_at": "2022-10-21T16:49:48.000+02:00",
        "updated_at": "2022-10-21T16:49:48.000+02:00",
        "web_url": "https://gitlab.example.com/gitlab-org/gitlab-foss/-/pipelines/61",
        "user": {
          "id": 1,
          "username": "admin",
          "public_email": "john@example.com",
          "name": "Administrator",
          "state": "active",
          "avatar_url": "https://gravatar.com/avatar/1",
          "avatar_path": "/user/avatar/28/The-Big-Lebowski-400-400.png",
          "custom_attributes": [
            {
              "key": "foo",
              "value": "bar"
            }
          ],
          "web_url": "https://gitlab.example.com/root"
        }
      }
    }
  }
]

Changes

No recorded changes to this operation across all 5 revisions of this API.