---
title: Learn to use APIs for your workloads
description: Choose the API and tools that fit your workload. Learn how to authenticate, write, and query using Telegraf, client libraries, and HTTP clients.
url: https://docs.influxdata.com/influxdb3/cloud-serverless/guides/api-compatibility/
estimated_tokens: 594
product: InfluxDB Cloud Serverless
version: cloud-serverless
---

# Learn to use APIs for your workloads

Choose the InfluxDB Cloud Serverless API and tools that best fit your workload:

### [InfluxDB v2 API compatibility](/influxdb3/cloud-serverless/guides/api-compatibility/v2/)

Use the InfluxDB v2 API for new write workloads and existing v2 write workloads. InfluxDB Cloud Serverless is compatible with the InfluxDB v2 API `/api/v2/write` endpoint and existing InfluxDB 2.x tools and code.

```sh
curl \
--post "https://cloud2.influxdata.com/api/v2/write?bucket=BUCKET_NAME&precision=s" \
--header "Authorization: Token API_TOKEN" \
--data-binary 'home,room=kitchen temp=72 1463683075'
```

### [Use the InfluxDB v1 HTTP API](/influxdb3/cloud-serverless/guides/api-compatibility/v1/)

Use InfluxDB v1 API authentication, endpoints, and tools when bringing existing 1.x workloads to InfluxDB Cloud Serverless.

```sh
curl "https://cloud2.influxdata.com/query" \
--user "any:API_TOKEN" \
--data-urlencode "db=DATABASE_NAME" \
--data-urlencode "rp=RETENTION_POLICY" \
--data-urlencode "q=SELECT * FROM MEASUREMENT"
```

#### Related
