Skip to content

Free tier cleanup: report or delete

POST
/v1/admin/retention
curl --request POST \
--url https://beta-api.plune.ai/v1/admin/retention \
--header 'Content-Type: application/json' \
--cookie plune_session=<plune_session> \
--data '{ "dryRun": true }'

The Free tier keeps 30 days of runs and 200 000 results per account (#1049). A run of a Free account is deleted for good when it is older than 30 days by started_at, or when it and the runs newer than it, in all the account’s projects, add up to more than 200 000 results. The newest run and any run still going are kept, and an account on a paid tier (also in its grace, or switched off by hand) is never touched. The cleanup holds an owner only while a letter can still go (#2111): an account or company whose paid tier ended is held, and counted in held.waiting, until a letter for the date of that end has gone to a live owner, or 3 days after that date; past that, or with nobody left to write to, it is cleaned without a letter and counted in unlettered. One that never had a paid tier owes none. dryRun: true deletes nothing and answers per project how many runs, results and bytes of files a pass would remove. dryRun: false deletes, through the cascade the Bin and the nightly purge share, and writes one summary row to each project’s log; it is refused with 409 retention_not_enabled until the operator sets TIER_RETENTION_ENFORCE=true. The worker runs the same pass every night at 03:00 UTC, as a report only until that switch is on. The owner’s session or an admin token with the retention door; anyone else is told 404. Ten a minute.

Media type application/json
object
dryRun
required

True: report only. false: delete (409 until TIER_RETENTION_ENFORCE=true)

boolean
Examples
Example report

The report

{
"dryRun": true
}

What the pass would delete (mode: report) or deleted (mode: delete)

Media type application/json
object
mode
required
string
Allowed values: report delete
accounts
required

Free accounts the pass went through; the held ones are not among them, the unlettered ones are

integer
projects
required

Only projects with something to remove

Array<object>
object
projectId
required
string
runs
required
integer
results
required
integer
fileBytes
required

Files of those results, in the database and in the customer’s bucket

integer
byAge
required

Runs older than 30 days

integer
byLimit
required

Runs over the 200 000-result limit

integer
totals
required
object
runs
required
integer
results
required
integer
fileBytes
required
integer
held
required

Free accounts and companies left alone this pass, in a report as in a deletion, because their paid tier (or a switch-off) ended and the letter for that date can still go (#2111): nothing of theirs is in projects or totals

object
waiting
required

No letter for the date of that end has gone to a live owner or manager yet, and one still can: a letter goes until 3 days after that date. The nightly letter opens it; past the 3 days the owner is no longer held (see unlettered)

integer
unlettered
required

Owners the pass went through (in a report, would go through) without a letter for the date of their end: nobody is left to write to (the account, or every owner and manager of the company, is in the Bin), or the 3 days a letter can still go have passed with none sent. They are counted in accounts and their projects are in projects

integer
Example
{
"mode": "report",
"accounts": 3,
"projects": [
{
"projectId": "proj_1",
"runs": 12,
"results": 5400,
"fileBytes": 10485760,
"byAge": 9,
"byLimit": 3
}
],
"totals": {
"runs": 12,
"results": 5400,
"fileBytes": 10485760
},
"held": {
"waiting": 1
},
"unlettered": 0
}

The body is not valid

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

An admin token without the retention door (code: door_not_granted)

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

Not found

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

dryRun: false while deletion is not switched on (code: retention_not_enabled)

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}

Rate-limited: the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442; the body names the plan, #2092). Retry-After carries the seconds until the window rolls over.

Media type application/json
object
error
required
string
Example generated
{
"error": "example"
}
Retry-After
integer

Seconds until the window rolls over