---
title: Use tokens
description: Use an API token in the InfluxDB UI, the influx CLI, or the InfluxDB API.
url: https://docs.influxdata.com/influxdb/v2/admin/tokens/use-tokens/
estimated_tokens: 589
product: InfluxDB OSS v2
version: v2
---

# Use tokens

This page documents an earlier version of InfluxDB OSS. [InfluxDB 3 Core](/influxdb3/core/) is the latest stable version.

#### API token hashing is enabled by default in InfluxDB OSS 2.9.0

Stronger token security: tokens are stored as hashes on disk, so a copy of the database file doesn’t expose usable tokens. Existing tokens are hashed on first startup and the original strings can’t be recovered afterward — **capture any plaintext tokens you still need before you upgrade**.

For more information, see [Token hashing](/influxdb/v2/admin/tokens/#token-hashing).

Use tokens to authenticate requests to InfluxDB, including requests to write, query, and manage data and resources. Authenticate requests using the [`influx` CLI](/influxdb/v2/reference/cli/influx/), API requests made with client libraries, and tools like `curl`.

### Add a token to a CLI request

```sh
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"
```

See [here](/influxdb/v2/write-data/no-code/use-telegraf/auto-config/#configure-your-token-as-an-environment-variable) to configure environment variables on Windows. (Click on the **Windows** tab.)

### Use CLI configurations

Automatically manage and use tokens from the CLI using [`influx config`](/influxdb/v2/reference/cli/influx/config/).

### Use a token in an API request

Use tokens in [API requests](/influxdb/v2/api-guide/api_intro/#authentication).

### Use a token in Postman

Make authenticated requests with tokens [using Postman](/influxdb/v2/tools/postman/).
