DeleteArtifact - Delete a single artifact

Updated at:

Deletes a single artifact via the OpenAPI.

Applicable editions

Central edition, Region edition

Endpoint and authorization information

  • Get the endpoint: Replace {domain} in the API request syntax.

  • Get a personal access token.

  • Get organizationId: Required for Central edition only. Go to the Basic Information page in the Organization Management console to obtain your organization ID.

Product

Resource

Required permission

Artifact repository

Artifact

Read and write

Request syntax

Central edition

DELETE https://{domain}/oapi/v1/packages/organizations/{organizationId}/repositories/{repoId}/artifacts/{id}

Region edition

DELETE https://{domain}/oapi/v1/packages/repositories/{repoId}/artifacts/{id}

Request headers

Parameter

Type

Required

Description

Example value

x-yunxiao-token

string

Yes

Personal access token.

pt-0fh3****0fbG_35af****0484

Request parameters

Parameter

Type

Location

Required

Description

Example value

organizationId

string

path

  • Yes: Central edition

  • No: Region edition

Organization ID.

xxxxxxxx

repoId

string

path

Yes

Repository ID.

my-repo

id

integer

path

Yes

Artifact ID. Call the ListArtifacts operation to query artifact IDs.

123456

repoType

string

query

Yes

Repository type. Valid values: GENERIC, DOCKER, MAVEN, NPM, NUGET, PYPI.

MAVEN

Request examples

Central edition

curl -X 'DELETE' \
  'https://{domain}/oapi/v1/packages/organizations/xxxxxxxx/repositories/my-repo/artifacts/123456?repoType=MAVEN' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Region edition

curl -X 'DELETE' \
  'https://{domain}/oapi/v1/packages/repositories/my-repo/artifacts/123456?repoType=MAVEN' \
  -H 'Content-Type: application/json' \
  -H 'x-yunxiao-token: pt-0fh3****0fbG_35af****0484'

Response parameters

Parameter

Type

Description

Example value

-

object

Batch task.

action

string

Action. REPO_DEL: delete repository, REPO_RES: restore repository, MODULE_DEL: delete artifact, MODULE_RES: restore artifact.

MODULE_DEL

data

string

The target object of the operation.

module id

description

string

Task description.

Delete artifacts such as abc

gmtCreate

integer

Task creation time.

1728557118000

id

integer

Task ID.

123456

repoId

string

Repository ID.

flow_generic_repo

repoType

string

Repository type.

GENERIC

status

string

Task status. INIT: initializing, RUNNING: running, SUCCESS: succeeded, FAILED: failed.

RUNNING

Response example

{
    "action": "MODULE_DEL",
    "data": "module id",
    "description": "Delete artifacts such as abc",
    "gmtCreate": 1728557118000,
    "id": 123456,
    "repoId": "flow_generic_repo",
    "repoType": "GENERIC",
    "status": "RUNNING"
}

Error codes

See Error Code Center for API-related error codes.