Databases
/accounts/{accountId}/clusters/{clusterId}/databasesGet all databases for a cluster
Parameters
Path parameters
accountId
required
stringclusterId
required
stringcurl --request GET \
"https://console.influxdata.com/api/v0/accounts/{accountId}/clusters/{clusterId}/databases" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
code
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
string/accounts/{accountId}/clusters/{clusterId}/databasesCreate a database
Create a database for a cluster.
The database name must be unique within the cluster.
Default maximum number of columns: 250 Default maximum number of tables: 500
The retention period is specified in nanoseconds. For example, to set a retention period of 1 hour, use 3600000000000.
InfluxDB Cloud Dedicated lets you define a custom partitioning strategy for each database and table. A partition is a logical grouping of data stored in Apache Parquet. By default, data is partitioned by day, but, depending on your schema and workload, customizing the partitioning strategy can improve query performance.
To use custom partitioning, you define a partition template. If a table doesn’t have a custom partition template, it inherits the database’s template. The partition template is set at the time of database creation and cannot be changed later.
Parameters
Path parameters
accountId
required
stringclusterId
required
stringRequest body required
application/jsonmaxColumnsPerTable
stringmaxTables
stringname
required
stringpartitionTemplate
stringretentionPeriod
stringcurl --request POST \
"https://console.influxdata.com/api/v0/accounts/{accountId}/clusters/{clusterId}/databases" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"maxColumnsPerTable": 200,
"maxTables": 500,
"name": "NAME",
"partitionTemplate": [],
"retentionPeriod": 0
}'Responses
accountId
required
stringclusterId
required
stringmaxColumnsPerTable
required
stringmaxTables
required
stringname
required
stringpartitionTemplate
stringretentionPeriod
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
string/accounts/{accountId}/clusters/{clusterId}/databases/{databaseId}/undeleteUndelete 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
accountId
required
stringclusterId
required
stringdatabaseId
required
stringcurl --request PUT \
"https://console.influxdata.com/api/v0/accounts/{accountId}/clusters/{clusterId}/databases/{databaseId}/undelete" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
accountId
required
stringclusterId
required
stringid
required
stringmaxColumnsPerTable
required
stringmaxTables
required
stringname
required
stringpartitionTemplate
stringretentionPeriod
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
string/accounts/{accountId}/clusters/{clusterId}/databases/{databaseName}Update a database
Parameters
Path parameters
accountId
required
stringclusterId
required
stringdatabaseName
required
stringRequest body required
application/jsonmaxColumnsPerTable
stringmaxTables
stringretentionPeriod
stringcurl --request PATCH \
"https://console.influxdata.com/api/v0/accounts/{accountId}/clusters/{clusterId}/databases/{databaseName}" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"maxColumnsPerTable": 200,
"maxTables": 500,
"retentionPeriod": 0
}'Responses
accountId
required
stringclusterId
required
stringmaxColumnsPerTable
required
stringmaxTables
required
stringname
required
stringretentionPeriod
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
string/accounts/{accountId}/clusters/{clusterId}/databases/{databaseName}Delete a database
Parameters
Path parameters
accountId
required
stringclusterId
required
stringdatabaseName
required
stringcurl --request DELETE \
"https://console.influxdata.com/api/v0/accounts/{accountId}/clusters/{clusterId}/databases/{databaseName}" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
code
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
string/accounts/{accountId}/clusters/{clusterId}/databases/{databaseName}/renameRename a database
Renames an existing database.
This operation can only be performed on databases that are currently active.
Parameters
Path parameters
accountId
required
stringclusterId
required
stringdatabaseName
required
stringRequest body required
application/jsonname
required
stringcurl --request PUT \
"https://console.influxdata.com/api/v0/accounts/{accountId}/clusters/{clusterId}/databases/{databaseName}/rename" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"name": "NAME"
}'Responses
accountId
required
stringclusterId
required
stringid
required
stringmaxColumnsPerTable
required
stringmaxTables
required
stringname
required
stringpartitionTemplate
stringretentionPeriod
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringcode
required
integermessage
required
stringWas this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for InfluxDB Cloud Dedicated and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.