All Products
Search
Document Center

Key Management Service:UpdateSecret

Last Updated:Aug 28, 2026

Updates the metadata of a secret.

Operation description

This example updates the metadata of the secret001 secret by setting Description to datainfo.

For the access policy that a RAM user or RAM role needs to call this operation, see Resource Access Management.

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.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

SecretName

string

Yes

The name of the secret.

secret001

Description

string

No

The description of the secret.

datainfo

ExtendedConfig.CustomData

object

No

The custom data in the extended configuration of the secret.

Note
  • If you specify this parameter, the existing extended configuration of the secret is updated.

  • This parameter is unavailable for generic secrets.

{"DBName":"app1","Port":"3306"}

For more information about common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

SecretName

string

The name of the secret.

secret001

RequestId

string

The request ID.

5b75d8b1-5b6a-4ec0-8e0c-c08befdfad47

Examples

Success response

JSON format

{
  "SecretName": "secret001",
  "RequestId": "5b75d8b1-5b6a-4ec0-8e0c-c08befdfad47"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter some of the specified parameters "\" is not valid
500 InternalFailure Internal Failure
403 Forbidden.NoPermission This operation is forbidden by permission system
404 Forbidden.ResourceNotFound Resource not found
409 Rejected.ResourceExist The request was rejected becasue key already exsit
409 Rejected.ResourceInDeleteWindow secret in delete peroid

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.