---
title: Databases
description: Create and manage databases in an InfluxDB 3 Clustered cluster, including setting retention periods and custom partition templates.
url: https://docs.influxdata.com/influxdb3/clustered/api/management-api/databases/
estimated_tokens: 12652
product: InfluxDB Clustered
version: clustered
---

[Download Clustered Management API Spec](/openapi/influxdb-clustered-management-api.yml)

Create and manage databases in an InfluxDB 3 Clustered cluster, including setting retention periods and custom partition templates.

GET `/databases`

### Get all databases for a cluster

Example request [Ask AI about this](#)

```sh
curl --request GET \
  "https://console.influxdata.com/api/v0/databases" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 The cluster databases were successfully retrieved

400 Bad Request

`code` required integer

`message` required string

401 Unauthorized

`code` required integer

`message` required string

403 Forbidden

`code` required integer

`message` required string

404 Not Found

`code` required integer

`message` required string

500 Internal Server Error

`code` required integer

`message` required string

POST `/databases`

### Create a database

#### Request body required

Content-Type: `application/json`

`maxColumnsPerTable` string

`maxTables` string

`name` required string

`partitionTemplate` string

`retentionPeriod` string

Example request [Ask AI about this](#)

```sh
curl --request POST \
  "https://console.influxdata.com/api/v0/databases" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "maxColumnsPerTable": 200,
  "maxTables": 500,
  "name": "NAME",
  "partitionTemplate": [],
  "retentionPeriod": 0
}'
```

#### Responses

200 The cluster database was successfully created

`maxColumnsPerTable` required string

`maxTables` required string

`name` required string

`partitionTemplate` string

`retentionPeriod` required string

400 Bad Request

`code` required integer

`message` required string

401 Unauthorized

`code` required integer

`message` required string

403 Forbidden

`code` required integer

`message` required string

404 Not Found

`code` required integer

`message` required string

409 Conflict

`code` required integer

`message` required string

500 Internal Server Error

`code` required integer

`message` required string

PUT `/databases/{databaseId}/undelete`

### Undelete a database

Restores a previously deleted database.

This operation can only be performed on databases that have been soft-deleted and are still within the recovery window.

#### Parameters

##### Path parameters

`databaseId` required string

The ID of the database to undelete

Example request [Ask AI about this](#)

```sh
curl --request PUT \
  "https://console.influxdata.com/api/v0/databases/{databaseId}/undelete" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

200 The cluster database was successfully undeleted

`id` required string

The ID of the database

`maxColumnsPerTable` required string

`maxTables` required string

`name` required string

`partitionTemplate` string

`retentionPeriod` string

400 Bad Request

`code` required integer

`message` required string

401 Unauthorized

`code` required integer

`message` required string

403 Forbidden

`code` required integer

`message` required string

404 Not Found

`code` required integer

`message` required string

500 Internal Server Error

`code` required integer

`message` required string

PATCH `/databases/{databaseName}`

### Update a database

#### Parameters

##### Path parameters

`databaseName` required string

The name of the database to update

#### Request body required

Content-Type: `application/json`

`maxColumnsPerTable` string

`maxTables` string

`retentionPeriod` string

Example request [Ask AI about this](#)

```sh
curl --request PATCH \
  "https://console.influxdata.com/api/v0/databases/{databaseName}" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "maxColumnsPerTable": 200,
  "maxTables": 500,
  "retentionPeriod": 0
}'
```

#### Responses

200 The cluster database was successfully updated.

`maxColumnsPerTable` required string

`maxTables` required string

`name` required string

`retentionPeriod` required string

400 Bad Request

`code` required integer

`message` required string

401 Unauthorized

`code` required integer

`message` required string

403 Forbidden

`code` required integer

`message` required string

404 Not Found

`code` required integer

`message` required string

500 Internal Server Error

`code` required integer

`message` required string

DELETE `/databases/{databaseName}`

### Delete a database

#### Parameters

##### Path parameters

`databaseName` required string

The name of the database to delete

Example request [Ask AI about this](#)

```sh
curl --request DELETE \
  "https://console.influxdata.com/api/v0/databases/{databaseName}" \
  --header "Authorization: Bearer INFLUX_TOKEN"
```

#### Responses

204 No Content

400 Bad Request

`code` required integer

`message` required string

401 Unauthorized

`code` required integer

`message` required string

403 Forbidden

`code` required integer

`message` required string

404 Not Found

`code` required integer

`message` required string

500 Internal Server Error

`code` required integer

`message` required string

PUT `/databases/{databaseName}/rename`

### Rename a database

Renames an existing database.

This operation can only be performed on databases that are currently active.

#### Parameters

##### Path parameters

`databaseName` required string

The name of the database to rename

#### Request body required

Content-Type: `application/json`

`name` required string

Example request [Ask AI about this](#)

```sh
curl --request PUT \
  "https://console.influxdata.com/api/v0/databases/{databaseName}/rename" \
  --header "Authorization: Bearer INFLUX_TOKEN" \
  --header "Content-Type: application/json" \
  --data-raw '{
  "name": "NAME"
}'
```

#### Responses

200 The cluster database was successfully renamed

`id` required string

The ID of the database

`maxColumnsPerTable` required string

`maxTables` required string

`name` required string

`partitionTemplate` string

`retentionPeriod` string

400 Bad Request

`code` required integer

`message` required string

401 Unauthorized

`code` required integer

`message` required string

403 Forbidden

`code` required integer

`message` required string

404 Not Found

`code` required integer

`message` required string

409 Conflict

`code` required integer

`message` required string

500 Internal Server Error

`code` required integer

`message` required string

#### Related

-   [Manage databases](/influxdb3/clustered/admin/databases/)
-   [Custom partitions](/influxdb3/clustered/admin/custom-partitions/)
-   [InfluxDB 3 API client libraries](/influxdb3/clustered/reference/client-libraries/v3/)
