Metrics API - DELETE ingested metrics

  • Reference
  • Published Jan 16, 2026

Dynatrace version 1.330+

Deletes ingested metrics older than the specified number of days.

  • You can only delete metrics that have been ingested via the Metrics v2 API.
  • Deleted metrics cannot be restored.
DELETEManagedDynatrace for Governmenthttps://{your-domain}/e/{your-environment-id}/api/v2/metrics
Environment and Cluster ActiveGate (default port 9999)https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/metrics

Authentication

To execute this request, you need an access token with metrics.write scope.

To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
metricSelectorstring

The key of the required metric.

queryRequired
minUnusedDaysinteger

The key of the required metric.

queryOptional

Response

Response codes

CodeTypeDescription
202-

Success. The deletion of the metrics has been triggered.

400-

Failed.

500-

Failed. The bulk-deletion failed.

4XXErrorEnvelope

Client side error.

5XXErrorEnvelope

Server side error.

Example

In this example, the request deletes all metrics that have not been written in the last 60 days:

DELETE /api/v2/metrics?metricSelector=<your-selector>&minUnusedDays=60