Tables
/accounts/{accountId}/clusters/{clusterId}/databases/{databaseName}/tablesCreate a database table
Create a table. The database must already exist. With InfluxDB Cloud Dedicated, tables and measurements are synonymous.
Typically, tables are created automatically on write using the measurement name specified in line protocol written to InfluxDB. However, to apply a custom partition template to a table, you must manually create the table with custom partitioning before you write any data to it.
Partitioning defaults to %Y-%m-%d (daily).
When a partition template is applied to a database, it becomes the default template
for all tables in that database, but can be overridden when creating a
table.
Parameters
Path parameters
accountId
required
stringclusterId
required
stringdatabaseName
required
stringRequest body required
application/jsonname
required
stringpartitionTemplate
object[]A template for partitioning a cluster database.
Each partition template part is evaluated in sequence.
The outputs from each part are concatenated with the
| delimiter to form the final partition key.
For example, using the partition template below:
[
{
"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|5time=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|8time=2023-01-01, a=%50, c=%50->2023|%2550|!|9time=2023-01-01, a=, c=->2023|^|!|0time=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.
curl --request POST \
"https://console.influxdata.com/api/v0/accounts/{accountId}/clusters/{clusterId}/databases/{databaseName}/tables" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"name": "NAME",
"partitionTemplate": [
"PARTITIONTEMPLATE"
]
}'Responses
accountId
required
string <uuid>clusterId
required
string <uuid>databaseName
required
stringname
required
stringpartitionTemplate
object[]A template for partitioning a cluster database.
Each partition template part is evaluated in sequence.
The outputs from each part are concatenated with the
| delimiter to form the final partition key.
For example, using the partition template below:
[
{
"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|5time=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|8time=2023-01-01, a=%50, c=%50->2023|%2550|!|9time=2023-01-01, a=, c=->2023|^|!|0time=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.
code
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/{databaseName}/tables/{tableId}/undeleteUndelete 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
accountId
required
stringclusterId
required
stringdatabaseName
required
stringtableId
required
integer <int64>curl --request PUT \
"https://console.influxdata.com/api/v0/accounts/{accountId}/clusters/{clusterId}/databases/{databaseName}/tables/{tableId}/undelete" \
--header "Authorization: Bearer INFLUX_TOKEN"Responses
accountId
required
string <uuid>clusterId
required
string <uuid>databaseName
required
stringid
required
integer <int64>name
required
stringpartitionTemplate
object[]A template for partitioning a cluster database.
Each partition template part is evaluated in sequence.
The outputs from each part are concatenated with the
| delimiter to form the final partition key.
For example, using the partition template below:
[
{
"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|5time=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|8time=2023-01-01, a=%50, c=%50->2023|%2550|!|9time=2023-01-01, a=, c=->2023|^|!|0time=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.
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}/tables/{tableName}Delete a database table
Parameters
Path parameters
accountId
required
stringclusterId
required
stringdatabaseName
required
stringtableName
required
stringcurl --request DELETE \
"https://console.influxdata.com/api/v0/accounts/{accountId}/clusters/{clusterId}/databases/{databaseName}/tables/{tableName}" \
--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}/tables/{tableName}/renameRename a database table
Parameters
Path parameters
accountId
required
stringclusterId
required
stringdatabaseName
required
stringtableName
required
stringRequest body required
application/jsonname
required
stringcurl --request PUT \
"https://console.influxdata.com/api/v0/accounts/{accountId}/clusters/{clusterId}/databases/{databaseName}/tables/{tableName}/rename" \
--header "Authorization: Bearer INFLUX_TOKEN" \
--header "Content-Type: application/json" \
--data-raw '{
"name": "NAME"
}'Responses
accountId
required
string <uuid>clusterId
required
string <uuid>databaseName
required
stringid
required
integer <int64>name
required
stringpartitionTemplate
object[]A template for partitioning a cluster database.
Each partition template part is evaluated in sequence.
The outputs from each part are concatenated with the
| delimiter to form the final partition key.
For example, using the partition template below:
[
{
"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|5time=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|8time=2023-01-01, a=%50, c=%50->2023|%2550|!|9time=2023-01-01, a=, c=->2023|^|!|0time=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.
code
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.