content/influxdb/v2/admin/secrets/update.md
Update secrets using the influx command line interface (CLI) or the InfluxDB API.
Use the influx secret update command
to update a secret in your organization.
Provide the secret key to update with the -k or --key flag.
You may also provide the secret value with the -v or --value flag.
If you do not provide the secret value with the -v or --value flag,
enter the value when prompted.
{{% warn %}}
Providing a secret value with the -v or --value flag may expose the secret
in your command history.
{{% /warn %}}
# Syntax
influx secret update -k <secret-key>
# Example
influx secret update -k foo
Use the PATCH request method and the InfluxDB /orgs/{orgID}/secrets API endpoint
to update a secret in your organization.
Include the following:
Authorization headercurl --request PATCH http://localhost:8086/api/v2/orgs/<org-id>/secrets \
--header 'Authorization: Token YOURAUTHTOKEN' \
--header 'Content-type: application/json' \
--data '{
"<secret-key>": "<secret-value>"
}'