docs-v2/content/influxdb/v2/admin/tokens/use-tokens.md

1.4 KiB

title seotitle description menu weight aliases
Use tokens Use an API token in InfluxDB Use an API token in the InfluxDB UI, the `influx` CLI, or the InfluxDB API.
influxdb_v2
name parent
Use tokens Manage tokens
204
/influxdb/v2/users/tokens/use-tokens
/influxdb/v2/security/tokens/use-tokens/

Use tokens to authenticate requests to InfluxDB, including requests to write, query, and manage data and resources. Authenticate requests using the influx CLI, API requests made with client libraries, and tools like curl.

Add a token to a CLI request

influx write -t <token> -b BUCKET -o org-name <LINE PROTOCOL>
export INFLUX_TOKEN=my-token
influx write -t $INFLUX_TOKEN -b my-bucket -o my-org "measurement field=1"

{{% note %}} See here to configure environment variables on Windows. (Click on the Windows tab.) {{% /note %}}

Use CLI configurations

Automatically manage and use tokens from the CLI using influx config.

Use a token in an API request

Use tokens in API requests.

Use a token in Postman

Make authenticated requests with tokens using Postman.