# Unattended installation/configuration/Token Mgmt

**URL:** <https://community.dynatrace.com/t/unattended-installation-configuration-token-mgmt/50137>\
**Category:** Dynatrace API\
**Tags:** installation, dynatrace-api\
**Created:** [February 6, 2025, 12:41pm UTC](https://community.dynatrace.com/t/unattended-installation-configuration-token-mgmt/50137 "2025-02-06T12:41:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xstreur](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/xstreur/32/11968_2.png) [@xstreur](https://community.dynatrace.com/u/xstreur)\
**Post date:** [February 6, 2025, 12:41pm UTC](https://community.dynatrace.com/t/unattended-installation-configuration-token-mgmt/50137/1 "2025-02-06T12:41:27Z")

</div>

- We need to do unattended installation/configuration of several Dynatrace instances (Cluster, Environment, oneAgents and activeGate).&nbsp; After the installation  
of the Cluster Server, we get a API Token, which seems to be able to do things on a cluster level. We need a token here that also makes it possible to&nbsp;continue the install/configure on a Environment level. We seem to get stuck here.

‘[https://10.0.22.24/api/cluster/v2/tokens](https://10.0.22.24/api/cluster/v2/tokens)’ \

-H ‘accept: application/json; charset=utf-8’ \

-H 'Authorization: Api-Token \<afterinstallation-Token\> \

-H ‘Content-Type: application/json; charset=utf-8’ \

-d '{

“expiresIn”: {

“unit”: “DAYS”,

“value”: 0

},

“name”: “EnvTknMgmt”,

“scopes”: [

“EnviromentTokenManagement”

]

Results:

{

“error”: {

“code”: 400,

“message”: “Could not map JSON at ‘scopes[0]’ near line 8 column 5”

}

}

---

<div class="post-metadata">

**Author:** ![xstreur](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/xstreur/32/11968_2.png) [@xstreur](https://community.dynatrace.com/u/xstreur)\
**Post date:** [February 6, 2025, 2:35pm UTC](https://community.dynatrace.com/t/unattended-installation-configuration-token-mgmt/50137/2 "2025-02-06T14:35:52Z")

</div>

Also the following does not work:

curl -X ‘POST’ \  
‘[https://10.0.22.24/api/cluster/v2/environments/66bf6127-7a37-40d9-b687-183cba58c020/tokenManagementToken](https://10.0.22.24/api/cluster/v2/environments/66bf6127-7a37-40d9-b687-183cba58c020/tokenManagementToken)’ \  
-H ‘accept: application/json; charset=utf-8’ \  
-H ‘Authorization: Api-Token dt0c01.NIUWRR7LOH7K4JZOX27FYYZZ.GMXDP65SGHVXOPEMDWZS2QGLDSPK6JBIPEBFGII75J7ZGMMYUG35KKBT3CN3RWMR’ \  
-H ‘Content-Type: application/json; charset=utf-8’ \  
-d ‘{  
“expiresIn”: {  
“unit”: “SECONDS”,  
“value”: 3600  
},  
“name”: “Token Management”  
}’

This comes with a 403:

{  
“error”: {  
“code”: 403,  
“message”: “Token is missing required scope. Use one of: EnvironmentTokenManagement (\“Token Management\” Token creation for existing environments)”  
}  
}

---

<div class="post-metadata">

**Author:** ![mark\_bley](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mark_bley/32/20954_2.png) [@mark\_bley](https://community.dynatrace.com/u/mark_bley)\
**Post date:** [February 7, 2025, 1:09am UTC](https://community.dynatrace.com/t/unattended-installation-configuration-token-mgmt/50137/3 "2025-02-07T01:09:59Z")

</div>

You have typo (_Envir **oment** TokenManagement_), it should be&nbsp;_EnvironmentTokenManagement_ for the scope.

For the follow up you are using a Cluster token without the right scope.

Also even if it is just local cluster I would advise against posting tokens publicly.

> **[Create new Cluster token](https://docs.dynatrace.com/managed/dynatrace-api/cluster-api/cluster-api-v2/cluster-tokens/create-cluster-tokens)**
>
> Learn how to create new Dynatrace Cluster token using API.
