Try it free

Execute record deletion

  • Latest Dynatrace
  • Reference
  • Published Oct 13, 2026

Execute record deletion in Dynatrace with the Grail Storage Record Deletion API using DQL and a time frame. It accepts the request for asynchronous processing.

POSTSaaShttps://{your-environment-id}.apps.dynatrace.com/platform/storage/record/v1/delete:execute

Overview

Execute record deletion. Removing data depends on the load and can be very time-consuming.

Timeframe length is limited to 24 hours. ISO-8601 and RFC-3339 are recommended to use. Additionally, end time must end at least 4 hours from now.

Subsequent record deletion requests are queued and executed in the order of their arrival.

Allowed query commands: fetch, fields, fieldsAdd, fieldsRemove, filter, parse

Allowed query functions: concat, contains, timestamp, timeframe, asNumber, asDouble, asLong, asString, asBoolean, toDouble, toLong, toString, toBoolean, now, matchesPhrase, matchesValue, matchesPattern

The fetch command parameters scanLimitGBytes and samplingRatio aren't available in the Record Deletion API.

Authentication

To execute this request, you need a platform token or OAuth access token with all of the following scopes:

  • storage:records:delete
  • storage:bizevents:read

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

Parameters

ParameterTypeDescriptionInRequired
bodyDeleteRecordsRequest

The request consists of the following parameters:

  • query (string, required): Specifies the query to delete records.

  • timeFrame (object, optional): Specifies the time frame for deleting records.

    • start (string, optional): The start time of the time frame in ISO 8601 or RFC-3339 format. If the timeframe end is missing then whole timeframe is ignored. If the timeframe is provided within query then it has precedence over this query request parameter. Example: "2024-04-04T00:00:00Z".
    • end (string, optional): The end time of the time frame in ISO 8601 or RFC-3339 format. If the timeframe start is missing then whole timeframe is ignored. If the timeframe is provided within query then it has precedence over this query request parameter. Example: "2024-04-04T01:00:00Z".
  • timezone (string, optional): The timezone to be used. Default is "UTC".

  • locale (string, optional): The locale to be used. Default is "en-US".

bodyRequired

Request body objects

The DeleteRecordsRequest object

ElementTypeDescriptionRequired
localestring-Optional
querystring-Required
timeFrameTimeFrame-Optional
timezonestring-Optional

The TimeFrame object

ElementTypeDescriptionRequired
endstring-Required
startstring-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.

{
"query": "fetch logs | filter contains(content, \"delete_records_test\")",
"timeFrame": {
"start": "2023-04-04T00:00:00",
"end": "2023-04-04T01:00:00"
},
"timezone": "UTC",
"locale": "en-US"
}

Response

Response codes

CodeTypeDescription
202ExecuteDeleteRecordsResponse

Accepted the record deletion request.

204-

There are no records to delete.

400ErrorEnvelope

Bad request for executing the record deletion request.

401ErrorEnvelope

Unauthorized.

403ErrorEnvelope

Access forbidden.

503ErrorEnvelope

Service unavailable.

Response body objects

The ErrorEnvelope object

ElementTypeDescription
errorExceptionalReturn-

The ExceptionalReturn object

ElementTypeDescription
codeinteger-
errorDetails(CustomValidationErrorInfo | InvalidAuditEventsErrorInfo | MediaTypeErrorInfo | ParameterErrorInfo | ProxyErrorInfo | QueryFrontendRawErrorInfo | RequestBodyErrorInfo)[]-
messagestring-

The CustomValidationErrorInfo object

The ErrorInfo object

ElementTypeDescription
messagestring-

The InvalidAuditEventsErrorInfo object

The MediaTypeErrorInfo object

The ParameterErrorInfo object

The ProxyErrorInfo object

The QueryFrontendRawErrorInfo object

The RequestBodyErrorInfo object

Response body JSON models

{
"error": {
"code": 1,
"errorDetails": [
{
"message": "string"
}
],
"message": "string"
}
}
Related tags
Platform APIDynatrace Platform