> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt # Method name: updateSecret(id: string, secret: SecretUpdateInfo) # Method package: wixSecretsBackend # Method menu location: wixSecretsBackend --> updateSecret # Method Link: https://dev.wix.com/docs/velo/apis/wix-secrets-backend/update-secret.md # Method Description: > **Deprecation Warning** > > This method will be deprecated on September 7, 2025. > > Replace with [Update Secret](https://dev.wix.com/docs/velo/apis/wix-secrets-backend-v2/secrets/update-secret.md). 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 secret properties. Only the properties passed in the Secret object will be updated. All other properties will remain the same. You can retrieve the `id` parameter from the [`listSecretInfo()`](#listSecretInfo) function. The `id` is not the same as the secret `name` used by the [`getSecret()`](#getSecret) function. > **Notes:** > + Changing a secret's name or value will break all code using the secret. > > + You cannot rename the secret with a name that is already in use. > + Do not leave private keys in your code! Leaving them in is a security risk. Either delete the keys from the code after running `updateSecret()`, or pass the parameters in using the [Functional Testing](https://support.wix.com/en/article/velo-functional-testing-in-the-backend) tool. # Method Code Examples: *** Note: do not assume any prop names or enum values other than the ones in the example. ## Update a single property of a secret ```javascript import { Permissions, webMethod } from 'wix-web-module'; import wixSecretsBackend from 'wix-secrets-backend'; export const updateName = webMethod(Permissions.Anyone, () => { const id = "b741766c-eead-46fe-8e7f-fd01ff3d6e21"; const secret = { name: "my_new_secret_name" }; return wixSecretsBackend.updateSecret(id, secret) .then(() => { console.log("Secret name updated"); }) .catch((error) => { console.error(error); }) }); ``` ## Update multiple properties of a secret ```javascript import { Permissions, webMethod } from 'wix-web-module'; import wixSecretsBackend from 'wix-secrets-backend'; export const updateMultipleProperties = webMethod(Permissions.Anyone, () => { const id = "b741766c-eead-46fe-8e7f-fd01ff3d6e21"; const secret = { name: "my_new_secret_name", description: "New description", value: "new.key.44aSQCljxL9FLvTVA.9dKbpwueYoQ8isyQhvun19pOT9gHEdgxam39LJ0Ts70" }; return wixSecretsBackend.updateSecret(id, secret) .then(() => { console.log("All secret fields updated"); }) .catch((error) => { console.error(error); }); }); ``` ---