Use this API to manage the packages stored in a project or a group.
Download the maven package file for a group
GET /api/v4/groups/{id}/-/packages/maven/{path}/{file_name}
This feature was introduced in GitLab 11.7
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
file_Path, | String | Package file name Example: mypkg- |
pathPath, | String | Package path Example: foo/ |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
302 | Found | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
List all packages for a group
GET /api/v4/groups/{id}/packages
Lists all packages for a specified group. When accessed without authentication, only packages of public projects are returned. By default, packages with default, deprecated, and error status are returned. Use the status parameter to view other packages. Packages of non-public projects are returned only for projects where you have at least the Reporter role. Packages with processing status can contain malformed data or be broken. In the response, creator_id is the ID of the user who created the package, and is null when a deploy token created the package. For a Conan package, name contains the recipe, and conan_package_name contains the package name. Other package types do not have this field. In _links, web_path is the path to the package details page in GitLab, returned only if the package has status default or deprecated, and delete_api_path is the API path to delete the package, returned only if you have permission to delete it.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
exclude_Query | Boolean | If true,Default: false |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
order_Query | String | Sort results by the specified field Allowed values: created_,name,version,type,project_Default: created_ |
sortQuery | String | Sort results in ascending or descending order Allowed values: asc,descDefault: asc |
package_Query | String | Filter packages by type Allowed values: maven,npm,conan,nuget,pypi,composer,generic,golang,debian,rubygems,helm,terraform_,rpm,ml_,cargo,swift |
package_Query | String | Filter packages by name, |
package_Query | String | Filter packages by version.include_, |
include_Query | Boolean | If true, |
statusQuery | String | Filter packages by status Allowed values: default,hidden,processing,error,pending_,deprecated |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
404 | Group Not Found | — |
Download the maven package file for the instance
GET /api/v4/packages/maven/{path}/{file_name}
This feature was introduced in GitLab 11.6
Parameters
| Name | Type | Description |
|---|---|---|
file_Path, | String | Package file name Example: mypkg- |
pathPath, | String | Package path Example: foo/ |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
List all packages for a project
GET /api/v4/projects/{id}/packages
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. Packages with processing status can contain malformed data or be broken.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
order_Query | String | Sort results by the specified field Allowed values: created_,name,version,typeDefault: created_ |
sortQuery | String | Sort results in ascending or descending order Allowed values: asc,descDefault: asc |
package_Query | String | Filter packages by type Allowed values: maven,npm,conan,nuget,pypi,composer,generic,golang,debian,rubygems,helm,terraform_,rpm,ml_,cargo,swift |
package_Query | String | Filter packages by name, |
package_Query | String | Filter packages by version.include_, |
include_Query | Boolean | If true, |
statusQuery | String | Filter packages by status Allowed values: default,hidden,processing,error,pending_,deprecated |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Project Not Found | — |
Download package file
GET /api/v4/projects/{id}/packages/generic/{package_name}/{package_version}/{file_name}
This feature was introduced in GitLab 13.5
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
package_Path, | String | Package name Pattern: ^[A- |
file_Path, | String | Package file name Pattern: ^(?!~)(?!@)[A- |
package_Path, | String | Package version Pattern: ^(?!(?: |
download_Query | String | Requested download transfer mode (proxy or direct).Allowed values: proxy,direct |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Upload package file
PUT /api/v4/projects/{id}/packages/generic/{package_name}/{package_version}/{file_name}
This feature was introduced in GitLab 13.5
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
package_Path, | String | Package name Pattern: ^[A- |
file_Path, | String | Package file name Pattern: ^(?!~)(?!@)[A- |
package_Path, | String | Package version Pattern: ^(?!(?: |
Request body (multipart/form-data)
| Property | Type | Description |
|---|---|---|
fileRequired | String (binary) | The package file to publish (generated by Multipart middleware) |
select | String | Response format selector. Allowed values: package_ |
status | String | Package status Allowed values: default,hidden |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
201 | Created | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Workhorse authorize generic package file
PUT /api/v4/projects/{id}/packages/generic/{package_name}/{package_version}/{file_name}/authorize
This feature was introduced in GitLab 13.5
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
package_Path, | String | Package name Pattern: ^[A- |
file_Path, | String | Package file name Pattern: ^(?!~)(?!@)[A- |
package_Path, | String | Package version Pattern: ^(?!(?: |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
status | String | Package status Allowed values: default,hidden |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Download package file
GET /api/v4/projects/{id}/packages/generic/{package_name}/{package_version}/{path}/{file_name}
This feature was introduced in GitLab 13.5
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
package_Path, | String | Package name Pattern: ^[A- |
file_Path, | String | Package file name Pattern: ^(?!~)(?!@)[A- |
package_Path, | String | Package version Pattern: ^(?!(?: |
pathPath, | String | File directory path |
download_Query | String | Requested download transfer mode (proxy or direct).Allowed values: proxy,direct |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Upload package file
PUT /api/v4/projects/{id}/packages/generic/{package_name}/{package_version}/{path}/{file_name}
This feature was introduced in GitLab 13.5
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
package_Path, | String | Package name Pattern: ^[A- |
file_Path, | String | Package file name Pattern: ^(?!~)(?!@)[A- |
package_Path, | String | Package version Pattern: ^(?!(?: |
pathPath, | String | File directory path |
Request body (multipart/form-data)
| Property | Type | Description |
|---|---|---|
fileRequired | String (binary) | The package file to publish (generated by Multipart middleware) |
select | String | Response format selector. Allowed values: package_ |
status | String | Package status Allowed values: default,hidden |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
201 | Created | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Workhorse authorize generic package file
PUT /api/v4/projects/{id}/packages/generic/{package_name}/{package_version}/{path}/{file_name}/authorize
This feature was introduced in GitLab 13.5
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
package_Path, | String | Package name Pattern: ^[A- |
file_Path, | String | Package file name Pattern: ^(?!~)(?!@)[A- |
package_Path, | String | Package version Pattern: ^(?!(?: |
pathPath, | — | — |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
status | String | Package status Allowed values: default,hidden |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
List
GET /api/v4/projects/{id}/packages/go/{module_name}/@v/list
Get all tagged versions for a given Go module. Returns the versions as plain text, one per line. See go help goproxy, GET $GOPROXY/<module>/@v/list. This endpoint is used by the go command and is not meant for manual consumption. It does not follow the standard API authentication methods. Undocumented authentication methods might be removed in the future. This feature was introduced in GitLab 13.1.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The project ID or full path of a project |
module_Path, | String | The name of the Go module |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
404 | Not Found | — |
Version metadata
GET /api/v4/projects/{id}/packages/go/{module_name}/@v/{module_version}.info
Get the metadata of a given Go module version. See go help goproxy, GET $GOPROXY/<module>/@v/<version>.info. This endpoint is used by the go command and is not meant for manual consumption. It does not follow the standard API authentication methods. Undocumented authentication methods might be removed in the future. This feature was introduced in GitLab 13.1.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The project ID or full path of a project |
module_Path, | String | The name of the Go module |
module_Path, | String | The version of the Go module |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Download module file
GET /api/v4/projects/{id}/packages/go/{module_name}/@v/{module_version}.mod
Get the module file of a given module version. See go help goproxy, GET $GOPROXY/<module>/@v/<version>.mod. This endpoint is used by the go command and is not meant for manual consumption. It does not follow the standard API authentication methods. Undocumented authentication methods might be removed in the future. This feature was introduced in GitLab 13.1.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The project ID or full path of a project |
module_Path, | String | The name of the Go module |
module_Path, | String | The version of the Go module |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
404 | Not Found | — |
Download module source
GET /api/v4/projects/{id}/packages/go/{module_name}/@v/{module_version}.zip
Get a zip of the source of the given module version. See go help goproxy, GET $GOPROXY/<module>/@v/<version>.zip. This endpoint is used by the go command and is not meant for manual consumption. It does not follow the standard API authentication methods. Undocumented authentication methods might be removed in the future. This feature was introduced in GitLab 13.1.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The project ID or full path of a project |
module_Path, | String | The name of the Go module |
module_Path, | String | The version of the Go module |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
404 | Not Found | — |
Download the maven package file for a project
GET /api/v4/projects/{id}/packages/maven/{path}/{file_name}
This feature was introduced in GitLab 11.3
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
file_Path, | String | Package file name Example: mypkg- |
pathPath, | String | Package path Example: foo/ |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
302 | Found | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Upload the maven package file
PUT /api/v4/projects/{id}/packages/maven/{path}/{file_name}
This feature was introduced in GitLab 11.3
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
pathPath, | String | Package path Example: foo/ |
file_Path, | String | Package file name Pattern: ^[A-Example: mypkg- |
Request body (multipart/form-data)
| Property | Type | Description |
|---|---|---|
fileRequired | String (binary) | The package file to be published (generated by Multipart middleware) |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
422 | Unprocessable Entity | — |
Workhorse authorize the maven package file upload
PUT /api/v4/projects/{id}/packages/maven/{path}/{file_name}/authorize
This feature was introduced in GitLab 11.3
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
pathPath, | String | Package path Example: foo/ |
file_Path, | String | Package file name Pattern: ^[A-Example: mypkg- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Retrieve a project package
GET /api/v4/projects/{id}/packages/{package_id}
Retrieves a specified project package. Only packages with status default or deprecated are returned. In the response, creator_id is the ID of the user who created the package, and is null when a deploy token created the package. For a Conan package, name contains the recipe, and conan_package_name contains the package name. Other package types do not have this field. In _links, web_path is the path to the package details page in GitLab, and delete_api_path is the API path to delete the package, returned only if you have permission to delete it.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
package_Path, | Integer | ID of the package |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not Found | — |
Delete a project package
DELETE /api/v4/projects/{id}/packages/{package_id}
Deletes a specified project package. If request forwarding is enabled, deleting a package can introduce a dependency confusion risk. Deleting a package protected by a protection rule is forbidden. The protection check is behind a feature flag named packages_protected_packages_delete, disabled by default.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
package_Path, | Integer | ID of the package |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | — |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not Found | — |
List all package files
GET /api/v4/projects/{id}/packages/{package_id}/package_files
Lists all package files for a specified package.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
package_Path, | Integer | ID of the package |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items to list per page Default: 20Example: 20 |
order_Query | String | Sort results by the specified field Allowed values: id,created_,file_Default: id |
sortQuery | String | Sort results in ascending or descending order Allowed values: asc,descDefault: asc |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
404 | Not Found | — |
Delete a package file
DELETE /api/v4/projects/{id}/packages/{package_id}/package_files/{package_file_id}
Deletes a specified package file. Deleting a package file can corrupt the package, making it unusable or unpullable from your package manager client. Deleting a file of a package protected by a protection rule is forbidden. The protection check is behind a feature flag named packages_protected_packages_delete, disabled by default.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
package_Path, | Integer | ID of the package |
package_Path, | Integer | ID of the package file |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | — |
400 | Bad Request | — |
403 | Forbidden | — |
404 | Not found | — |
Download a package file
GET /api/v4/projects/{id}/packages/{package_id}/package_files/{package_file_id}/download
This feature was introduced in GitLab 18.4
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
package_Path, | Integer | ID of the package |
package_Path, | Integer | ID of the package file |
download_Query | String | Requested download transfer mode (proxy or direct).Allowed values: proxy,direct |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | String (binary) (application/) |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
List all package pipelines
GET /api/v4/projects/{id}/packages/{package_id}/pipelines
Lists all pipelines for a specified package. The results are sorted by id in descending order. The results are paginated and return up to 20 records per page. This feature was introduced in GitLab 16.1.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
pageQuery | Integer | Page number of results to retrieve Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Maximum: 20Minimum: 1Example: 20 |
package_Path, | Integer | ID of the package |
cursorQuery | String | Cursor for obtaining the next set of records |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | Array of APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesCustomAttribute
| Property | Type | Description |
|---|---|---|
key | String | Example:foo |
value | String | Example:bar |
APIEntitiesGoModuleVersion
| Property | Type | Description |
|---|---|---|
Time | String | Example:1617822312 - |
Version | String | Example:v1. |
APIEntitiesPackage
| Property | Type | Description |
|---|---|---|
_ | Object | — |
_ | String | — |
_ | String | — |
conan_ | String | — |
created_ | String (date- | Example:2022- |
creator_ | Integer (int64) | ID of the user who created the package Example: 1 |
id | Integer (int64) | Example:1 |
last_ | String (date- | Example:2022- |
name | String | Example:@foo/ |
package_ | String | Example:npm |
pipeline | APIEntities | — |
pipelines | Array of APIEntities | — |
project_ | Integer (int64) | Example:2 |
project_ | String | Example:gitlab/ |
status | String | Example:default |
tags | String | — |
version | String | Example:1. |
versions | Array of APIEntities | — |
APIEntitiesPackageFile
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Example:2018- |
file_ | String | Example:58e6a45a629910c6ff99 |
file_ | String | Example:my- |
file_ | String | Example:ebd193463d3915d7e222 |
file_ | String | Example:a903393463d3915d7e22 |
id | Integer (int64) | Example:225 |
package_ | Integer (int64) | Example:4 |
pipelines | Array of APIEntities | — |
size | Integer | Example:2421 |
APIEntitiesPackagePipeline
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Timestamp when the pipeline was created Example: 2022- |
id | Integer (int64) | ID of the pipeline Example: 1 |
iid | Integer | Internal ID of the pipeline Example: 2 |
project_ | Integer (int64) | ID of the project of the pipeline Example: 3 |
ref | String | Git reference of the pipeline Example: feature- |
sha | String | SHA of the commit the pipeline runs for Example: 0ec9e58fdfca6cdd6652 |
source | String | Source that triggered the pipeline Example: push |
status | String | Status of the pipeline Example: success |
updated_ | String (date- | Timestamp when the pipeline was last updated Example: 2022- |
user | APIEntities | — |
web_ | String | URL of the pipeline in the Git Example: https: |
APIEntitiesPackageVersion
| Property | Type | Description |
|---|---|---|
created_ | String | — |
id | String | — |
pipeline | APIEntities | — |
tags | String | — |
version | String | — |
APIEntitiesUserBasic
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:/ |
avatar_ | String | URL of the user’s avatar Example: https: |
custom_ | Array of APIEntities | — |
id | Integer (int64) | ID of the user Example: 1 |
locked | Boolean | If true, |
name | String | Name of the user.**** if the current user cannot read the bot’s project or groupExample: Administrator |
public_ | String | Public email address of the user Example: john@example. |
state | String | State of the user account.active,blocked,ldap_,blocked_,banned,deactivatedExample: active |
username | String | Username of the user Example: admin |
web_ | String | URL of the user’s profile Example: https: |