Updated on 2026-09-11 GMT+08:00

Creating a Skill Package

Function

This API is used to upload a new version skill package for an enterprise-developed skill.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    workspace:skillPackage:create

    Write

    -

    -

    -

    -

URI

POST /v3/ai-agents/skills/{skill_id}/packages

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

skill_id

Yes

String

Skill ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Language

No

String

Language, which is used for internationalization.

  • en-us: English.

  • zh-cn: Chinese.

X-Client-Token

No

String

Idempotency key, in UUID format.

Creation APIs carry this request header, and the server implements idempotence control based on this header. The response header returns the same value.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

version

Yes

String

Version.

package_name

Yes

String

Name of the skill package file (the same as the value of packageName in getUploadUrls). The server constructs the OBS path based on the value.

package_hash

Yes

String

SHA-256 hash value of the skill package (calculated before the frontend uploads the package).

package_size

Yes

Long

Size of the skill package, in bytes.

regions

Yes

Array of PackageRegionWithStatusInfo objects

Region information (including the upload status).

remark

No

String

Remarks.

Table 4 PackageRegionWithStatusInfo

Parameter

Mandatory

Type

Description

region

Yes

String

Region ID (for example, cn-north-7).

upload_status

Yes

String

Upload status.

Response Parameters

Status code: 201

Table 5 Response header parameters

Parameter

Type

Description

X-Request-Id

String

-

Table 6 Response body parameters

Parameter

Type

Description

id

String

Skill package ID.

skill_id

String

Skill ID.

version

String

Version.

revision

Integer

Version revision number.

package_hash

String

SHA-256 hash value of the skill package.

package_size

Long

Size of the skill package, in bytes.

package_status

String

Skill package status.

uploaded_by

String

Uploader.

uploaded_role

String

Role of the uploader.

regions

Array of SkillPackageRegionItem objects

Region details list.

remark

String

Remarks.

create_time

String

Creation time (UTC time in ISO 8601 format).

update_time

String

Update time (UTC time in ISO 8601 format).

Table 7 SkillPackageRegionItem

Parameter

Type

Description

region

String

Region ID.

obs_bucket

String

OBS bucket name.

obs_object_key

String

OBS object key.

upload_status

String

Upload status.

Status code: 400

Table 8 Response header parameters

Parameter

Type

Description

X-Request-Id

String

-

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 401

Table 10 Response header parameters

Parameter

Type

Description

X-Request-Id

String

-

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 403

Table 12 Response header parameters

Parameter

Type

Description

X-Request-Id

String

-

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 404

Table 14 Response header parameters

Parameter

Type

Description

X-Request-Id

String

-

Table 15 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Status code: 500

Table 16 Response header parameters

Parameter

Type

Description

X-Request-Id

String

-

Table 17 Response body parameters

Parameter

Type

Description

error_code

String

Error code, which is returned upon failure.

error_msg

String

Error message.

Example Requests

/v3/ai-agents/skills/skill-uuid-002/packages

{
  "version" : "2.0.0",
  "package_name" : "internal-doc-helper-2.0.0.zip",
  "package_hash" : "sha256-def456...",
  "package_size" : 62914560,
  "regions" : [ {
    "region" : "cn-north-7",
    "upload_status" : "UPLOADED"
  } ],
  "remark" : "New version upload"
}

Example Responses

Status code: 201

{
  "id" : "pkg-uuid-011",
  "skill_id" : "skill-uuid-002",
  "version" : "2.0.0",
  "revision" : 1,
  "package_hash" : "sha256-def456...",
  "package_size" : 62914560,
  "package_status" : "PUBLISHED",
  "uploaded_by" : "tenant-user",
  "uploaded_role" : "TENANT_ADMIN",
  "regions" : [ {
    "region" : "cn-north-7",
    "obs_bucket" : "wks-skills-cn-north-7",
    "obs_object_key" : "skills/internal-doc-helper/2.0.0/internal-doc-helper-2.0.0.zip",
    "upload_status" : "UPLOADED"
  } ],
  "remark" : "New version upload",
  "create_time" : "2026-06-01T10:00:00Z",
  "update_time" : "2026-06-01T10:00:00Z"
}

Status Codes

Status Code

Description

201

Created

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Internal Server Error

Error Codes

See Error Codes.