---
title: Authentication
description: 'Use one of the following schemes to authenticate to the InfluxDB 3 Cloud Dedicated API: Token authentication Bearer authentication Basic authentication Querystring authentication'
url: https://docs.influxdata.com/influxdb3/cloud-dedicated/api/data-api/authentication/
estimated_tokens: 2502
product: InfluxDB Cloud Dedicated
version: cloud-dedicated
---

[Download Cloud Dedicated Data API Spec](/openapi/influxdb-cloud-dedicated-data-api.yml)

Use one of the following schemes to authenticate to the InfluxDB 3 Cloud Dedicated API:

-   Token authentication
-   Bearer authentication
-   Basic authentication
-   Querystring authentication

## Basic Authentication

Use the `Authorization` header with the `Basic` scheme to authenticate v1 API requests.

Works with v1 compatibility [`/write`](/influxdb3/cloud-dedicated/api/write-data/) and [`/query`](/influxdb3/cloud-dedicated/api/query-data/) endpoints in InfluxDB 3.

When authenticating requests, InfluxDB 3 checks that the `password` part of the decoded credential is an authorized token and ignores the `username` part of the decoded credential.

### Example

```bash
curl "https://cluster-id.a.influxdb.io/write?db=DATABASE_NAME&precision=s" \
  --user "":"DATABASE_TOKEN" \
  --header "Content-type: text/plain; charset=utf-8" \
  --data-binary 'home,room=kitchen temp=72 1641024000'
```

Replace the following:

-   **`DATABASE_NAME`**: your InfluxDB 3 Cloud Dedicated database
-   **`DATABASE_TOKEN`**: a database token with sufficient permissions to the database

For more information, see [Authenticate v1 API requests](/influxdb3/cloud-dedicated/guides/api-compatibility/v1/) and [Manage tokens](/influxdb3/cloud-dedicated/admin/tokens/).

## Bearer Authentication

Use the OAuth Bearer authentication scheme to provide an authorization token to InfluxDB Cloud Dedicated.

Bearer authentication works with all endpoints.

In your API requests, send an `Authorization` header. For the header value, provide the word `Bearer` followed by a space and a database token.

### Syntax

```http
Authorization: Bearer DATABASE_TOKEN
```

### Example

```bash
curl https://cluster-id.a.influxdb.io/api/v3/query_influxql \
  --header "Authorization: Bearer DATABASE_TOKEN"
```

## Query String Authentication

Use InfluxDB 1.x API parameters to provide credentials through the query string for v1 API requests.

Querystring authentication works with v1-compatible [`/write`](/influxdb3/cloud-dedicated/api/write-data/) and [`/query`](/influxdb3/cloud-dedicated/api/query-data/) endpoints.

When authenticating requests, InfluxDB 3 checks that the `p` (*password*) query parameter is an authorized token and ignores the `u` (*username*) query parameter.

### Syntax

```http
https://cluster-id.a.influxdb.io/query/?[u=any]&p=DATABASE_TOKEN
https://cluster-id.a.influxdb.io/write/?[u=any]&p=DATABASE_TOKEN
```

### Examples

```bash
curl "https://cluster-id.a.influxdb.io/write?db=DATABASE_NAME&precision=s&p=DATABASE_TOKEN" \
  --header "Content-type: text/plain; charset=utf-8" \
  --data-binary 'home,room=kitchen temp=72 1641024000'
```

Replace the following:

-   **`DATABASE_NAME`**: your InfluxDB 3 Cloud Dedicated database
-   **`DATABASE_TOKEN`**: a database token with sufficient permissions to the database

```bash
#######################################
# Use an InfluxDB 1.x compatible username and password
# to query the InfluxDB v1 HTTP API
#######################################
# Use authentication query parameters:
#   ?p=DATABASE_TOKEN
#######################################

curl --get "https://cluster-id.a.influxdb.io/query" \
  --data-urlencode "p=DATABASE_TOKEN" \
  --data-urlencode "db=DATABASE_NAME" \
  --data-urlencode "q=SELECT * FROM MEASUREMENT"
```

Replace the following:

-   **`DATABASE_NAME`**: the database to query
-   **`DATABASE_TOKEN`**: a database token with sufficient permissions to the database

For more information, see [Authenticate v1 API requests](/influxdb3/cloud-dedicated/guides/api-compatibility/v1/) and [Manage tokens](/influxdb3/cloud-dedicated/admin/tokens/).

## Token Authentication

Use InfluxDB v2 Token authentication to provide an authorization token to InfluxDB Cloud Dedicated.

The v2 Token scheme works with v1 and v2 compatibility endpoints in InfluxDB Cloud Dedicated.

In your API requests, send an `Authorization` header. For the header value, provide the word `Token` followed by a space and a database token. The word `Token` is case-sensitive.

### Syntax

```http
Authorization: Token DATABASE_TOKEN
```

### Example

```sh
########################################################
# Use the Token authentication scheme with /api/v2/write
# to write data.
########################################################

curl --request post "https://cluster-id.a.influxdb.io/api/v2/write?bucket=DATABASE_NAME&precision=s" \
  --header "Authorization: Token DATABASE_TOKEN" \
  --data-binary 'home,room=kitchen temp=72 1463683075'
```

For more information, see [Manage tokens](/influxdb3/cloud-dedicated/admin/tokens/).
