Migrate from Tokens v1 API to Access tokens API
Tokens API v1 has been deprecated with Dynatrace version 1.242. Its replacement is Access tokens API. We recommend that you migrate to the new API at your earliest convenience.
The migration affects endpoint URLs, query parameters, and response/request body parameters, as well as the scope of the token for request authentication.
New features
The Access tokens API offers you the following new features:
- Possibility to create personal access tokens.
Improved overview of token usage with the last used IP address, which can help in identifying a leaked token.
Additional metadata for specific token types.
Base URL
new Access tokens | old Tokens v1 |
---|---|
/api/v2/apiTokens | /api/v1/tokens |
Authentication token scope
new Access tokens | old Tokens v1 |
---|---|
Read API tokens (apiTokens.read )Write API tokens ( apiTokens.write ) | Token management (TenantTokenManagement ) |
Parameters
To learn about new query/body parameters, see the documentation of individual requests in Access tokens API.
Examples
Here are some examples of differences in API usage.
Create a new token
In this example, we create a token with the Read metrics (metrics.read
) scope and a validity period of 30 days.
Query a list of tokens
In this example, we query all tokens that have been used since July 1, 2022.