---
title: Quick start
description: 'Authenticate, write, and query with the InfluxDB Cloud API: Create an API token with write and read permissions for a bucket. Create tokens in the InfluxDB Cloud UI or via the Authorizations (API tokens) endpoints. Check the status of your InfluxDB Cloud region. curl "https://REGION.aws.cloud2.influxdata.com/health" Write data to a bucket using the /api/v2/write endpoint and line protocol. curl --request POST \ "https://REGION.aws.cloud2.influxdata.com/api/v2/write?org=ORG&bucket=BUCKET&precisio'
url: https://docs.influxdata.com/influxdb/cloud/api/quick-start/
estimated_tokens: 1146
product: InfluxDB Cloud (TSM)
version: cloud
---

[Download InfluxDB Cloud (TSM) API Spec](/openapi/influxdb-cloud-v2-api.yml)

Authenticate, write, and query with the InfluxDB Cloud API:

1. Create an API token with write and read permissions for a bucket. Create tokens in the InfluxDB Cloud UI or via the Authorizations (API tokens) endpoints.
    
2. Check the status of your InfluxDB Cloud region.
    
    ```bash
    curl "https://REGION.aws.cloud2.influxdata.com/health"
    ```
    
3. Write data to a bucket using the `/api/v2/write` endpoint and [line protocol](/influxdb/cloud/reference/syntax/line-protocol/).
    
    ```bash
    curl --request POST \
      "https://REGION.aws.cloud2.influxdata.com/api/v2/write?org=ORG&bucket=BUCKET&precision=s" \
      --header "Authorization: Token YOUR_API_TOKEN" \
      --header "Content-Type: text/plain; charset=utf-8" \
      --data-raw "home,room=Kitchen temp=72.0 1640995200
    home,room=Living\ Room temp=71.5 1640995200"
    ```
    
    If all data is written, the response is `204 No Content`.
    
4. Query data using the Flux `/api/v2/query` endpoint.
    
    ```bash
    curl --request POST \
      "https://REGION.aws.cloud2.influxdata.com/api/v2/query?org=ORG" \
      --header "Authorization: Token YOUR_API_TOKEN" \
      --header "Content-Type: application/vnd.flux" \
      --data 'from(bucket: "BUCKET") |> range(start: -1h) |> filter(fn: (r) => r._measurement == "home")'
    ```
    
    Alternatively, query with InfluxQL using the v1-compatible `/query` endpoint. Target a v1 DBRP mapping (`database.retention_policy`) that points to your bucket:
    
    ```bash
    curl --get "https://REGION.aws.cloud2.influxdata.com/query" \
      --header "Authorization: Token YOUR_API_TOKEN" \
      --data-urlencode "db=DATABASE" \
      --data-urlencode "q=SELECT * FROM home WHERE time > now() - 1h"
    ```
    

For more information, see [Get started with InfluxDB Cloud](/influxdb/cloud/get-started/).

#### Related

-   [Get started with InfluxDB Cloud](/influxdb/cloud/get-started/)
-   [Write data](/influxdb/cloud/write-data/)
-   [Query data with Flux](/influxdb/cloud/query-data/)
