All Products
Search
Document Center

Key Management Service:UpdateSecret

Last Updated:Jul 29, 2025

Updates the metadata of a secret.

Operation description

In this example, the metadata of the secret001 secret is updated. The Description parameter is set to datainfo.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
SecretNamestringYes

The name of the secret.

secret001
DescriptionstringNo

The description of the secret.

datainfo
ExtendedConfig.CustomDataobjectNo

The custom data in the extended configuration of the secret.

Note
  • If this parameter is specified, 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 parameters

    ParameterTypeDescriptionExample
    object
    SecretNamestring

    The name of the secret.

    secret001
    RequestIdstring

    The ID of the request, which is used to locate and troubleshoot issues.

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

    Examples

    Sample success responses

    JSONformat

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

    Error codes

    HTTP status codeError codeError message
    400InvalidParametersome of the specified parameters "\" is not valid
    403Forbidden.NoPermissionThis operation is forbidden by permission system
    404Forbidden.ResourceNotFoundResource not found
    409Rejected.ResourceExistThe request was rejected becasue key already exsit
    409Rejected.ResourceInDeleteWindowsecret in delete peroid
    500InternalFailureInternal Failure

    For a list of error codes, visit the Service error codes.