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

Generating an Upload URL

Function

This API is used to generate an OBS pre-signed URL for uploading an enterprise-developed skill package.

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:createUploadUrls

    Write

    -

    -

    -

    • obs:object:putObject
    • obs:bucket:headBucket
    • obs:bucket:createBucket
    • obs:bucket:putBucketCors

URI

POST /v3/ai-agents/skill-packages/upload-urls

Request Parameters

Table 1 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 2 Request body parameters

Parameter

Mandatory

Type

Description

slug

Yes

String

Skill slug (used to construct the OBS path).

version

Yes

String

Version number (used to construct the OBS path).

package_name

Yes

String

Package file name.

regions

Yes

Array of strings

List of target regions.

Response Parameters

Status code: 200

Table 3 Response header parameters

Parameter

Type

Description

X-Request-Id

String

-

Table 4 Response body parameters

Parameter

Type

Description

upload_urls

Array of UploadUrlItem objects

Upload URLs.

Table 5 UploadUrlItem

Parameter

Type

Description

region

String

Region ID.

upload_url

String

OBS pre-signed upload URL.

obs_bucket

String

OBS bucket name.

obs_object_key

String

OBS object key.

Status code: 400

Table 6 Response header parameters

Parameter

Type

Description

X-Request-Id

String

-

Table 7 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 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: 403

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: 500

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.

Example Requests

/v3/ai-agents/skill-packages/upload-urls

{
  "slug" : "internal-doc-helper",
  "version" : "1.0.0",
  "package_name" : "internal-doc-helper.tar.gz",
  "regions" : [ "cn-north-7", "cn-south-1" ]
}

Example Responses

Status code: 200

{
  "upload_urls" : [ {
    "region" : "cn-north-7",
    "upload_url" : "https://wks-skills-cn-north-7.obs.cn-north-7.myhuaweicloud.com/skills/internal-doc-helper/1.0.0/internal-doc-helper.tar.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20260601T000000Z&X-Amz-Expires=3600&...",
    "obs_bucket" : "wks-skills-cn-north-7",
    "obs_object_key" : "skills/internal-doc-helper/1.0.0/internal-doc-helper.tar.gz"
  }, {
    "region" : "cn-south-1",
    "upload_url" : "https://wks-skills-cn-south-1.obs.cn-south-1.myhuaweicloud.com/skills/internal-doc-helper/1.0.0/internal-doc-helper.tar.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20260601T000000Z&X-Amz-Expires=3600&...",
    "obs_bucket" : "wks-skills-cn-south-1",
    "obs_object_key" : "skills/internal-doc-helper/1.0.0/internal-doc-helper.tar.gz"
  } ]
}

Status Codes

Status Code

Description

200

Created

400

Bad Request

401

Unauthorized

403

Forbidden

500

Internal Server Error

Error Codes

See Error Codes.