Buckets (v2 compatible)

Download InfluxDB API Spec
Manage databases as buckets using InfluxDB v2-compatible endpoints. Provides forward compatibility with InfluxDB 2.x client libraries and InfluxDB 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
curl --request GET \
  "http://localhost:8086/api/v2/buckets" \
  --header "Authorization: Bearer INFLUX_TOKEN"

Responses

200 List of buckets
buckets object[]
401 Unauthorized
error required string
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 body required

Content-Type: application/json
name required string
Database name
retentionRules object[]
everySeconds integer
Retention period in seconds
type string
Allowed: expire
Example request Ask AI about this
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

201 Bucket created
id string
Bucket ID (database/retention-policy)
name string
Bucket name
retentionRules object[]
everySeconds integer
type string
Allowed: expire
401 Unauthorized
error required string
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 required string
Bucket ID in format database/retention-policy
Example request Ask AI about this
curl --request DELETE \
  "http://localhost:8086/api/v2/buckets/{bucketID}" \
  --header "Authorization: Bearer INFLUX_TOKEN"

Responses

204 Bucket deleted
401 Unauthorized
error required string
Error message
404 Bucket not found
error required string
Error message

Was this page helpful?

Thank you for your feedback!