Quick start

Authenticate, write, and query with the InfluxDB 3 Cloud Dedicated API.

Prerequisites: A database token with write permission for the target database. Use the Management API or influxctl to create tokens before writing data.

  1. Check that the instance is available.

    curl "https://cluster-id.a.influxdb.io/ping"

    A 204 No Content response indicates the querier is available.

  2. Write data to InfluxDB.

    curl "https://cluster-id.a.influxdb.io/api/v2/write?bucket=sensors&precision=ns" \
      --header "Authorization: Bearer DATABASE_TOKEN" \
      --header "Content-Type: text/plain; charset=utf-8" \
      --data-raw "home,room=Kitchen temp=72.0
    home,room=Living\ room temp=71.5"

    If all data is written, the response is 204 No Content.

  3. Query data from InfluxDB using InfluxQL.

    curl "https://cluster-id.a.influxdb.io/query" \
      --get \
      --header "Authorization: Bearer DATABASE_TOKEN" \
      --data-urlencode "db=sensors" \
      --data-urlencode "q=SELECT * FROM home WHERE room='Living room'" \
      --data-urlencode "epoch=ns"

For SQL queries and Arrow-format output, use the Flight+gRPC protocol. For more information, see the get started guide.


Was this page helpful?

Thank you for your feedback!