Quick start
Use the InfluxDB 3 Clustered Management API to create databases, issue database tokens, and configure your cluster programmatically.
Prerequisites: A management token. Generate one with influxctl:
influxctl management create --format=jsonSet an environment variable for the examples below:
export MANAGEMENT_TOKEN="MANAGEMENT_TOKEN"List databases in your cluster.
curl "https://console.influxdata.com/api/v0/databases" \ --header "Authorization: Bearer ${MANAGEMENT_TOKEN}"Create a database.
curl "https://console.influxdata.com/api/v0/databases" \ --request POST \ --header "Authorization: Bearer ${MANAGEMENT_TOKEN}" \ --header "Content-Type: application/json" \ --data '{"name": "sensors"}'Create a database token with read and write access.
curl "https://console.influxdata.com/api/v0/tokens" \ --request POST \ --header "Authorization: Bearer ${MANAGEMENT_TOKEN}" \ --header "Content-Type: application/json" \ --data '{ "description": "Read/write token for sensors", "permissions": [ {"action": "read", "resource": "sensors"}, {"action": "write", "resource": "sensors"} ] }'
Use the database token returned in step 3 to authenticate writes and queries to the Data API.
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 Clustered and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.