The API endpoint served at https://upload.pypi.org/legacy/ is Warehouse's emulation of the legacy PyPI upload API. This is the endpoint that tools such as twine use to upload distributions to PyPI.
Important
Releases on PyPI are created by uploading one file at a time.
The first file uploaded of a new version creates a release for that version, and populates its metadata.
Route: POST upload.pypi.org/legacy/
The upload API can be used to upload artifacts by sending a multipart/form-data POST request with the following fields:
You can set any other field from the Core metadata specifications.
All fields need to be renamed to lowercase and hyphens need to replaced by underscores. Additionally, multiple-use fields (like Classifier) are pluralized (e.g. classifiers) with some limited exceptions noted below:
| Platform | platform (not platforms) |
| Supported-Platform | supported_platform (not supported_platforms) |
| License-File | license_file (not license_files) |
Warning
The transformation above must be performed. Sending a form field like Description-Content-Type will not raise an error but will be silently ignored.