Manage resource tokens
Manage resource tokens in your InfluxDB 3 Enterprise instance. Resource tokens provide scoped access to specific resources:
- Database tokens: provide access to specific databases for actions like writing and querying data
- System tokens: provide access to system-level resources, such as API endpoints for server runtime statistics and health.
Resource tokens are user-defined and available only in InfluxDB 3 Enterprise.
Create a resource token
Use the influxdb3 create token --permission
command or the HTTP API to create fine-grained permissions tokens that grant access to resources such as databases and system information. Database tokens allow for reading and writing data in your InfluxDB 3 Enterprise instance. System tokens allow for reading system information and metrics for your server.
CLI
influxdb3 create token \
--permission "db:DATABASE1,DATABASE2:read,write" \
--name "Read-write on DATABASE1, DATABASE2" \
--token ADMIN_TOKEN \
--expiry 1y
HTTP API
curl \
"http://localhost:8181/api/v3/enterprise/configure/token" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer AUTH_TOKEN" \
--data '{
"token_name": "Read-write for DATABASE1, DATABASE2",
"permissions": [{
"resource_type": "db",
"resource_identifier": ["DATABASE1","DATABASE2"],
"actions": ["read","write"]
}],
"expiry_secs": 300000
}'
List resource tokens
Use the influxdb3
CLI or the HTTP API to list resource tokens with fine-grained access permissions in your InfluxDB 3 Enterprise instance. Use the influxdb3 show tokens
command to list all tokens or use SQL to query token metadata directly from the system.tokens
table.
CLI
influxdb3 show tokens
HTTP API
curl -G \
"http://localhost:8181/api/v3/query_sql" \
--data-urlencode "db=_internal" \
--data-urlencode "q=SELECT * FROM system.tokens WHERE permissions NOT LIKE '\*%'" \
--header 'Accept: application/json' \
--header "Authorization: Bearer AUTH_TOKEN"
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB 3 Enterprise and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.