v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1438166195.6 KB

Copies package versions from one repository to another repository in the same domain.

You must specify versions or versionRevisions. You cannot specify both.

post/v1/package/versions/copy#domain&source-repository&destination-repository&format&package

Query parameters

domainstring required

The name of the domain that contains the source and destination repositories.

domain-ownerstring

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

source-repositorystring required

The name of the repository that contains the package versions to be copied.

destination-repositorystring required

The name of the repository into which package versions are copied.

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

The format of the package versions to be copied.

namespacestring
<p>The namespace of the package versions to be copied. The package version component that specifies its namespace depends on its type. For example:</p> <ul> <li> <p> The namespace of a Maven package version is its <code>groupId</code>. The namespace is required when copying Maven package versions. </p> </li> <li> <p> The namespace of an npm package version is its <code>scope</code>. </p> </li> <li> <p> Python and NuGet package versions do not contain a corresponding component, package versions of those formats do not have a namespace. </p> </li> <li> <p> The namespace of a generic package is its <code>namespace</code>. </p> </li> </ul>
packagestring required

The name of the package that contains the versions to be copied.

Request body

versionsPackageVersion[]
<p> The versions of the package to be copied. </p> <note> <p> You must specify <code>versions</code> or <code>versionRevisions</code>. You cannot specify both. </p> </note>
versionRevisionsobject
<p> A list of key-value pairs. The keys are package versions and the values are package version revisions. A <code>CopyPackageVersion</code> operation succeeds if the specified versions in the source repository match the specified package version revision. </p> <note> <p> You must specify <code>versions</code> or <code>versionRevisions</code>. You cannot specify both. </p> </note>
allowOverwriteboolean

Set to true to overwrite a package version that already exists in the destination repository. If set to false and the package version already exists in the destination repository, the package version is returned in the <code>failedVersions</code> field of the response with an <code>ALREADY_EXISTS</code> error code.

includeFromUpstreamboolean

Set to true to copy packages from repositories that are upstream from the source repository to the destination repository. The default setting is false. For more information, see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/repos-upstream.html">Working with upstream repositories</a>.

Response

Success

successfulVersionsobject

A list of the package versions that were successfully copied to your repository.

failedVersionsobject
<p> A map of package versions that failed to copy and their error codes. The possible error codes are in the <code>PackageVersionError</code> data type. They are: </p> <ul> <li> <p> <code>ALREADY_EXISTS</code> </p> </li> <li> <p> <code>MISMATCHED_REVISION</code> </p> </li> <li> <p> <code>MISMATCHED_STATUS</code> </p> </li> <li> <p> <code>NOT_ALLOWED</code> </p> </li> <li> <p> <code>NOT_FOUND</code> </p> </li> <li> <p> <code>SKIPPED</code> </p> </li> </ul>