Trim a dataset
Trim a dataset
Drop everything older than a cutoff, without changing retention.
A one-off delete of old blocks. Use it to reclaim spend after a runaway sender, without permanently lowering the retention window.
Irreversible
Trimmed blocks are gone. There is no undo and no grace period.
POST
/v1/datasets/{name}/trimPath parameters
namestringrequiredDataset name or ds_….
Body parameters
max_durationstringrequiredKeep only this much history, e.g. 7d, 48h.
curl -X POST https://api.logstreem.com/v1/datasets/{name}/trim \
-H "Authorization: Bearer $LOGSTREEM_TOKEN" \
-H "Content-Type: application/json" \
-d '{"max_duration":"7d"}'Responses
200OK
{
"object": "dataset",
"id": "ds_9f2c7b1a4d8e0c3f6a5b",
"trimmed_blocks": 1284
}401Unauthorized
{
"error": {
"type": "authentication_error",
"code": "missing_token",
"message": "No API token provided.",
"doc_url": "https://logstreem.com/docs/errors#missing_token",
"request_id": "req_9f3c2a7b41de08c5b2e6"
}
}Try itsandbox