The Management API for InfluxDB Cloud Dedicated provides a programmatic interface for managing an InfluxDB Cloud Dedicated instance.
The InfluxDB v3 Management API lets you manage an InfluxDB Cloud Dedicated instance and integrate functions such as creating and managing databases, permissions, and tokens into your workflow or application.
This documentation is generated from the InfluxDB OpenAPI specification.
The InfluxDB Management API endpoints require the following credentials:
ACCOUNT_ID
: The ID of the account that the cluster belongs to. To view account ID and cluster ID, list cluster details.
CLUSTER_ID
: The ID of the cluster that you want to manage. To view account ID and cluster ID, list cluster details.
Authorization MANAGEMENT_TOKEN
: the Authorization
HTTP header with a management token.
See how to create a management token.
By default, management tokens in InfluxDB v3 are short-lived tokens issued by an OAuth2 identity provider that grant a specific user administrative access to your InfluxDB cluster. However, for automation purposes, you can manually create management tokens that authenticate directly with your InfluxDB cluster and do not require human interaction with your identity provider.
accountId required | string <uuid> (UuidV4) The ID of the account to get the database tokens for |
clusterId required | string <uuid> (UuidV4) The ID of the cluster to get the database tokens for |
HOST="https://console.influxdata.com" list_tokens () { local response=$( \ curl \ --location "$HOST/api/v0/accounts/$ACCOUNT_ID/clusters/$CLUSTER_ID/tokens" \ --header "Accept: application/json" \ --header "Authorization: Bearer $MANAGEMENT_TOKEN" \ ) echo "$response" }
[- {
- "accountId": "11111111-1111-4111-8111-111111111111",
- "clusterId": "33333333-3333-4333-8333-333333333333",
- "id": "55555555-5555-4555-8555-555555555555",
- "description": "Limited Access Token",
- "permissions": [
- {
- "action": "read",
- "resource": "DatabaseOne"
}, - {
- "action": "write",
- "resource": "DatabaseTwo"
}
], - "createdAt": "2023-12-21T17:32:28.000Z"
}, - {
- "accountId": "11111111-1111-4111-8111-111111111111",
- "clusterId": "33333333-3333-4333-8333-333333333333",
- "id": "66666666-6666-4666-8666-666666666666",
- "description": "Full Access Token",
- "permissions": [
- {
- "action": "write",
- "resource": "*"
}
], - "createdAt": "2024-03-02T04:20:19.000Z"
}, - {
- "accountId": "11111111-1111-4111-8111-111111111111",
- "clusterId": "33333333-3333-4333-8333-333333333333",
- "id": "77777777-7777-4777-8777-777777777777",
- "description": "No Access Token",
- "permissions": [ ],
- "createdAt": "2024-03-02T04:20:19.000Z"
}
]
Create a database token for a cluster.
The token returned on the accessToken
property in the response can be used to authenticate query and write requests to the cluster.
InfluxDB might take some time--from a few seconds to a few minutes--to activate and synchronize new tokens. If a new database token doesn't immediately work (you receive a 401 Unauthorized
error) for querying or writing, wait and then try your request again.
Token strings are viewable only on token creation and aren't stored by InfluxDB; you can't recover a lost token.
We recommend storing database tokens in a secure secret store. For example, see how to authenticate Telegraf using tokens in your OS secret store.
If you lose a token, delete the token from InfluxDB and create a new one.
accountId required | string <uuid> (UuidV4) The ID of the account to create the database token for |
clusterId required | string <uuid> (UuidV4) The ID of the cluster to create the database token for |
description required | string (schemas) The description of the database token |
Array of objects (schemas) The list of permissions the database token allows |
{- "description": "Limited Access Token",
- "permissions": [
- {
- "action": "read",
- "resource": "DatabaseOne"
}, - {
- "action": "write",
- "resource": "DatabaseTwo"
}
]
}
{- "accountId": "11111111-1111-4111-8111-111111111111",
- "clusterId": "33333333-3333-4333-8333-333333333333",
- "id": "55555555-5555-4555-8555-555555555555",
- "description": "Limited Access Token",
- "permissions": [
- {
- "action": "read",
- "resource": "DatabaseOne"
}, - {
- "action": "write",
- "resource": "DatabaseTwo"
}
], - "createdAt": "2023-12-21T17:32:28.000Z",
- "accessToken": "apiv1_5555555555555555555555555555555555555555555555555555555555555555"
}
accountId required | string <uuid> (UuidV4) The ID of the account that the database token belongs to |
clusterId required | string <uuid> (UuidV4) The ID of the cluster that the database token belongs to |
tokenId required | string <uuid> (UuidV4) The ID of the database token to get |
HOST="https://console.influxdata.com" get_token () { local tokenId=$1 local response=$( \ curl \ --location "$HOST/api/v0/accounts/$ACCOUNT_ID/clusters/$CLUSTER_ID/tokens/$tokenId" \ --header "Accept: application/json" \ --header "Authorization: Bearer $MANAGEMENT_TOKEN" \ ) echo "$response" }
{- "accountId": "11111111-1111-4111-8111-111111111111",
- "clusterId": "33333333-3333-4333-8333-333333333333",
- "id": "55555555-5555-4555-8555-555555555555",
- "description": "Limited Access Token",
- "permissions": [
- {
- "action": "read",
- "resource": "DatabaseOne"
}, - {
- "action": "write",
- "resource": "DatabaseTwo"
}
], - "createdAt": "2023-12-21T17:32:28.000Z"
}
accountId required | string <uuid> (UuidV4) The ID of the account that the database token belongs to |
clusterId required | string <uuid> (UuidV4) The ID of the cluster that the database token belongs to |
tokenId required | string <uuid> (UuidV4) The ID of the database token to update |
description | string (schemas) The description of the database token |
Array of objects (schemas) The list of permissions the database token allows |
{- "description": "Updated Limited Access Token",
- "permissions": [
- {
- "action": "write",
- "resource": "DatabaseOne"
}, - {
- "action": "read",
- "resource": "DatabaseTwo"
}, - {
- "action": "write",
- "resource": "DatabaseThree"
}
]
}
{- "accountId": "11111111-1111-4111-8111-111111111111",
- "clusterId": "33333333-3333-4333-8333-333333333333",
- "id": "55555555-5555-4555-8555-555555555555",
- "description": "Updated Limited Access Token",
- "permissions": [
- {
- "action": "write",
- "resource": "DatabaseOne"
}, - {
- "action": "read",
- "resource": "DatabaseTwo"
}, - {
- "action": "write",
- "resource": "DatabaseThree"
}
], - "createdAt": "2023-12-21T17:32:28.000Z"
}
accountId required | string <uuid> (UuidV4) The ID of the account that the database token belongs to |
clusterId required | string <uuid> (UuidV4) The ID of the cluster that the database token belongs to |
tokenId required | string <uuid> (UuidV4) The ID of the database token to delete |
HOST="https://console.influxdata.com" delete_token () { local tokenId=$1 local response=$( \ curl \ --location "$HOST/api/v0/accounts/$ACCOUNT_ID/clusters/$CLUSTER_ID/tokens/$tokenId" \ --request DELETE \ --header "Accept: application/json" \ --header "Authorization: Bearer $MANAGEMENT_TOKEN" \ ) echo "$response" }
{- "code": 400,
- "message": "bad request"
}
accountId required | |
clusterId required | string <uuid> (UuidV4) The ID of the cluster to get the databases for |
HOST="https://console.influxdata.com" list_databases () { local response=$( \ curl \ --location "$HOST/api/v0/accounts/$ACCOUNT_ID/clusters/$CLUSTER_ID/databases" \ --header "Accept: application/json" \ --header "Authorization: Bearer $MANAGEMENT_TOKEN" \ ) echo "$response" }
[- {
- "accountId": "11111111-1111-4111-8111-111111111111",
- "clusterId": "33333333-3333-4333-8333-333333333333",
- "name": "DatabaseOne",
- "maxTables": 500,
- "maxColumnsPerTable": 200,
- "retentionPeriod": 0
}, - {
- "accountId": "11111111-1111-4111-8111-111111111111",
- "clusterId": "33333333-3333-4333-8333-333333333333",
- "name": "DatabaseTwo",
- "maxTables": 100,
- "maxColumnsPerTable": 50,
- "retentionPeriod": 300000000000,
- "partitionTemplate": [
- {
- "type": "time",
- "value": "%Y"
}, - {
- "type": "tag",
- "value": "bananas"
}, - {
- "type": "tag",
- "value": "plátanos"
}, - {
- "type": "bucket",
- "value": {
- "tagName": "c",
- "numberOfBuckets": 10
}
}
]
}
]
accountId required | string <uuid> (UuidV4) The ID of the account to create the database for |
clusterId required | string <uuid> (UuidV4) The ID of the cluster to create the database for |
maxColumnsPerTable | integer <int32> (schemas) >= 1 Default: 200 The maximum number of columns per table for the cluster database |
maxTables | integer <int32> (schemas) >= 1 Default: 500 The maximum number of tables for the cluster database |
name required | string (schemas) [ 1 .. 64 ] characters The name of the cluster database |
Array of ClusterDatabasePartitionTemplatePartTagValue (object) or ClusterDatabasePartitionTemplatePartTimeFormat (object) or ClusterDatabasePartitionTemplatePartBucket (object) (schemas) [ 1 .. 8 ] items unique 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:
The following partition keys are derived:
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. [ | |
retentionPeriod | integer <int64> (schemas) >= 0 Default: 0 The retention period of the cluster database in nanoseconds, if applicable If the retention period is not set or is set to 0, the database will have infinite retention |
{- "name": "DatabaseOne"
}
{- "accountId": "11111111-1111-4111-8111-111111111111",
- "clusterId": "33333333-3333-4333-8333-333333333333",
- "name": "DatabaseOne",
- "maxTables": 500,
- "maxColumnsPerTable": 200,
- "retentionPeriod": 0
}
accountId required | string <uuid> (UuidV4) The ID of the account that the database belongs to |
clusterId required | string <uuid> (UuidV4) The ID of the cluster that the database belongs to |
databaseName required | string (ClusterDatabaseName) [ 1 .. 64 ] characters The name of the database to update |
maxColumnsPerTable | integer <int32> (schemas) >= 1 Default: 200 The maximum number of columns per table for the cluster database |
maxTables | integer <int32> (schemas) >= 1 Default: 500 The maximum number of tables for the cluster database |
retentionPeriod | integer <int64> (schemas) >= 0 Default: 0 The retention period of the cluster database in nanoseconds, if applicable If the retention period is not set or is set to 0, the database will have infinite retention |
{- "maxTables": 300,
- "maxColumnsPerTable": 150,
- "retentionPeriod": 600000000000
}
{- "accountId": "11111111-1111-4111-8111-111111111111",
- "clusterId": "33333333-3333-4333-8333-333333333333",
- "name": "DatabaseOne",
- "maxTables": 300,
- "maxColumnsPerTable": 150,
- "retentionPeriod": 600000000000
}
accountId required | string <uuid> (UuidV4) The ID of the account that the database belongs to |
clusterId required | string <uuid> (UuidV4) The ID of the cluster that the database belongs to |
databaseName required | string (ClusterDatabaseName) [ 1 .. 64 ] characters The name of the database to delete |
HOST="https://console.influxdata.com" delete_database () { local databaseName=$1 local response=$( \ curl \ --location "$HOST/api/v0/accounts/$ACCOUNT_ID/clusters/$CLUSTER_ID/databases/$databaseName" \ --request DELETE \ --header "Accept: application/json" \ --header "Authorization: Bearer $MANAGEMENT_TOKEN" \ ) echo "$response" }
{- "code": 400,
- "message": "bad request"
}
accountId required | string <uuid> (UuidV4) The ID of the account to create the database table for |
clusterId required | string <uuid> (UuidV4) The ID of the cluster to create the database table for |
databaseName required | string (ClusterDatabaseName) [ 1 .. 64 ] characters The name of the database to create the database table for |
name required | string (schemas) non-empty The name of the cluster database table |
Array of ClusterDatabasePartitionTemplatePartTagValue (object) or ClusterDatabasePartitionTemplatePartTimeFormat (object) or ClusterDatabasePartitionTemplatePartBucket (object) (schemas) [ 1 .. 8 ] items unique 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:
The following partition keys are derived:
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. [ |
{- "name": "TableOne"
}
{- "accountId": "11111111-1111-4111-8111-111111111111",
- "clusterId": "33333333-3333-4333-8333-333333333333",
- "databaseName": "DatabaseOne",
- "name": "TableOne"
}