Help Center/ CodeArts Artifact/ API Reference/ API/ Recycle Bin/ Restoring Multiple Packages in the Recycle Bin
Updated on 2025-12-05 GMT+08:00

Restoring Multiple Packages in the Recycle Bin

Function

This API is used to restore multiple packages in the recycle bin.

Calling Method

For details, see Calling APIs.

URI

PUT /cloudartifact/v5/trashes

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

[items]

Yes

Array of IDETrashArtifactModel objects

Recycle bin information.

Table 2 IDETrashArtifactModel

Parameter

Mandatory

Type

Description

id

Yes

String

Definition

Repository ID. The format is {region}{domainId}{format}_{sequence}. You can find the repository ID on the general page of your self-hosted repos. It is the string located between the last two slashes (/) in the repository URL.

Constraints

The region and domainId in the repository ID must be valid values. The valid values of format are npm, go, pypi, rpm, composer, maven, debian, conan, nuget, docker2, cocoapods, and ohpm. The upper limit of sequence varies depending on the package.

Range

N/A.

Default value

None

format

Yes

String

Definition

Package type.

Constraints

N/A.

Range

maven2, docker, npm, go, pypi, rpm, composer, debian, conan, nuget, docker2, cocoapods, ohpm, and generic.

Default value

None

status

Yes

String

Definition

Current repository status.

Constraints

N/A.

Range

active: Normal.

trash: Deprecated.

delete: Deleted.

Default value

None

uri

Yes

String

Definition

Repository path to be restored.

Constraints

N/A.

Range

N/A.

Default value

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

status

String

Definition

Request status.

Range

success: The request is successful.

error: The request fails.

trace_id

String

Definition

Request ID, which uniquely identifies the current request.

Range

A string of digits and hyphens (-).

result

TrashcanResultData object

Definition

Batch operation result.

Range

N/A.

Table 4 TrashcanResultData

Parameter

Type

Description

successNum

Integer

Definition

Number of successful items.

Range

N/A.

failedNum

Integer

Definition

Number of failed items.

Range

N/A.

failedMessages

Array of strings

Definition

The failure cause.

Range

N/A.

Example Requests

This API is used to restore multiple packages in the recycle bin.

/v5/trashes

[ {
  "id" : "xx-xxxxx-x_5a775fdcb14f4431b6c0015618140bc3_go_4",
  "format" : "go",
  "uri" : "xx-xxxxx-x_5a775fdcb14f4431b6c0015618140bc3_go_4/",
  "status" : "active"
}, {
  "id" : "xx-xxxxx-x_5a775fdcb14f4431b6c0015618140bc3_maven_2_23",
  "format" : "maven2",
  "uri" : "xx-xxxxx-x_5a775fdcb14f4431b6c0015618140bc3_maven_2_23/",
  "status" : "active"
} ]

Example Responses

Status code: 200

OK

{
  "status" : "success",
  "trace_id" : "143002-1701173929284-59",
  "result" : null
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.