# Update secret

The Update secret action node saves a new value in a [secret](https://docs.appfarm.io/reference/security/secrets). It is only available for [services](https://docs.appfarm.io/reference/services).

## Usage

This action node is used to update a secret via a service. A common use case includes refreshing access tokens which are used for authorization in web requests to external APIs.

For a secret to be updated from a service it must be:

* Environment specific.
* Not locked.

In addition, the [user](https://docs.appfarm.io/reference/security/users) or [service account](https://docs.appfarm.io/reference/security/service-accounts) that runs the service containing this action node must have a role that has been granted the [permission](https://docs.appfarm.io/reference/security/permissions) **Update Secret from Service** > `SECRET_NAME`.

### Example

For a walkthrough of creating a service to update a secret, see [How to update an OAuth 2.0 access token from a service](https://docs.appfarm.io/how-to/workflow-automation/update-an-oauth-2.0-access-token-from-a-service).

## Properties

<table><thead><tr><th width="196">Property</th><th>Description</th></tr></thead><tbody><tr><td><strong>Secret</strong></td><td>Select a secret to update. The secret must be environment specific and not locked. The user or service account triggering the service must have permission to update this secret.</td></tr><tr><td><strong>Value</strong></td><td>Bind a value to set. The value will be set for the environment that the service is run in.</td></tr></tbody></table>
