Update Cluster token

This API call updates the specified Dynatrace Cluster token. You can:

  • Change the token name.
  • Revoke the token.
    A revoked token still exists in the environment, but it can't be used.
  • Change the scope of a token.

Authentication

To execute this request, you need the Cluster token management (ClusterTokenManagement) permission assigned to your API token. Generate your API token via Cluster Management Console (CMC). To learn how to obtain and use it, see Cluster API - Authentication.

Endpoint

/api/cluster/v2/tokens

Parameters

ParameterTypeDescriptionInRequired
idstring

The ID of the token to be updated.

You can't update the token you're using for authentication of the request.

pathrequired
bodyUpdateToken

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

bodyrequired

Request body objects

The UpdateToken object

ElementTypeDescriptionRequired
revokedboolean

The token is revoked (true) or active (false).

optional
namestring

The name of the token.

optional
scopesstring[]

The list of permissions assigned to the token.

Apart from the new permissions, you need to submit the existing permissions you want to keep, too. Any existing permission, missing in the payload, is revoked.

  • 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.
  • activeGateTokenManagement.read: Read ActiveGate tokens.
  • activeGateTokenManagement.create: Create ActiveGate tokens.
  • activeGateTokenManagement.write: Write ActiveGate tokens.
  • settings.read: Read settings.
  • settings.write: Write settings.
  • apiTokens.read: Read API tokens.
  • apiTokens.write: Write API tokens.
  • DiagnosticExport
  • ControlManagement
  • UnattendedInstall
  • ServiceProviderAPI
  • ExternalSyntheticIntegration
  • ClusterTokenManagement
  • ReadSyntheticData
  • Nodekeeper
  • EnvironmentTokenManagement
  • activeGateTokenManagement.read
  • activeGateTokenManagement.create
  • activeGateTokenManagement.write
  • settings.read
  • settings.write
  • apiTokens.read
  • apiTokens.write
optional

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

{
"revoked": true,
"name": "string",
"scopes": [
"DiagnosticExport"
]
}

Response

Response codes

CodeTypeDescription
204-

Success. The token has been updated.

400ErrorEnvelope

Failed. You can't update the token you're using for authentication of the request.

404ErrorEnvelope

Failed. The requested token has not been found.

Example

In this example, the request queries the metadata of the specific token, which has the ID of 4e9f128e-04f9-4795-pj319-8b7c-3c14a5e885e4. It changes the token scope by updating the token metadata. The name and validity of the token remain intact. The response code of 204 indicates that the update was successful.

Curl

curl -X PUT "https://myManaged.cluster.com/api/cluster/v2/tokens/4e9f128e-04f9-4795-pj319-8b7c-3c14a5e885e4"
-H "accept: application/json; charset=utf-8"
-H "Content-Type: application/json; charset=utf-8"
-d "{ \"revoked\": \"true\", \"name\": \"updated token\", \"scopes\": [ \"UnattendedInstall\" ]}"

Request URL

https://myManaged.cluster.com/api/cluster/v2/tokens/4e9f128e-04f9-4795-pj319-8b7c-3c14a5e885e4

Request body

{
"revoked": "true",
"name": "updated token",
"scopes": ["UnattendedInstall"]
}

Response code

204