---
title: Tables
description: Manage tables in an InfluxDB 3 Clustered database, including creating tables with custom column schemas.
url: https://docs.influxdata.com/influxdb3/clustered/api/management-api/tables/
estimated_tokens: 2811
publisher: InfluxData
canonical: https://docs.influxdata.com/influxdb3/clustered/api/management-api/tables/
---

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

Manage tables in an InfluxDB 3 Clustered database, including creating tables with custom column schemas.

POST`/databases/{databaseName}/tables`

### Create a database table

#### Parameters

##### Path parameters

`databaseName`requiredstring

The name of the database to create the database table for

#### Request bodyrequired

Content-Type:`application/json`

`name`requiredstring

The name of the cluster database table

`partitionTemplate`object[]

A template for partitioning a cluster database.

Each template part is evaluated in sequence, concatinating the final
partition key from the output of each part, delimited by the partition
key delimiter `|`.

For example, using the partition template below:

```json
[
  {
    "type": "time",
    "value": "%Y"
  },
  {
    "type": "tag",
    "value": "bananas"
  },
  {
    "type": "tag",
    "value": "plátanos"
  },
  {
    "type": "bucket",
    "value": {
      "tagName": "c",
      "numberOfBuckets": 10
    }
  }
]
```

The following partition keys are derived:

* `time=2023-01-01, a=bananas, b=plátanos, c=ananas` -\> `2023|bananas|plátanos|5`
* `time=2023-01-01, b=plátanos` -\> `2023|!|plátanos|!`
* `time=2023-01-01, another=cat, b=plátanos` -\> `2023|!|plátanos|!`
* `time=2023-01-01` -\> `2023|!|!|!`
* `time=2023-01-01, a=cat|dog, b=!, c=!` -\> `2023|cat%7Cdog|%21|8`
* `time=2023-01-01, a=%50, c=%50` -\> `2023|%2550|!|9`
* `time=2023-01-01, a=, c=` -\> `2023|^|!|0`
* `time=2023-01-01, a=<long string>` -\> `2023|<long string>#|!|!`
* `time=2023-01-01, c=<long string>` -\> `2023|!|!|<bucket ID for untruncated long string>`

When using the default partitioning template (YYYY-MM-DD) there is no
encoding necessary, as the derived partition key contains a single part, and
no reserved characters. [`TemplatePart::Bucket`] parts by definition will
always be within the part length limit and contain no restricted characters
so are also not percent-encoded and/or truncated.

