influxdb3 create token --admin

Create a named administrator token.

Operator tokens in InfluxDB 3 Cloud

InfluxData manages the operator token for your InfluxDB 3 Cloud instance. The operator token never expires and cannot be edited or deleted.

Usage

influxdb3 create token --admin [OPTIONS]

Options

OptionDescription
--nameName of the token
--expiryExpires in duration–for example, 10d for 10 days or 1y for 1 year
--hostThe host URL of the running InfluxDB 3 server [env: INFLUXDB3_HOST_URL=] [default: http://127.0.0.1:8181]
--tokenAn existing administrator token for the InfluxDB 3 server
--tls-caAn optional arg to use a custom CA for useful for testing with self-signed certs
--formatOutput format for token [possible values: json, text]
-h, --helpPrint help information
--help-allPrint more detailed help information

Examples

Create a named administrator token

Use an existing administrator token to create a named administrator token.

influxdb3 create token \
  --admin \
  --token 
ADMIN_TOKEN
\
--name
TOKEN_NAME
\
--expiry
DURATION

Replace the following:

  • ADMIN_TOKEN: Your InfluxDB administrator token
  • TOKEN_NAME: Name for your new administrator token
  • DURATION: Duration for the token to remain valid, in humantime format (for example, 10d for 10 days or 1y for 1 year).

Use the token to create a database

influxdb3 create database \
  --token 
ADMIN_TOKEN
\
DATABASE_NAME

Replace the following:

  • ADMIN_TOKEN: Your InfluxDB administrator token
  • DATABASE_NAME: Name for your new database

Use CLI environment variables

Set the token as an environment variable to simplify repeated CLI commands:

export INFLUXDB3_AUTH_TOKEN=ADMIN_TOKEN

Was this page helpful?

Thank you for your feedback!