Documentation

View tokens

This page documents an earlier version of InfluxDB. InfluxDB v2.6 is the latest stable version. View this page in the v2.6 documentation.

View API tokens and permissions using the InfluxDB user interface (UI), the influx command line interface (CLI), or the InfluxDB API.

Tokens are visible to the user who created the token. Users who own a token with Operator permissions also have access to all tokens. Tokens stop working when the user who created the token is deleted.

We recommend creating a generic user to create and manage tokens for writing data.

View tokens in the InfluxDB UI

  1. In the navigation menu on the left, select Data (Load Data) > API Tokens.

  2. Click a token name in the list to view the token and a summary of access permissions.

View tokens using the influx CLI

Use the influx auth list command to view tokens.

influx auth list

Filtering options such as filtering by authorization ID, username, or user ID are available. See the influx auth list documentation for information about other available flags.

View tokens using the InfluxDB API

Use the /api/v2/authorizations InfluxDB API endpoint to view tokens and permissions.

GET /api/v2/authorizations

Include the following in your request:

RequirementInclude by
API token with the read: authorizations permissionUse the Authorization: Token YOUR_API_TOKEN header.
INFLUX_TOKEN=YOUR_API_TOKEN

curl --request GET \
	"http://localhost:8086/api/v2/authorizations" \
  --header "Authorization: Token ${INFLUX_TOKEN}" \
  --header 'Content-type: application/json'

View a single token

To view a specific authorization and token, include the authorization ID in the URL path.

GET /api/v2/authorizations/{authID}

Filter the token list

InfluxDB returns authorizations from the same organization as the token used in the request. To filter tokens by user, include userID as a query parameter in your request.

# The example below uses the common `curl` and `jq` command-line tools
# with the InfluxDB API to do the following:
# 1. Find a user by username and extract the user ID.
# 2. Find the user's authorizations by user ID.
# 3. Filter for `active` authorizations that have `write` permission.

INFLUX_TOKEN=YOUR_API_TOKEN

function list_write_auths() {
  curl "http://localhost:8086/api/v2/users/?name=$1" \
    --header "Authorization: Token ${INFLUX_TOKEN}" \
    --header 'Content-type: application/json' | \
  
  jq --arg USER $1 '.users[] | select(.name == $USER) | .id' | \
  
  xargs -I '%' \
  curl "http://localhost:8086/api/v2/authorizations/?userID=%" \
    --header "Authorization: Token ${INFLUX_TOKEN}" \
    --header 'Content-type: application/json' | \
  
  jq '.authorizations[]
        | select(.permissions[] | select(.action=="write"))
        | select(.status=="active")'
}

list_write_auths 'iot_user_1'

Operator tokens have access to all organizations’ authorizations. To filter authorizations by organization when using an operator token, include an org or orgID query parameter in your request.

See the /authorizations endpoint documentation for more information about available parameters.


Was this page helpful?

Thank you for your feedback!


Set your InfluxDB URL

Linux Package Signing Key Rotation

All signed InfluxData Linux packages have been resigned with an updated key. If using Linux, you may need to update your package configuration to continue to download and verify InfluxData software packages.

For more information, see the Linux Package Signing Key Rotation blog post.

InfluxDB Cloud backed by InfluxDB IOx

All InfluxDB Cloud organizations created on or after January 31, 2023 are backed by the new InfluxDB IOx storage engine. Check the right column of your InfluxDB Cloud organization homepage to see which InfluxDB storage engine you’re using.

If powered by IOx, this is the correct documentation.

If powered by TSM, see the TSM-based InfluxDB Cloud documentation.

InfluxDB Cloud backed by InfluxDB TSM

All InfluxDB Cloud organizations created on or after January 31, 2023 are backed by the new InfluxDB IOx storage engine which enables nearly unlimited series cardinality and SQL query support. Check the right column of your InfluxDB Cloud organization homepage to see which InfluxDB storage engine you’re using.

If powered by TSM, this is the correct documentation.

If powered by IOx, see the IOx-based InfluxDB Cloud documentation.

State of the InfluxDB Cloud (IOx) documentation

The new documentation for InfluxDB Cloud backed by InfluxDB IOx is a work in progress. We are adding new information and content almost daily. Thank you for your patience!

If there is specific information you’re looking for, please submit a documentation issue.