influx auth create

  • influx CLI 2.0.0+
  • InfluxDB 2.0.0+
  • Updated in CLI v2.2.0

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

Usage

  1. 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-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-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-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

Examples

Authentication credentials

The examples below assume your InfluxDB host, organization, and token are provided by the active influx CLI configuration. If you do not have a CLI configuration set up, use the appropriate flags to provide these required credentials.

Create an All-Access API token

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

  1. influx auth create \
  2. --all-access

Create an Operator API token

Create an Operator token to grant permissions to all resources in all organizations.

  1. influx auth create \
  2. --operator

Create an API token with specified read and write permissions

  1. influx auth create \
  2. --read-buckets \
  3. --read-checks \
  4. --read-dashboards \
  5. --read-dbrps \
  6. --read-notificationEndpoints \
  7. --read-notificationRules \
  8. --read-orgs \
  9. --read-tasks \
  10. --read-telegrafs \
  11. --read-users \
  12. --write-buckets \
  13. --write-checks \
  14. --write-dashboards \
  15. --write-dbrps \
  16. --write-notificationEndpoints \
  17. --write-notificationRules \
  18. --write-orgs \
  19. --write-tasks \
  20. --write-telegrafs \
  21. --write-users

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

  1. influx auth create \
  2. --read-bucket 0000000000000001 \
  3. --read-bucket 0000000000000002 \
  4. --write-bucket 0000000000000001 \
  5. --write-bucket 0000000000000002

Create a read-only API token

  1. influx auth create \
  2. --read-buckets \
  3. --read-checks \
  4. --read-dashboards \
  5. --read-dbrps \
  6. --read-notificationEndpoints \
  7. --read-notificationRules \
  8. --read-orgs \
  9. --read-tasks \
  10. --read-telegrafs \
  11. --read-users