Creates a new ActiveGate token.
The token will be owned by the user who owns the token used to authenticate the call.
The request consumes and produces an application/json
payload.
POST | SaaS | https://{your-environment-id}.live.dynatrace.com/api/v2/activeGateTokens |
Environment ActiveGateCluster ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/activeGateTokens |
To execute this request, you need an access token with one of the following scopes:
activeGateTokenManagement.create
activeGateTokenManagement.write
To learn how to obtain and use it, see Tokens and authentication.
Parameter | Type | Description | In | Required |
---|---|---|---|---|
body | Active | The JSON body of the request. Contains parameters of the new ActiveGate token. | body | required |
ActiveGateTokenCreate
objectParameters of a new ActiveGate token.
Element | Type | Description | Required |
---|---|---|---|
activeGateType | string | The type of the ActiveGate for which the token is valid.
| required |
expirationDate | string | The expiration date of the token. You can use one of the following formats:
If not set, the token never expires. Ensure that it is not set in the past and does not exceed | optional |
name | string | The name of the token. | required |
seedToken | boolean | The token is a seed token ( We recommend the individual token option (false). | optional |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"activeGateType": "ENVIRONMENT","expirationDate": "now+6M","name": "myToken","seedToken": false}
Code | Type | Description |
---|---|---|
201 | Active | Success. The token has been created. The body of the response contains the token secret. |
400 | Error | Failed. The input is invalid. |
4XX | Error | Client side error. |
5XX | Error | Server side error. |
ActiveGateTokenCreated
objectThe newly created ActiveGate token.
Element | Type | Description |
---|---|---|
expirationDate | string | The token expiration date in ISO 8601 format ( |
id | string | The ActiveGate token identifier, consisting of prefix and public part of the token. |
token | string | The secret of the token. |
{"expirationDate": "2020-11-24T08:15:30.144Z","id": "dt0g02.4KWZO5EF","token": "dt0g02.4KWZO5EF.XT47R5DRADJIZUFOX4UDNOKTSUSABGLN7XSMJG7UXHRXKNY4WLORH4OF4T75MG7E"}
In this example, the request creates a new ActiveGate token for an environment ActiveGate. The token is valid for two weeks (14 days) from the moment of creation.
The API token is passed in the Authorization header.
curl --request GET \--url https://mySampleEnv.live.dynatrace.com//api/v2/activeGateTokens \--header 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \--header 'Content-Type: application/json' \--data '{"name": "REST test","expirationDate": "now+14d","seedToken": false,"activeGateType": "ENVIRONMENT"}'
https://mySampleEnv.live.dynatrace.com//api/v2/activeGateTokens
{"name": "REST test","expirationDate": "now+14d","seedToken": false,"activeGateType": "ENVIRONMENT"}
{"id": "dt0g02.xyz789","token": "dt0g02.xyz789.987654321zyxwvutsrq","expirationDate": "2021-12-14T13:42:31.148Z"}
201