Npm - Update Packages

Update several packages from a single feed in a single request. The updates to the packages do not happen atomically.

The project parameter must be supplied if the feed was created in a project. If the feed is not associated with any project, omit the project parameter from the request.

POST https://pkgs.dev.azure.com/{organization}/{project}/_apis/packaging/feeds/{feedId}/npm/packagesbatch?api-version=7.1-preview.1

URI Parameters

Name In Required Type Description
feedId
path True

string

Name or ID of the feed.

organization
path True

string

The name of the Azure DevOps organization.

project
path

string

Project ID or project name

api-version
query True

string

Version of the API to use. This should be set to '7.1-preview.1' to use this version of the api.

Request Body

Name Type Description
data

BatchOperationData

Data required to perform the operation. This is optional based on type of operation. Use BatchPromoteData if performing a promote operation.

operation

NpmBatchOperationType

Type of operation that needs to be performed on packages.

packages

MinimalPackageDetails[]

The packages onto which the operation will be performed.

Responses

Name Type Description
200 OK

successful operation

Security

oauth2

Type: oauth2
Flow: accessCode
Authorization URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL: https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer

Scopes

Name Description
vso.packaging_write Grants the ability to create and read feeds and packages.

Definitions

Name Description
BatchOperationData

Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data.

MinimalPackageDetails

Minimal package details required to identify a package within a protocol.

NpmBatchOperationType

Type of operation that needs to be performed on packages.

NpmPackagesBatchRequest

A batch of operations to apply to package versions.

BatchOperationData

Do not attempt to use this type to create a new BatchOperationData. This type does not contain sufficient fields to create a new batch operation data.

MinimalPackageDetails

Minimal package details required to identify a package within a protocol.

Name Type Description
id

string

Package name.

version

string

Package version.

NpmBatchOperationType

Type of operation that needs to be performed on packages.

Name Type Description
delete

string

Delete package versions (equivalent to Unpublish). Not supported in the Recycle Bin.

deprecate

string

Deprecate or undeprecate package versions. Not supported in the Recycle Bin.

permanentDelete

string

Permanently delete package versions. Only supported in the Recycle Bin.

promote

string

Promote package versions to a release view. If constructing a NpmPackagesBatchRequest object with this type, use BatchPromoteData for its Data property. Not supported in the Recycle Bin.

restoreToFeed

string

Restore unpublished package versions to the feed. Only supported in the Recycle Bin.

unpublish

string

Unpublish package versions. Npm-specific alias for the Delete operation. Not supported in the Recycle Bin.

NpmPackagesBatchRequest

A batch of operations to apply to package versions.

Name Type Description
data

BatchOperationData

Data required to perform the operation. This is optional based on type of operation. Use BatchPromoteData if performing a promote operation.

operation

NpmBatchOperationType

Type of operation that needs to be performed on packages.

packages

MinimalPackageDetails[]

The packages onto which the operation will be performed.