UpdateSkill

Updated at:
Copy as MD

Updates a skill.

Operation description

  • Update rules:
    • Name is used only to locate the skill and cannot be modified.

    • The caller must be the creator of the skill or the root account of the tenant that has permissions to manage the tenant-level skill.

  • Replacement rules:
    • If Description and Visibility are omitted, their original values are retained. Passing null is treated as omission and cannot be used to clear the original values.

    • Metadata is replaced as a whole, not merged incrementally. If Metadata is omitted, the original content is retained. If it is passed, old fields not included in the new object are deleted.

    • When modifying only Description or Visibility, do not pass Metadata or an empty object {}. An empty object replaces the original metadata with an empty object.

  • Content sources:
    • When replacing the body or bundle, you must choose one and only one of skillMd, transitId, or bundleUrl.

    • For the field formats of the three sources, the Transit upload confirmation process, and the bundleUrl restrictions, refer to CreateSkill. Pass the selected source in UpdateSkill.Metadata.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ada:UpdateSkill

update

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Name

string

Yes

The name of the skill to be updated. This parameter is used only to locate the skill and cannot be used to modify the name.

code-review

ExpectedVersion

integer

No

The expected version number.

2

Description

string

No

The updated description of the skill.

A skill used to perform code review, security checks, and risk alerts

Metadata

any

No

The updated metadata of the skill. The JSON object is replaced as a whole. The content supports one of the following: Transit ID, bundleUrl, or skillMd.

{"transitId":"transit_example456"}

Visibility

string

No

The updated visibility. Valid values: user and tenant.

tenant

Metadata definition

NameTypeDescriptionExample
skillMdstringThe Markdown body. For the format and restrictions, refer to CreateSkill.# Code Review\nCheck code quality, security risks, and coding standards.
transitIdstringThe uploaded and confirmed Transit ID. For the upload process, refer to CreateSkill.transit_example456
bundleUrlstringThe one-time public HTTPS ZIP direct link. For security restrictions, refer to CreateSkill.https://example.com/code-review-v2.zip

Request example

{
  "Name": "code-review",
  "Description": "A skill used to perform code review, security checks, and risk alerts",
  "Metadata": {
    "transitId": "transit_example456"
  },
  "Visibility": "tenant"
}

The preceding example uses Transit. When updating the URL or body, replace Metadata with one of the following objects:

{"bundleUrl": "https://example.com/code-review-v2.zip"}
{"skillMd": "# Code Review\nCheck code quality, security risks, and coding standards."}

Response elements

Element

Type

Description

Example

object

SkillId

string

The skill ID.

skill_example123

Name

string

The name of the skill.

code-review

UpdatedAt

integer

The time when the skill was updated. The value is a UNIX timestamp in milliseconds.

1760000200000

Success

boolean

Indicates whether the operation is successful. A value of true is returned when the skill update and optional bundle replacement are fully submitted and confirmed by read-back.

true

RequestId

string

The request ID.

0A1B2C3D-4E5F-6789-ABCD-EF0123456789

Success response example

{
  "SkillId": "skill_example123",
  "Name": "code-review",
  "UpdatedAt": 1760000200000,
  "Success": true,
  "RequestId": "0A1B2C3D-4E5F-6789-ABCD-EF0123456789"
}

Examples

Success response

JSON format

{
  "SkillId": "skill_example123",
  "Name": "code-review",
  "UpdatedAt": 1760000200000,
  "Success": true,
  "RequestId": "0A1B2C3D-4E5F-6789-ABCD-EF0123456789"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter The specified parameter is invalid.
400 Skill.BundleUrlRejected The skill bundle URL was rejected.
400 Skill.BundleInvalid The specified skill bundle is invalid.
401 Unauthenticated Authentication required.
500 InternalError Internal server error.
413 Skill.BundleTooLarge The skill bundle exceeds the allowed size.
403 Skill.Forbidden You are not authorized to operate this skill.
404 Skill.ResourceNotFound The specified skill was not found.
404 Skill.BundleSourceNotFound The specified skill bundle source was not found.
503 ServiceUnavailable The service is not ready or temporarily unavailable.
504 ServiceTimeout A required service timed out.
504 Skill.BundleDownloadTimeout Downloading the skill bundle timed out.
504 Skill.OperationResultUnknown The result of the skill operation is unknown.
409 Skill.VersionConflict The skill has a version conflict. Refresh it and retry.
409 Skill.InvalidState The skill is not in a state that allows this operation.
409 Skill.BundleQuotaExceeded The skill bundle storage quota would be exceeded.

See Error CodesError Codes for a complete list.

Release notes

See Release NotesRelease Notes for a complete list.