Create a new tenant token

Creates a new tenant management token for an environment.

Endpoint

/api/cluster/v2/environments

Parameter

Parameter Type Description In Required
id string

The ID of the environment where the token is valid.

path required
body CreateEnvironmentTokenManagementToken

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

body optional

Body format

The CreateEnvironmentTokenManagementToken object

Element Type Description Required
name string

The name of the token.

required
expiresIn Duration optional

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.

optional

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

The Token object

Element Type Description
token string

Dynatrace API authentication token.

Example

Creates a new tenant management token for the environment 19a963a7-b19f-4382-964a-4df674c8eb8e.

Curl

curl -X POST "https://myManaged.cluster.com/api/cluster/v2/environments/19a963a7-b19f-4382-964a-4df674c8eb8e/tokenManagementToken" -H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890" -H "Content-Type: application/json; charset=utf-8" -d "{\"name\":\"Token Management\",\"expiresIn\":{\"value\":3600,\"unit\":\"SECONDS\"}}"

Request URL

https://myManaged.cluster.com/api/cluster/v2/environments/19a963a7-b19f-4382-964a-4df674c8eb8e/tokenManagementToken

Request body

{
  "name": "Token Management",
  "expiresIn": {
    "value": 3600,
    "unit": "SECONDS"
  }
}

Response body

{
  "token": "dt0c01.RVSDGWUQEVQFS4CWIZTKX5DV.<token-value>"
}

Response code

201