v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1438166195.6 KB

Creates a new package version containing one or more assets (or files).

The unfinished flag can be used to keep the package version in the Unfinished state until all of its assets have been uploaded (see Package version status in the CodeArtifact user guide). To set the package version’s status to Published, omit the unfinished flag when uploading the final asset, or set the status using UpdatePackageVersionStatus. Once a package version’s status is set to Published, it cannot change back to Unfinished.

Only generic packages can be published using this API. For more information, see Using generic packages in the CodeArtifact User Guide.

post/v1/package/version/publish#domain&repository&format&package&version&asset&x-amz-content-sha256

Query parameters

domainstring required

The name of the domain that contains the repository that contains the package version to publish.

domain-ownerstring

The 12-digit account number of the AWS account that owns the domain. It does not include dashes or spaces.

repositorystring required

The name of the repository that the package version will be published to.

format'npm' | 'pypi' | 'maven' | 'nuget' | 'generic' required

A format that specifies the type of the package version with the requested asset file.

namespacestring

The namespace of the package version to publish.

packagestring required

The name of the package version to publish.

versionstring required

The package version to publish (for example, <code>3.5.2</code>).

assetstring required

The name of the asset to publish. Asset names can include Unicode letters and numbers, and the following special characters: <code>~ ! @ ^ & ( ) - _ + [ ] { } ; , .</code>

unfinishedboolean
<p>Specifies whether the package version should remain in the <code>unfinished</code> state. If omitted, the package version status will be set to <code>Published</code> (see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/packages-overview.html#package-version-status">Package version status</a> in the <i>CodeArtifact User Guide</i>).</p> <p>Valid values: <code>unfinished</code> </p>

Headers

x-amz-content-sha256string required
<p>The SHA256 hash of the <code>assetContent</code> to publish. This value must be calculated by the caller and provided with the request (see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/using-generic.html#publishing-generic-packages">Publishing a generic package</a> in the <i>CodeArtifact User Guide</i>).</p> <p>This value is used as an integrity check to verify that the <code>assetContent</code> has not changed after it was originally sent.</p>

Request body

assetContentstring required

The content of the asset to publish.

Response

Success

format'npm' | 'pypi' | 'maven' | 'nuget' | 'generic'

The format of the package version.

namespacestring

The namespace of the package version.

packagestring

The name of the package.

versionstring

The version of the package.

versionRevisionstring

The revision of the package version.

status'Published' | 'Unfinished' | 'Unlisted' | 'Archived' | 'Disposed' | 'Deleted'

A string that contains the status of the package version. For more information, see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/packages-overview.html#package-version-status.html#package-version-status">Package version status</a> in the <i>CodeArtifact User Guide</i>.