Create a token

Create authentication tokens using the InfluxDB user interface (UI) or the influx command line interface (CLI).

Tokens are visible only to the user who created them and stop working when the user is deactivated. We recommend creating a generic IT user to create and manage tokens for writing data.

Create a token in the InfluxDB UI

  1. In the navigation menu on the left, select Data (Load Data) > Tokens.

    Data

    Load Data

  2. Click Generate and select a token type (Read/Write Token or All Access Token).

  3. In the window that appears, enter a description for your token in the Description field.

  4. If generating a read/write token:

    • Search for and select buckets to read from in the Read pane.
    • Search for and select buckets to write to in the Write pane.
  5. Click Save.

Create a token using the influx CLI

Use the influx auth create command to create a token. Include flags with the command to grant specific permissions to the token. See the available flags.

  1. # Syntax
  2. influx auth create -o <org-name> [permission-flags]
  3. # Example
  4. influx auth create -o my-org \
  5. --read-bucket 03a2bbf46309a000 03ace3a87c269000 \
  6. --read-dashboards \
  7. --read-tasks \
  8. --read-telegrafs \
  9. --read-user

Filtering options such as filtering by authorization ID, username, or user ID are available. See the influx auth list documentation for information about other available flags.