execute_record_deletion
Permanently deletes Grail records selected by a DQL query within a specified timeframe. Data cannot be restored; returns a task ID to track progress.
Instructions
DESTRUCTIVE — permanently deletes Grail records matching the given DQL query and optional timeframe. Data that is deleted CANNOT be restored. Timeframe length is limited to 24 hours; end time must be at least 4 hours in the past. Subsequent requests are queued and executed in order. Returns a taskId to track deletion progress via get_record_deletion_status. Requires DT_ENABLE_WRITES=true. Required scopes: storage:records:delete, storage:events:read, storage:logs:read, storage:bizevents:read, storage:spans:read, storage:buckets:read. Allowed query commands: fetch, fields, fieldsAdd, fieldsRemove, filter, parse.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | DQL query that selects the records to delete. Example: "fetch logs | filter contains(content, \"delete_records_test\")" | |
| timeFrame | No | Optional explicit time frame for the deletion. Ignored if the query already contains a timeframe clause. Both start and end are required when this object is provided. | |
| timezone | No | Timezone for the query. Defaults to 'UTC'. | |
| locale | No | Locale for the query. Defaults to 'en-US'. |