Try it free

Platform tokens API - POST a platform token

  • Latest Dynatrace
  • Reference
  • Published Mar 04, 2025

Creates a new platform token for a user in your Dynatrace account.

The request consumes and produces an application/json payload.

POST

https://api.dynatrace.com/iam/v1/accounts/{accountUuid}/platform-tokens

Authentication

To execute this request, you need an OAuth client with the platform-token:tokens:manage scope assigned. For user-level authorization, the user should either have the user-management role assigned or a policy assigned that includes the statement ALLOW platform-token:tokens:manage;.

Parameters

ParameterTypeDescriptionInRequired
accountUuidstring

The ID of the required account.

You can find the UUID on the Account Management > Identity & access management > OAuth clients page, during creation of an OAuth client.

pathRequired
bodyGeneratePlatformTokenForm

Platform token creation form

bodyRequired

Request body objects

The GeneratePlatformTokenForm object

ElementTypeDescriptionRequired
namestring-Required
scopestring[]-Required
resourcestring[]-Required
tagsstring[]-Required
expirationDatestring-Required
userUuidstring-Required

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.

{
"name": "string",
"scope": [
"string"
],
"resource": [
"string"
],
"tags": [
"string"
],
"expirationDate": "string",
"userUuid": "string"
}

Response

Response codes

CodeTypeDescription
200PlatformTokenSecret

Platform token created successfully

Response body objects

The PlatformTokenSecret object

ElementTypeDescription
namestring-
tokenIdstring-
tokenstring-

Response body JSON models

{
"name": "string",
"tokenId": "string",
"token": "string"
}

Example

In this example, the request creates a new platform token for the account with accountUuid lk4oo10f-0a5t-566f-gn4f-56hy08c4hh89.

Curl

curl -X 'POST' \
'https://api.dynatrace.com/iam/v1/accounts/lk4oo10f-0a5t-566f-gn4f-56hy08c4hh89/platform-tokens' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eywedGciOiJFUzI1NiIsInR7cCI6IkpCDVIsImtpZCI6IjEifQ' \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"scope": [
"scope_1"
],
"resource": [
"resource_1"
],
"tags": [
"tags"
],
"expirationDate": "2026-03-04T09:51:24.938Z",
"userUuid": "aactID_1"
}'

Request URL

https://api.dynatrace.com/iam/v1/accounts/lk4oo10f-0a5t-566f-gn4f-56hy08c4hh89/platform-tokens

Request body

{
"name": "PT_001",
"scope": [
"settings:objects:read"
],
"resource": [
"urn:dtaccount:lk4oo10f-0a5t-566f-gn4f-56hy08c4hh89"
],
"tags": [
"string"
],
"expirationDate": "2026-03-04T10:17:15.591Z",
"userUuid": "string"
}

Response body

{
"tokenId": "dt0s34.DEFO9UBH",
"accountUuid": "lk4oo10f-0a5t-566f-gn4f-56hy08c4hh89",
"name": "PT_MCP",
"scope": [
"settings:objects:read",
],
"resource": [
"urn:dtaccount:lk4oo10f-0a5t-566f-gn4f-56hy08c4hh89"
],
"status": "ACTIVE",
"expirationDate": "2026-12-01T00:00:00Z",
"createdAt": "2025-06-23T11:10:21Z",
"updatedAt": "2025-12-23T11:10:21Z",
"createdBy": "test.abc@dynatrace.com",
"owner": "test.abc@dynatrace.com",
"metadata": {
"lastUsedAt": null,
"lastClientIp": null
}
},

Response code

200