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.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
exclude_Query | Boolean | Determines if subgroups should be excluded Default: false |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
order_Query | String | Return packages ordered by created_,name,version or type fieldsAllowed values: created_,name,version,type,project_Default: created_ |
sortQuery | String | Return packages sorted in asc or desc orderAllowed values: asc,descDefault: asc |
package_Query | String | Return packages of a certain type Allowed values: maven,npm,conan,nuget,pypi,composer,generic,golang,debian,rubygems,helm,terraform_,rpm,ml_,cargo |
package_Query | String | Return packages with this name |
package_Query | String | Return packages with this version |
include_Query | Boolean | Returns packages without a version |
statusQuery | String | Return packages with specified status Allowed values: default,hidden,processing,error,pending_,deprecated |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | 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.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
order_Query | String | Return packages ordered by created_,name,version or type fieldsAllowed values: created_,name,version,typeDefault: created_ |
sortQuery | String | Return packages sorted in asc or desc orderAllowed values: asc,descDefault: asc |
package_Query | String | Return packages of a certain type Allowed values: maven,npm,conan,nuget,pypi,composer,generic,golang,debian,rubygems,helm,terraform_,rpm,ml_,cargo |
package_Query | String | Return packages with this name |
package_Query | String | Return packages with this version |
include_Query | Boolean | Returns packages without a version |
statusQuery | String | Return packages with specified status Allowed values: default,hidden,processing,error,pending_,deprecated |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | 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.See go help goproxy, GET $GOPROXY/<module>/@v/list. 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 all tagged versions for a given Go module.See go help goproxy, GET $GOPROXY/<module>/@v/<version>.info. 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 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 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.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
package_Path, | Integer | The ID of a 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.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
package_Path, | Integer | The ID of a 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 a package |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
order_Query | String | Return package files ordered by id,created_ or file_Allowed values: id,created_,file_Default: id |
sortQuery | String | Return package files sorted in asc or desc orderAllowed values: asc,descDefault: asc |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | 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.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | ID or URL- |
package_Path, | Integer | ID of a package |
package_Path, | Integer | ID of a 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 a package |
package_Path, | Integer | ID of a 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 | The ID or URL- |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Maximum: 20Minimum: 1Example: 20 |
package_Path, | Integer | The ID of a package |
cursorQuery | String | Cursor for obtaining the next set of records |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | 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 | APIEntities | — |
project_ | Integer (int64) | Example:2 |
project_ | String | Example:gitlab/ |
status | String | Example:default |
tags | String | — |
version | String | Example:1. |
versions | 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 | APIEntities | — |
size | Integer | Example:2421 |
APIEntitiesPackagePipeline
| Property | Type | Description |
|---|---|---|
created_ | String (date- | Example:2022- |
id | Integer (int64) | Example:1 |
iid | Integer | Example:2 |
project_ | Integer (int64) | Example:3 |
ref | String | Example:feature- |
sha | String | Example:0ec9e58fdfca6cdd6652 |
source | String | Example:push |
status | String | Example:success |
updated_ | String (date- | Example:2022- |
user | APIEntities | — |
web_ | String | 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 | Example:https: |
custom_ | Array of APIEntities | — |
id | Integer (int64) | Example:1 |
locked | Boolean | — |
name | String | Example:Administrator |
public_ | String | Example:john@example. |
state | String | Example:active |
username | String | Example:admin |
web_ | String | Example:https: |