docs-v2/content/influxdb/v2.1/reference/cli/influx/auth/create.md

8.2 KiB

title description menu weight updated_in
influx auth create The `influx auth create` command creates an API token in InfluxDB.
influxdb_2_1_ref
name parent
influx auth create influx auth
201 CLI v2.2.0

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

Usage

influx auth create [flags]

Flags

Flag Description Input type {{< cli/mapped >}}
-c --active-config CLI configuration to use for command string
--all-access Grants all permissions in a single organization
--configs-path Path to influx CLI configurations (default ~/.influxdbv2/configs) string INFLUX_CONFIGS_PATH
-d --description API token description string
-h --help Help for the create command
--hide-headers Hide table headers (default false) INFLUX_HIDE_HEADERS
--host HTTP address of InfluxDB (default http://localhost:8086) string INFLUX_HOST
--http-debug Inspect communication with InfluxDB servers string
--json Output data as JSON (default false) INFLUX_OUTPUT_JSON
--operator (InfluxDB OSS only) Grants all permissions in all organizations string
-o --org Organization name (mutually exclusive with --org-id) string INFLUX_ORG
--org-id Organization ID (mutually exclusive with --org) string INFLUX_ORG_ID
--read-bucket Grant permission to read a specified bucket ID stringArray
--read-buckets Grant permission to read all organization buckets
--read-checks Grant permission to read checks
--read-dashboards Grant permission to read dashboards
--read-dbrps Grant permission to read database retention policy mappings
--read-notificationEndpoints Grant permission to read notificationEndpoints
--read-notificationRules Grant permission to read notificationRules
--read-orgs Grant permission to read organizations
--read-tasks Grant permission to read tasks
--read-telegrafs Grant permission to read Telegraf configurations
--read-users Grant permission to read organization users
--skip-verify Skip TLS certificate verification INFLUX_SKIP_VERIFY
-t --token API token string INFLUX_TOKEN
-u --user Username string
--write-bucket Grant permission to write to specified a bucket ID stringArray
--write-buckets Grant permission to create and update all organization buckets
--write-checks Grant permission to create checks
--write-dashboards Grant permission to create and update dashboards
--write-dbrps Grant permission to create database retention policy mappings
--write-notificationEndpoints Grant permission to create notificationEndpoints
--write-notificationRules Grant permission to create notificationRules
--write-orgs Grant permission to create and update organizations
--write-tasks Grant permission to create and update tasks
--write-telegrafs Grant permission to create and update Telegraf configurations
--write-users Grant permission to create and update organization users

Examples

{{< cli/influx-creds-note >}}

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 

{{% oss-only %}}

Create an Operator API token

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

influx auth create \
  --operator

{{% /oss-only %}}

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-tasks \
  --read-telegrafs \
  --read-users \
  --write-buckets \
  --write-checks \
  --write-dashboards \
  --write-dbrps \
  --write-notificationEndpoints \
  --write-notificationRules \
  --write-orgs \
  --write-tasks \
  --write-telegrafs \
  --write-users

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-tasks \
  --read-telegrafs \
  --read-users