Delete data from a timeless account
POST/v1/timeless-indices/:id/delete-data
Deletes the documents of a timeless account that match a time range and the optimizers that wrote them, and returns the number of documents to be deleted. Deleted data can't be restored.
optimizerIdsis required. Send the IDs of the optimizers whose data to delete, or an empty list to delete the data of every optimizer.- Send both
timeFrameFromandtimeFrameToto delete within a time range, or leave both out to delete regardless of time. The range is inclusive and matches the@timestampof each document.
Run Preview a data deletion from a timeless account with the same request first to see how many documents it matches.
Only documents whose log type is the timeless account's current logType are deleted. This is the log type an optimizer writes with when its output.target.timelessIndex.logType is the timeless account's logType, as Create an optimizer requires.
The deletion runs in the background, so the documents disappear over the next minutes, and the account's used storage goes down after that.
Must be run with an API token that has the Admin role. API tokens created before token roles were introduced have the same permissions as Admin.
Please ensure to change the region in the URL to match your account's region.
Request
Path Parameters
The id of the timeless account. Get it from List the timeless accounts of an account.
- application/json
Body
required
The IDs of the optimizers whose data to match. Send an empty list to match the data of every optimizer.
The start of the time range, in ISO 8601 format. Send it together with timeFrameTo, or leave both out to match any time.
The end of the time range, in ISO 8601 format. Send it together with timeFrameFrom, or leave both out to match any time.
Responses
- 200
- 400
- 403
successful operation. Returns the number of documents to be deleted.
- application/json
- Schema
Schema
integer
Bad Request. optimizerIds is missing, only one of timeFrameFrom and timeFrameTo is set, or timeFrameFrom is after timeFrameTo.
- application/json
- Schema
- Example (from schema)
Schema
{
"code": 400,
"message": "timeFrameFrom and timeFrameTo must be sent together, or both left out to match any time",
"requestId": "0e1f7a3b-2b6c-4a63-9b4e-6d1c2f0a9e11"
}
Forbidden. The API token in the request does not have the Admin role ("Insufficient privileges"), or the timeless account doesn't exist or belongs to another account (Timeless account N does not belong to this account).
- application/json
- Schema
- Example (from schema)
Schema
The HTTP status code
The ID of the request, for Logz.io support
{
"code": 403,
"message": "Insufficient privileges",
"requestId": "0e1f7a3b-2b6c-4a63-9b4e-6d1c2f0a9e11"
}