Every usage and cost data point you see in Account Management is also available via the Dynatrace Account Management API. This means you can pull your consumption data into any tool your organization already uses (FinOps platforms, finance systems, chargeback reports, or custom dashboards) without manual exports. Common use cases include:
By the end of this tutorial, you will be able to:
curl.curl, or any HTTP clientThe Account Management API exposes the following data categories relevant for FinOps use cases:
| Data category | API endpoint area | Typical FinOps use case |
|---|---|---|
Subscription details |
| Budget baseline: total commitment, period, days remaining |
Daily costs |
| Spend tracking, burn-rate calculation, period-over-period comparison |
Usage by capability |
| Allocation, chargeback, anomaly detection per capability |
Usage by environment |
| Showback per team or product environment |
You can also explore all available endpoints directly in the API Explorer in Account Management or via the Account Management API documentation.
Access to the Account Management API requires an OAuth client with the account-uac-read scope.
In your Dynatrace environment, select your user name in the bottom-left corner, then select Account Management.
Go to Identity & access management > OAuth clients.
Select Create client and enter:
account-uac-read).Select Create client. Copy and store the following values securely. You can only access them once:
Save your Account UUID, which visible in the browser address bar in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
Store your client secret securely. It cannot be retrieved after creation.
Access tokens are short-lived (5 minutes) and must be requested before each API call.
To request an access token, run the following curl command:
curl -X POST "https://sso.dynatrace.com/sso/oauth2/token" \-H "Content-Type: application/x-www-form-urlencoded" \-d "grant_type=client_credentials" \-d "client_id=<YOUR_CLIENT_ID>" \-d "client_secret=<YOUR_CLIENT_SECRET>" \-d "resource=urn:dtaccount:<YOUR_ACCOUNT_UUID>"
The response contains your access_token:
{"access_token": "dt0s01.XXXX...","token_type": "Bearer","expires_in": 300}
Use the access_token value in the Authorization header for all subsequent API calls.
You can now use the API to query subscription details, daily costs, and usage by capability.
Run the following curl command to get your active subscription UUID and budget status:
curl -X GET "https://api.dynatrace.com/sub/v2/accounts/<ACCOUNT_UUID>/subscriptions" \-H "Authorization: Bearer <ACCESS_TOKEN>"
The response includes:
uuid: your subscription UUID, needed for cost and usage queries.budget.total: your annual commitment.budget.used: spend to date.currentPeriod.daysRemaining: days left in the current subscription period.Run the following curl command to get costs broken down by day for the active subscription:
curl -X GET "https://api.dynatrace.com/sub/v2/accounts/<ACCOUNT_UUID>/subscriptions/<SUBSCRIPTION_UUID>/cost" \-H "Authorization: Bearer <ACCESS_TOKEN>"
Each record in the response represents one day and contains:
startTime / endTime: the day covered.value: monetary cost for that day (in your subscription's currency).capability: which DPS capability incurred the cost.Get raw metered usage across capabilities:
curl -X GET "https://api.dynatrace.com/sub/v2/accounts/<ACCOUNT_UUID>/subscriptions/<SUBSCRIPTION_UUID>/usage" \-H "Authorization: Bearer <ACCESS_TOKEN>"
Filter by environment or capability using query parameters. See the Account Management API reference for the full parameter list.
Use daily cost data for financial reporting and chargeback. Use usage data when you need the raw metered units (for example, GiB-hours or host-hours) for capacity planning.