Documentation

influx auth create

The influx auth create command creates an API token in InfluxDB.

Issue resolved: Using influx CLI 2.4 prevented you from creating an all-access or operator token using the influx auth create command. This issue is resolved in the influx 2.5 CLI release. Please upgrade to the latest version of the influx cli.

Usage

influx auth create [flags]

Flags

FlagDescriptionInput typeMaps to ?
-c--active-configCLI configuration to use for commandstring
--all-accessGrants all permissions in a single organization
--configs-pathPath to influx CLI configurations (default ~/.influxdbv2/configs)stringINFLUX_CONFIGS_PATH
-d--descriptionAPI token descriptionstring
-h--helpHelp for the create command
--hide-headersHide table headers (default false)INFLUX_HIDE_HEADERS
--hostHTTP address of InfluxDB (default http://localhost:8086)stringINFLUX_HOST
--http-debugInspect communication with InfluxDB serversstring
--jsonOutput data as JSON (default false)INFLUX_OUTPUT_JSON
--operator(InfluxDB OSS only) Grants all permissions in all organizationsstring
-o--orgOrganization name (mutually exclusive with --org-id)stringINFLUX_ORG
--org-idOrganization ID (mutually exclusive with --org)stringINFLUX_ORG_ID
--read-bucketGrant permission to read a specified bucket IDstringArray
--read-bucketsGrant permission to read all organization buckets
--read-checksGrant permission to read checks
--read-dashboardsGrant permission to read dashboards
--read-dbrpsGrant permission to read database retention policy mappings
--read-notificationEndpointsGrant permission to read notificationEndpoints
--read-notificationRulesGrant permission to read notificationRules
--read-orgsGrant permission to read organizations
--read-remotesGrant permission to read remote configurations
--read-replicationsGrant permission to read replication configurations
--read-tasksGrant permission to read tasks
--read-telegrafsGrant permission to read Telegraf configurations
--read-usersGrant permission to read organization users
--skip-verifySkip TLS certificate verificationINFLUX_SKIP_VERIFY
-t--tokenAPI tokenstringINFLUX_TOKEN
-u--userUsernamestring
--write-annotationsGrant permission to create annotations
--write-bucketGrant permission to write to specified a bucket IDstringArray
--write-bucketsGrant permission to create and update all organization buckets
--write-checksGrant permission to create checks
--write-dashboardsGrant permission to create and update dashboards
--write-dbrpsGrant permission to create database retention policy mappings
--write-notificationEndpointsGrant permission to create notificationEndpoints
--write-notificationRulesGrant permission to create notificationRules
--write-orgsGrant permission to create and update organizations
--write-remotesGrant permission to create and update remote configurations
--write-replicationsGrant permission to create and update replication configurations
--write-tasksGrant permission to create and update tasks
--write-telegrafsGrant permission to create and update Telegraf configurations
--write-usersGrant permission to create and update organization users
--write-variablesGrant permission to create and update variables

Examples

Authentication credentials

The examples below assume your InfluxDB host, organization, and token are provided by either the active influx CLI configuration or by environment variables (INFLUX_HOST, INFLUX_ORG, and INFLUX_TOKEN). If you do not have a CLI configuration set up or the environment variables set, include these required credentials for each command with the following flags:

  • --host: InfluxDB host
  • -o, --org or --org-id: InfluxDB organization name or ID
  • -t, --token: InfluxDB API token

Create an All Access API token

Create an All Access token to grant permissions to all resources in an organization.

influx auth create \
  --all-access 

Create an API token with specified read and write permissions

influx auth create \
  --read-buckets \
  --read-checks \
  --read-dashboards \
  --read-dbrps \
  --read-notificationEndpoints \
  --read-notificationRules \
  --read-orgs \
  --read-remotes \
  --read-replications \
  --read-tasks \
  --read-telegrafs \
  --read-users \
  --write-annotations \
  --write-buckets \
  --write-checks \
  --write-dashboards \
  --write-dbrps \
  --write-notificationEndpoints \
  --write-notificationRules \
  --write-orgs \
  --write-remotes \
  --write-replications \
  --write-tasks \
  --write-telegrafs \
  --write-users \
  --write-variables

Create an API token with read and write access to specific buckets

influx auth create \
  --read-bucket 0000000000000001 \
  --read-bucket 0000000000000002 \
  --write-bucket 0000000000000001 \
  --write-bucket 0000000000000002

Create a read-only API token

influx auth create \
  --read-buckets \
  --read-checks \
  --read-dashboards \
  --read-dbrps \
  --read-notificationEndpoints \
  --read-notificationRules \
  --read-orgs \
  --read-remotes \
  --read-replications \
  --read-tasks \
  --read-telegrafs \
  --read-users

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

InfluxDB v3 enhancements and InfluxDB Clustered is now generally available

New capabilities, including faster query performance and management tooling advance the InfluxDB v3 product line. InfluxDB Clustered is now generally available.

InfluxDB v3 performance and features

The InfluxDB v3 product line has seen significant enhancements in query performance and has made new management tooling available. These enhancements include an operational dashboard to monitor the health of your InfluxDB cluster, single sign-on (SSO) support in InfluxDB Cloud Dedicated, and new management APIs for tokens and databases.

Learn about the new v3 enhancements


InfluxDB Clustered general availability

InfluxDB Clustered is now generally available and gives you the power of InfluxDB v3 in your self-managed stack.

Talk to us about InfluxDB Clustered

InfluxDB Cloud powered by TSM