Database tokens

Create and manage database tokens that authorize read and write access to InfluxDB 3 Clustered databases.
GET /tokens

Get all database tokens for a cluster

Example request Ask AI about this
curl --request GET \
  "https://console.influxdata.com/api/v0/tokens" \
  --header "Authorization: Bearer INFLUX_TOKEN"

Responses

200 The database tokens were successfully retrieved
400 Bad Request
code required integer
message required string
401 Unauthorized
code required integer
message required string
403 Forbidden
code required integer
message required string
404 Not Found
code required integer
message required string
500 Internal Server Error
code required integer
message required string
POST /tokens

Create a database token

Create a database token for a cluster.

The token returned on the accessToken property in the response can be used to authenticate query and write requests to the cluster.

Notable behaviors

  • InfluxDB might take some time–from a few seconds to a few minutes–to activate and synchronize new tokens. If a new database token doesn’t immediately work (you receive a 401 Unauthorized error) for querying or writing, wait and then try your request again.

  • Token strings are viewable only on token creation and aren’t stored by InfluxDB; you can’t recover a lost token.

Store secure tokens in a secret store

We recommend storing database tokens in a secure secret store. For example, see how to authenticate Telegraf using tokens in your OS secret store.

If you lose a token, delete the token from InfluxDB and create a new one.

Request body required

Content-Type: application/json
description required string
expiresAt string
permissions string
Example request Ask AI about this
curl --request POST \
  "https://console.influxdata.com/api/v0/tokens" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "description": "DESCRIPTION",
  "expiresAt": "EXPIRESAT",
  "permissions": []
}'

Responses

200 The database token was successfully created
accessToken required string
createdAt required string
description required string
expiresAt string
id required string
The ID of the database token
permissions required string
revokedAt string
400 Bad Request
code required integer
message required string
401 Unauthorized
code required integer
message required string
403 Forbidden
code required integer
message required string
404 Not Found
code required integer
message required string
409 Conflict
code required integer
message required string
500 Internal Server Error
code required integer
message required string
GET /tokens/{tokenId}

Get a database token

Parameters

Path parameters
tokenId required string
The ID of the database token to get
Example request Ask AI about this
curl --request GET \
  "https://console.influxdata.com/api/v0/tokens/{tokenId}" \
  --header "Authorization: Bearer INFLUX_TOKEN"

Responses

200 The database token was successfully retrieved.
createdAt required string
description required string
expiresAt string
id required string
The ID of the database token
permissions required string
revokedAt string
400 Bad Request
code required integer
message required string
401 Unauthorized
code required integer
message required string
403 Forbidden
code required integer
message required string
404 Not Found
code required integer
message required string
500 Internal Server Error
code required integer
message required string
PATCH /tokens/{tokenId}

Update a database token

Parameters

Path parameters
tokenId required string
The ID of the database token to update

Request body required

Content-Type: application/json
description string
permissions string
Example request Ask AI about this
curl --request PATCH \
  "https://console.influxdata.com/api/v0/tokens/{tokenId}" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "description": "DESCRIPTION",
  "permissions": []
}'

Responses

200 The database token was successfully updated
createdAt required string
description required string
expiresAt string
id required string
The ID of the database token
permissions required string
revokedAt string
400 Bad Request
code required integer
message required string
401 Unauthorized
code required integer
message required string
403 Forbidden
code required integer
message required string
404 Not Found
code required integer
message required string
409 Conflict
code required integer
message required string
500 Internal Server Error
code required integer
message required string
DELETE /tokens/{tokenId}

Delete a database token

Parameters

Path parameters
tokenId required string
The ID of the database token to delete
Example request Ask AI about this
curl --request DELETE \
  "https://console.influxdata.com/api/v0/tokens/{tokenId}" \
  --header "Authorization: Bearer INFLUX_TOKEN"

Responses

204 No Content
400 Bad Request
code required integer
message required string
401 Unauthorized
code required integer
message required string
403 Forbidden
code required integer
message required string
404 Not Found
code required integer
message required string
500 Internal Server Error
code required integer
message required string

Was this page helpful?

Thank you for your feedback!