---
title: Buckets (v2 compatible)
description: Manage databases as buckets using InfluxDB v2-compatible endpoints. Provides forward compatibility with InfluxDB 2.x client libraries and InfluxDB Enterprise 1.8+.
url: https://docs.influxdata.com/enterprise_influxdb/v1/api/buckets-v2-compatible/
estimated_tokens: 547
publisher: InfluxData
canonical: https://docs.influxdata.com/enterprise_influxdb/v1/api/buckets-v2-compatible/
---

[Download InfluxDB Enterprise v1 API Spec](/openapi/influxdb-enterprise-v1-openapi.yml)

Manage databases as buckets using InfluxDB v2-compatible endpoints. Provides forward compatibility with InfluxDB 2.x client libraries and InfluxDB Enterprise 1.8+.

GET`/api/v2/buckets`v2

### List buckets (v2 compatible)

List all databases as buckets. Provides forward compatibility with
InfluxDB 2.x client libraries.

Example request[Ask AI about this](#)

```sh
curl --request GET \
  "http://localhost:8086/api/v2/buckets" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200List of buckets

`buckets`object[]

401Unauthorized

`error`requiredstring

Error message

POST`/api/v2/buckets`v2

### Create bucket (v2 compatible)

Create a new database as a bucket. Provides forward compatibility with
InfluxDB 2.x client libraries.

#### Request bodyrequired

Content-Type:`application/json`

`name`requiredstring

Database name

`retentionRules`object[]

`everySeconds`integer

Retention period in seconds

`type`string

Allowed:`expire`

Example request[Ask AI about this](#)

```sh
curl --request POST \
  "http://localhost:8086/api/v2/buckets" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "name": "NAME",
  "retentionRules": []
}'
```

#### Responses

201Bucket created

`id`string

Bucket ID (database/retention-policy)

`name`string

Bucket name

`retentionRules`object[]

`everySeconds`integer

`type`string

Allowed:`expire`

401Unauthorized

`error`requiredstring

Error message

DELETE`/api/v2/buckets/{bucketID}`v2

### Delete bucket (v2 compatible)

Delete a database/retention policy combination.
The bucketID format is `database/retention-policy`.

#### Parameters

##### Path parameters

`bucketID`requiredstring

Bucket ID in format `database/retention-policy`

Example request[Ask AI about this](#)

```sh
curl --request DELETE \
  "http://localhost:8086/api/v2/buckets/{bucketID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

204Bucket deleted

401Unauthorized

`error`requiredstring

Error message

404Bucket not found

`error`requiredstring

Error message
