Restore Archived Packages API

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

Description: This API is called to restore the archived packages. For information on how to restore archived packages via the UI, see Restore Archived Packages.Restore Archived Packages

Security: Requires a platform admin. A project admin with permission can restore on the project level.

Usage: POST /artifactory/api/archive/v2/restore/packages

Produces: application/json

Sample Request:

POST http://{host:port}/artifactory/api/archive/v2/restore/packages?projectKey=myProject
{
    "restoreToOriginal": true,
    "fallbackDestinationPath": "npm-local",
    "newDestinationPath": "",
    "manifestPaths": ["npm-local/npm-1.0.json"]
}

Query and Request Parameters

Field

Type

Description

projectKey

string

This key is obtained from the Project Settings screen. This parameter is used only for project-level restore, it is not used for global-level policies.

This parameter is not mandatory. It takes the default value.

restoreToOriginal

boolean

A true value means the package will be restored to the original repository where the items were located before archiving. A false value means the package will be restored to the new destination path.

This parameter is mandatory if newDestinationPath is not set.

fallbackDestinationPath

string

If restoreToOriginal is set as true and the original location does not exist anymore, restore to this fallback location. fallbackDestinationPath must contain at least the repository key.

Note:

  • Ensure that the fallback destination path exists.

  • We recommend assigning a fallback destination path that is the same package type as the restored package.

newDestinationPath

string

Restore the packages to the new destination path other than where the items were located before archiving.

This parameter is mandatory if restoreToOriginal is not set.

manifestPaths

array

A manifest file path that contains metadata or a list of items that need to be restored.

Sample Response

200 Created
Content-Type: application/json
{
  "runSummaryId": 1, // Integer
  "responseMessage": "Restore process was initialized successfully." // String
}

Response Error Codes

Code

Description

200

The request was successful and the response body contains the runSummaryId.

400

Validation errors.

401

Bad Credentials.

403

Unauthorized.

500

Internal server error.