docs-v2/content/shared/influxdb3-cli/create/token.md

1.3 KiB

The influxdb3 create token command creates a new authentication token.

Usage

influxdb3 create token <SUBCOMMAND>

Commands

Command Description
--admin Create an admin token for the {{< product-name >}} server.
{{% show-in "enterprise" %}} --permission Create a resource token with fine-grained access permissions.

Options

Option Description
--admin Create an admin token
-h --help Print help information

Examples

Create an admin token

influxdb3 create token --admin

This returns a token string. You can use it to authenticate future requests by setting it with --token or the INFLUXDB3_AUTH_TOKEN environment variable.

Use the token to create a database

influxdb3 create database \
  --token YOUR_ADMIN_TOKEN \
  my_new_database

[!Tip] Set the token as an environment variable to simplify repeated commands:

export INFLUXDB3_AUTH_TOKEN=YOUR_ADMIN_TOKEN