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
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Language | No | String | Language, which is used for internationalization. |
| 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. |
| 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
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | - |
| Parameter | Type | Description |
|---|---|---|
| upload_urls | Array of UploadUrlItem objects | Upload URLs. |
| 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
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | - |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 401
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | - |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 403
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | - |
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code, which is returned upon failure. |
| error_msg | String | Error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| X-Request-Id | String | - |
| 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.
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot