Documentation

Regenerate an admin token

Use the influxdb3 CLI or the HTTP API to regenerate the operator (_admin) token for your InfluxDB 3 Core instance. Regenerate a token to rotate it as part of your security practices or if you suspect the token has been compromised.

Regenerating the operator token deactivates the previous token, stores the SHA512 hash and metadata of the new token, and returns the new token string.

Prerequisite

To regenerate an operator token, you need the current token string.

Use the CLI or HTTP API to regenerate the operator token

Regenerating the operator token

Regenerating the operator token invalidates the previous token. Make sure to update any applications or scripts that use the operator token.

To regenerate the operator token, use the [influxdb3 serve create token command] with the --admin and --regenerate flags:

Use the --regenerate flag with the influxdb3 create token --admin subcommand–for example:

influxdb3 create token --admin \
  --regenerate
  
OPERATOR_TOKEN
  • Copy
  • Fill window

In your command, replace OPERATOR_TOKEN with the current operator (_admin) token string.

The output contains the new token string and InfluxDB deactivates the previous token string.

Use the following HTTP API endpoint:

In your request, send an Authorization header with your current operator token string –for example:

curl -X POST "http://localhost:8181/api/v3/configure/token/admin/regenerate" \
  --header "Authorization: Bearer 
OPERATOR_TOKEN
"
\
--header "Accept: application/json"
  • Copy
  • Fill window

In your command, replace OPERATOR_TOKEN with the current token string.

The response body contains the new operator token string in plain text, and InfluxDB deactivates the previous token string.

To use the token as the default for later commands, and to persist the token across sessions, assign the token string to the INFLUXDB3_AUTH_TOKEN environment variable.

Important considerations

  • Regenerating the operator token invalidates the previous token.
  • If you lose the operator token, there is no recovery mechanism.
  • --regenerate only works for the operator token. You can’t use the --regenerate flag with the influxdb3 create token --admin command to regenerate a named admin token.
  • Ensure that you update any applications or scripts that use the operator token with the new token string.
  • Always store your operator token securely and consider implementing proper secret management practices.

Was this page helpful?

Thank you for your feedback!


The future of Flux

Flux is going into maintenance mode. You can continue using it as you currently are without any changes to your code.

Read more

Now Generally Available

InfluxDB 3 Core and Enterprise

Start fast. Scale faster.

Get the Updates

InfluxDB 3 Core is an open source, high-speed, recent-data engine that collects and processes data in real-time and persists it to local disk or object storage. InfluxDB 3 Enterprise builds on Core’s foundation, adding high availability, read replicas, enhanced security, and data compaction for faster queries and optimized storage. A free tier of InfluxDB 3 Enterprise is available for non-commercial at-home or hobbyist use.

For more information, check out: