Update Secret Value

Prev Next

Available in VPC

Edit the secret value of the all secret stages. The value of a secret in the REVOKE (deletion requested) can't be changed.

Request

This section describes the request format. The method and URI are as follows:

Method URI
PUT /api/v1/secrets/{secretId}/values

Request headers

For information about the headers common to all Secret Manager APIs, see Secret Manager request headers.

Request path parameters

You can use the following path parameters with your request:

Field Type Required Description
secretId String Required Secret ID

Request body

You can include the following data in the body of your request:

Field Type Required Description
previous String - Previously used secret value (PREVIOUS stage) based on the ACTIVE stage
active String - Active secret value (ACTIVE stage) that are currently in normal use
pending String - Value of secret (PENDING stage) whose rotation has started anew and are waiting for the rotation to complete
Caution

Only the value entered in the request body is edited, and if the secret value of a secret stage is empty, the stage value is deleted. For more information on how to edit the secret value of a specific stage, see Update Secret Stage Value.

Request example

The request example is as follows:

curl --location --request PUT 'https://secretmanager.apigw.ntruss.com/api/v1/secrets/{secretId}/values' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'Content-Type: application/json' \
--data '{
    "previous": "{\"abc\":\"cba\"}",
    "active": "{\"abc\":\"cba\"}",
    "pending": "{\"abc\":\"cba\"}"
}'

Response

This section describes the response format.

Response body

The response body includes the following data:

Field Type Required Description
code String - Response code
data Object - Response result
data.encryptedSecretChain Object - Encrypted secret chain
data.encryptedSecretChain.previous String - Previously used encrypted secret value (PREVIOUS stage) based on ACTIVE stage
data.encryptedSecretChain.active String - Encrypted active secret value (ACTIVE stage) currently in normal use
data.encryptedSecretChain.pending String - Encrypted secret value (PENDING stage) whose rotation has started anew and is waiting for the rotation to complete

Response status codes

For information about the HTTP status codes common to all Secret Manager APIs, see Secret Manager response status codes.

Response example

The response example is as follows:

{
    "code": "SUCCESS",
    "data": {
        "encryptedSecretChain": {
            "previous": "ncpkms:v1:/*****ROoPnOWY7YmmKQFwuBuAaqnU1EdnJl2VORPtW2YBj/Kr1*****",
            "active": "ncpkms:v1:*****iseiMDx/Xs8VPsLviPnVLKKO9qkMHo8l5o7L0q9E/shi1*****=",
            "pending": "ncpkms:v1:*****GGkJ234mjiKOhmyYnUR20MTGl+MB/0u5yXjG1Ti6EZ9Gq*****="
        }
    }
}