Example request[Ask AI about this](#)

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

#### Responses

200The cluster database table was successfully created

`databaseName`requiredstring

The name of the cluster database

`name`requiredstring

The name of the cluster database table

`partitionTemplate`object[]

A template for partitioning a cluster database.

Each template part is evaluated in sequence, concatinating the final
partition key from the output of each part, delimited by the partition
key delimiter `|`.

For example, using the partition template below:

```json
[
  {
    "type": "time",
    "value": "%Y"
  },
  {
    "type": "tag",
    "value": "bananas"
  },
  {
    "type": "tag",
    "value": "plátanos"
  },
  {
    "type": "bucket",
    "value": {
      "tagName": "c",
      "numberOfBuckets": 10
    }
  }
]
```

The following partition keys are derived:

* `time=2023-01-01, a=bananas, b=plátanos, c=ananas` -\> `2023|bananas|plátanos|5`
* `time=2023-01-01, b=plátanos` -\> `2023|!|plátanos|!`
* `time=2023-01-01, another=cat, b=plátanos` -\> `2023|!|plátanos|!`
* `time=2023-01-01` -\> `2023|!|!|!`
* `time=2023-01-01, a=cat|dog, b=!, c=!` -\> `2023|cat%7Cdog|%21|8`
* `time=2023-01-01, a=%50, c=%50` -\> `2023|%2550|!|9`
* `time=2023-01-01, a=, c=` -\> `2023|^|!|0`
* `time=2023-01-01, a=<long string>` -\> `2023|<long string>#|!|!`
* `time=2023-01-01, c=<long string>` -\> `2023|!|!|<bucket ID for untruncated long string>`

When using the default partitioning template (YYYY-MM-DD) there is no
encoding necessary, as the derived partition key contains a single part, and
no reserved characters. [`TemplatePart::Bucket`] parts by definition will
always be within the part length limit and contain no restricted characters
so are also not percent-encoded and/or truncated.

400Bad Request

`code`requiredinteger

`message`requiredstring

401Unauthorized

`code`requiredinteger

`message`requiredstring

403Forbidden

`code`requiredinteger

`message`requiredstring

404Not Found

`code`requiredinteger

`message`requiredstring

409Conflict

`code`requiredinteger

`message`requiredstring

500Internal Server Error

`code`requiredinteger

`message`requiredstring

PUT`/databases/{databaseName}/tables/{tableId}/undelete`

### Undelete a database table

Restores a previously deleted database table.

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

#### Parameters

##### Path parameters

`databaseName`requiredstring

The name of the database that the table belongs to

`tableId`requiredinteger \<int64\>

The ID of the table to undelete

Example request[Ask AI about this](#)

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

#### Responses

200The cluster database table was successfully undeleted

`databaseName`requiredstring

The name of the cluster database

`id`requiredinteger \<int64\>

The ID of the table

`name`requiredstring

The name of the cluster database table

`partitionTemplate`object[]

A template for partitioning a cluster database.

Each template part is evaluated in sequence, concatinating the final
partition key from the output of each part, delimited by the partition
key delimiter `|`.

For example, using the partition template below:

```json
[
  {
    "type": "time",
    "value": "%Y"
  },
  {
    "type": "tag",
    "value": "bananas"
  },
  {
    "type": "tag",
    "value": "plátanos"
  },
  {
    "type": "bucket",
    "value": {
      "tagName": "c",
      "numberOfBuckets": 10
    }
  }
]
```

The following partition keys are derived:

* `time=2023-01-01, a=bananas, b=plátanos, c=ananas` -\> `2023|bananas|plátanos|5`
* `time=2023-01-01, b=plátanos` -\> `2023|!|plátanos|!`
* `time=2023-01-01, another=cat, b=plátanos` -\> `2023|!|plátanos|!`
* `time=2023-01-01` -\> `2023|!|!|!`
* `time=2023-01-01, a=cat|dog, b=!, c=!` -\> `2023|cat%7Cdog|%21|8`
* `time=2023-01-01, a=%50, c=%50` -\> `2023|%2550|!|9`
* `time=2023-01-01, a=, c=` -\> `2023|^|!|0`
* `time=2023-01-01, a=<long string>` -\> `2023|<long string>#|!|!`
* `time=2023-01-01, c=<long string>` -\> `2023|!|!|<bucket ID for untruncated long string>`

When using the default partitioning template (YYYY-MM-DD) there is no
encoding necessary, as the derived partition key contains a single part, and
no reserved characters. [`TemplatePart::Bucket`] parts by definition will
always be within the part length limit and contain no restricted characters
so are also not percent-encoded and/or truncated.

400Bad Request

`code`requiredinteger

`message`requiredstring

401Unauthorized

`code`requiredinteger

`message`requiredstring

403Forbidden

`code`requiredinteger

`message`requiredstring

404Not Found

`code`requiredinteger

`message`requiredstring

500Internal Server Error

`code`requiredinteger

`message`requiredstring

DELETE`/databases/{databaseName}/tables/{tableName}`

### Delete a database table

#### Parameters

##### Path parameters

`databaseName`requiredstring

The name of the database that the database table belongs to

`tableName`requiredstring

The name of the database table to delete

Example request[Ask AI about this](#)

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

#### Responses

204The cluster database table was successfully deleted

400Bad Request

`code`requiredinteger

`message`requiredstring

401Unauthorized

`code`requiredinteger

`message`requiredstring

403Forbidden

`code`requiredinteger

`message`requiredstring

404Not Found

`code`requiredinteger

`message`requiredstring

500Internal Server Error

`code`requiredinteger

`message`requiredstring

PUT`/databases/{databaseName}/tables/{tableName}/rename`

### Rename a database table

#### Parameters

##### Path parameters

`databaseName`requiredstring

The name of the database that the database table belongs to

`tableName`requiredstring

The name of the database table to rename

#### Request bodyrequired

Content-Type:`application/json`

`name`requiredstring

The name of the cluster database table

Example request[Ask AI about this](#)

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

#### Responses

200The cluster database table was successfully renamed

`databaseName`requiredstring

The name of the cluster database

`id`requiredinteger \<int64\>

The ID of the table

`name`requiredstring

The name of the cluster database table

`partitionTemplate`object[]

A template for partitioning a cluster database.

Each template part is evaluated in sequence, concatinating the final
partition key from the output of each part, delimited by the partition
key delimiter `|`.

For example, using the partition template below:

```json
[
  {
    "type": "time",
    "value": "%Y"
  },
  {
    "type": "tag",
    "value": "bananas"
  },
  {
    "type": "tag",
    "value": "plátanos"
  },
  {
    "type": "bucket",
    "value": {
      "tagName": "c",
      "numberOfBuckets": 10
    }
  }
]
```

The following partition keys are derived:

* `time=2023-01-01, a=bananas, b=plátanos, c=ananas` -\> `2023|bananas|plátanos|5`
* `time=2023-01-01, b=plátanos` -\> `2023|!|plátanos|!`
* `time=2023-01-01, another=cat, b=plátanos` -\> `2023|!|plátanos|!`
* `time=2023-01-01` -\> `2023|!|!|!`
* `time=2023-01-01, a=cat|dog, b=!, c=!` -\> `2023|cat%7Cdog|%21|8`
* `time=2023-01-01, a=%50, c=%50` -\> `2023|%2550|!|9`
* `time=2023-01-01, a=, c=` -\> `2023|^|!|0`
* `time=2023-01-01, a=<long string>` -\> `2023|<long string>#|!|!`
* `time=2023-01-01, c=<long string>` -\> `2023|!|!|<bucket ID for untruncated long string>`

When using the default partitioning template (YYYY-MM-DD) there is no
encoding necessary, as the derived partition key contains a single part, and
no reserved characters. [`TemplatePart::Bucket`] parts by definition will
always be within the part length limit and contain no restricted characters
so are also not percent-encoded and/or truncated.

400Bad Request

`code`requiredinteger

`message`requiredstring

401Unauthorized

`code`requiredinteger

`message`requiredstring

403Forbidden

`code`requiredinteger

`message`requiredstring

404Not Found

`code`requiredinteger

`message`requiredstring

409Conflict

`code`requiredinteger

`message`requiredstring

500Internal Server Error

`code`requiredinteger

`message`requiredstring

#### Related

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