Create new Cluster token

Creates a new Dynatrace Cluster token. The response contains the newly created token.

The request consumes and produces an application/json payload.

Endpoint

/api/cluster/v1/tokens

Parameters

Parameter Type Description In Required
body CreateToken

The JSON body of the request. Contains parameters of the new token.

body optional

Body format

The CreateToken object

Element Type Description Required
name string

The name of the token.

required
expiresIn Duration optional
scopes string[]

The list of permissions to be assigned to the token.

  • DiagnosticExport: DiagnosticExport.
  • ControlManagement: ControlManagement.
  • UnattendedInstall: UnattendedInstall.
  • ServiceProviderAPI: Service Provider API.
  • ExternalSyntheticIntegration: Create and read synthetic monitors, locations, and nodes.
  • ClusterTokenManagement: Cluster token management.
  • ReadSyntheticData: Read synthetic monitors, locations, and nodes.
  • Nodekeeper: Nodekeeper access for node management.
  • EnvironmentTokenManagement: "Token Management" Token creation for existing environments.
The scopes element can hold these values.
required

The Duration object

Defines a period of time.

Element Type Description Required
value integer

The amount of time.

required
unit string

The unit of time.

If not set, millisecond is used.

The unit element can hold these values.
optional

Possible values

Possible values for the scopes element in the CreateToken object:

  • DiagnosticExport
  • ControlManagement
  • UnattendedInstall
  • ServiceProviderAPI
  • ExternalSyntheticIntegration
  • ClusterTokenManagement
  • ReadSyntheticData
  • Nodekeeper
  • EnvironmentTokenManagement

Possible values for the unit element in the Duration object:

  • DAYS
  • HOURS
  • MILLIS
  • MINUTES
  • SECONDS

Response

Response codes

Code Description
201

Success. The token has been created. The response body contains the token itself.

400

Failed. The input is invalid. Response body provides details.

Response body

The Token object

Element Type Description
token string

Dynatrace API authentication token.

Example

In this example, the request creates a new token named Mytoken that is valid for 24 hours. With this token you will be able to perform a diagnostic export (DiagnosticExport) and unattended install (UnattendedInstall).

Curl

curl -X POST "https://myManaged.cluster.com/api/cluster/v1/tokens"
          -H "accept: application/json; charset=utf-8"
          -H "Content-Type: application/json; charset=utf-8"
          -d "{  \"name\": \"MyToken\",  \"scopes\": [    \"DiagnosticExport\",    \"UnattendedInstall\"  ],  \"expiresIn\": {    \"value\": 24,    \"unit\": \"HOURS\"  }}"

Request URL

https://myManaged.cluster.com/api/cluster/v1/tokens

Request body

api-examples/cluster/token/post-cluster-token.json
Download
{
  "name": "MyToken",
  "scopes": [
    "DiagnosticExport",
    "UnattendedInstall"
  ],
  "expiresIn": {
    "value": 24,
    "unit": "HOURS"
  }
}

Response body

{
  "token": "abcdefjhij1234567890"
}

Response code

201