updateSecret( )


Updates the specified fields of an existing secret by ID.

The updateSecret() function returns a Promise that resolves when the secret is successfully updated. You can update one or more fields. Only fields passed in the secret object will be updated. All other properties will remain unchanged.

You can retrieve the _id parameter from the listSecretInfo() function. The secret _id is different from the secret name used by the getSecretValue() function.

Notes:

  • Changing a secret's name or value will break all code using the secret.
  • You can't rename the secret with a name of an existing secret.
  • Don't leave private keys in your code! Leaving them in is a security risk. Make sure to delete the keys from the code after running updateSecret().
Authentication

This function requires elevated permissions and runs only on the backend and on dashboard pages.

Permissions
Manage Secrets
Learn more about app permissions.
Method Declaration
Copy
Method Parameters
_idstringRequired

ID of the secret to update.


secretSecretRequired

Details of a secret.

Was this helpful?
Yes
No