---
title: "Upload a package"
method: POST
path: "/api/v4/projects/{id}/packages/pypi"
tags: ["packages_pypi"]
---

# Upload a package

`POST /api/v4/projects/{id}/packages/pypi`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/projects/{id}/packages/pypi`
- Auth: none declared

Uploads a PyPI package for a specified project.

## Path parameters

- `id` string, required

## Request body

- PostApiV4ProjectsIdPackagesPypi: Upload a package
  - `content` string, binary, required: The package file to be published (generated by Multipart middleware)
  - `name` string, required: Name of the package
  - `version` string, required: Version of the package
  - `requires_python` string: PyPI version required for the package
  - `md5_digest` string: MD5 checksum of the package
  - `sha256_digest` string: SHA256 checksum of the package
  - `metadata_version` string: Metadata version of the package
  - `author_email` string: Email address for the package author
  - `description` string: Description of the package
  - `description_content_type` string: Type of content for the package description
  - `summary` string: Short summary of the package
  - `keywords` string: Keywords listed for the package

## Response `201`

Upload a package

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `422`: Unprocessable Entity

---

[API](https://skmtc.dev/gitlab/apis/gitlab-api.md) - [All operations](https://skmtc.dev/gitlab/apis/gitlab-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitlab/apis/gitlab-api/revisions/b234947ef3f2?raw)
