Use this API to interact with the PyPI package manager client.
This API is used by the PyPI package manager client and is generally not meant for manual consumption.
These endpoints do not adhere to the standard API authentication methods. See the PyPI package registry documentation for details on which headers and token types are supported. Undocumented authentication methods might be removed in the future.
Twine 3.4.2 or greater is recommended when FIPS mode is enabled.
Download a package file from a group
GET /api/v4/groups/{id}/-/packages/pypi/files/{sha256}/{file_identifier}
This feature was introduced in GitLab 13.12
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | Integer or string | The ID or full path of the group |
file_Path, | String | The Py Example: my. |
sha256Path, | String | The Py Example: 5y57017232013c8ac806 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
List all packages for a group
GET /api/v4/groups/{id}/-/packages/pypi/simple
Lists all packages for a specified group in an HTML file.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | Integer or string | The ID or full path of the group |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
The PyPi Simple Group Package Endpoint
GET /api/v4/groups/{id}/-/packages/pypi/simple/{package_name}
This feature was introduced in GitLab 12.10
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | Integer or string | The ID or full path of the group |
package_Path, | String | The Py Example: my. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Upload a package
POST /api/v4/projects/{id}/packages/pypi
Uploads a PyPI package for a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Request body (multipart/form-data)
| Property | Type | Description |
|---|---|---|
author_ | String | Email address for the package author Example: cschultz@example. |
contentRequired | String (binary) | The package file to be published (generated by Multipart middleware) |
description | String | Description of the package |
description_ | String | Type of content for the package description Example: text/ |
keywords | String | Keywords listed for the package Example: dog, |
md5_ | String | MD5 checksum of the package Example: 900150983cd24fb0d696 |
metadata_ | String | Metadata version of the package Example: 2. |
nameRequired | String | Name of the package Example: my. |
requires_ | String | Py Example: >=3. |
sha256_ | String | SHA256 checksum of the package Pattern: (?:Example: ba7816bf8f01cfea4141 |
summary | String | Short summary of the package Example: A module for collecting votes from beagles. |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
422 | Unprocessable Entity | — |
Authorize the PyPi package upload from workhorse
POST /api/v4/projects/{id}/packages/pypi/authorize
This feature was introduced in GitLab 12.10
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
The PyPi package download endpoint
GET /api/v4/projects/{id}/packages/pypi/files/{sha256}/{file_identifier}
This feature was introduced in GitLab 12.10
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
file_Path, | String | The Py Example: my. |
sha256Path, | String | The Py Example: 5y57017232013c8ac806 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
Download a forwarded (proxied) PyPI package file
GET /api/v4/projects/{id}/packages/pypi/forward/{package_name}/{upstream_path}
Enforces the Dependency Firewall then redirects to the upstream artifact.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
package_Path, | String | The normalized Py Example: my. |
upstream_Path, | String | The upstream artifact host and path, |
Responses
| Code | Description | Schema |
|---|---|---|
302 | Found | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
List all packages for a project
GET /api/v4/projects/{id}/packages/pypi/simple
Lists all packages for a specified project in an HTML file.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |
The PyPi Simple Project Package Endpoint
GET /api/v4/projects/{id}/packages/pypi/simple/{package_name}
This feature was introduced in GitLab 12.10
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
package_Path, | String | The Py Example: my. |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not Found | — |