Quick start

Use the InfluxDB 3 Cloud Dedicated 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=json

Set environment variables for the examples below:

export ACCOUNT_ID="ACCOUNT_ID"
export CLUSTER_ID="CLUSTER_ID"
export MANAGEMENT_TOKEN="MANAGEMENT_TOKEN"
  1. List databases in your cluster.

    curl "https://console.influxdata.com/api/v0/accounts/${ACCOUNT_ID}/clusters/${CLUSTER_ID}/databases" \
      --header "Authorization: Bearer ${MANAGEMENT_TOKEN}"
  2. Create a database.

    curl "https://console.influxdata.com/api/v0/accounts/${ACCOUNT_ID}/clusters/${CLUSTER_ID}/databases" \
      --request POST \
      --header "Authorization: Bearer ${MANAGEMENT_TOKEN}" \
      --header "Content-Type: application/json" \
      --data '{"name": "sensors"}'
  3. Create a database token with read and write access.

    curl "https://console.influxdata.com/api/v0/accounts/${ACCOUNT_ID}/clusters/${CLUSTER_ID}/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!