InfluxDB Docs

Add secrets

Add secrets using the influx command line interface (CLI) or the InfluxDB API.

Add a secret using the influx CLI

Use the influx secret update command to add a new secret to your organization. Provide the secret key with the -k or --key flag. When prompted, enter and confirm the secret value.

# Syntax
influx secret update -k <secret-key>

# Example
influx secret update -k foo

Add a secret using the InfluxDB API

Use the PATCH request method and the /orgs/{orgID}/secrets API endpoint to add a new secret to your organization.

Include the following:

curl -XPATCH http://localhost:9999/api/v2/orgs/<org-id>/secrets \
  -H 'Authorization: Token YOURAUTHTOKEN' \
  -H 'Content-type: application/json' \
  --data '{
	"<secret-key>": "<secret-value>"
}'