Empty the Bin — for good, a piece at a time
const url = 'https://beta-api.plune.ai/v1/bin/empty';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"confirm":"default","dryRun":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://beta-api.plune.ai/v1/bin/empty \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "confirm": "default", "dryRun": true }'Delete forever the entries of the caller’s project’s Bin a piece at a time: the cases deleted on their own first, then the runs, then the suites, the oldest first within each kind. A call takes up to limit root items (500, also the default) from the front of that order — so a Bin bigger than that loses its cases before its runs and its runs before its suites — in transactions of at most 200, and answers how many are left of each kind. A big Bin is emptied by calling again while remaining is not zero; a suite entry that had to stay (skipped) is still counted there, so a client stops when a call deleted nothing. confirm must be the name of the project, exactly — anything else is 400 and nothing is deleted. Who may, and what is and is not deleted, are as for POST /v1/bin/purge; so is dryRun, except that here it is one transaction over every entry the call would take — up to 500 root items — and holds the real locks until it rolls back, where the real call works in transactions of at most 200.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”Empty the project’s Bin (#1020) a piece at a time: cases deleted on their own first, then runs, then suites, the oldest first within each kind — so when limit is smaller than the Bin, the kinds that come first are the ones that go.
object
The name of the project, exactly — letter case and spaces included. Anything else is 400 and nothing is deleted.
The most entries this call deletes — root items of the Bin, as GET /v1/bin lists them, not rows. The answer says how many are left; call again.
As for POST /v1/bin/purge: the counts the real call would have, nothing deleted — but in one transaction over everything the call would take, which holds the real locks until it rolls back.
Example
{ "confirm": "default", "dryRun": true}Responses
Section titled “ Responses ”What was deleted — or, on a dry run, what would be — and what is left
What POST /v1/bin/purge answers, and how much of the Bin is left — the number a screen calls again for.
object
Echoes the request. false means these rows are gone.
What a delete forever removed — or, on a dryRun, would have: the rows of three tables and what hung off them. results and reviewItems count every one that went, including the results of a deleted case inside a run that is still live: a result is a row of its case before it is a row of its run. A finished run keeps the summary it froze when it ended.
object
Suite nodes deleted: the whole subtree of each entry that went, or, when part of an entry had to stay (skipped), the part of it that could go.
Cases deleted — those named, and those that went with a suite.
Queue entries on those results, and the discoveries of those runs.
The suite entries that had to stay, each named by the id of its root, and why — what the call could not delete, not what it refused. holds_case: a case that is not part of the entry still sits in the suite — for instance one deleted on its own at another time (an entry of its own). holds_suite: a suite that stays is still inside it — for instance a child that was restored on its own — and a parent never goes before its child. Only suites can be held — nothing points at a case or a run. Whatever of the entry could go has gone.
object
Entries of each kind still in the Bin after the call, counted as GET /v1/bin lists them. A suite that had to stay (skipped) is still counted, so a client that calls again stops when a call deleted nothing.
object
Example
{ "dryRun": true, "purged": { "suites": 3, "testCases": 12, "runs": 1, "results": 48, "reviewItems": 2 }, "skipped": [], "remaining": { "suites": 0, "testCases": 0, "runs": 0 }}The confirmation is not the name of the project, or the body is invalid — a limit outside 1 to 500, a dryRun that is not a boolean
object
Examples
{ "error": "confirm must be the exact name of the project"}{ "error": "validation failed — limit: Too big: expected number to be <=500"}No / invalid token or session
The caller may not delete forever in this project — the same answer as for an id nobody has; nothing was deleted
object
Example
{ "error": "not found"}Rate-limited: either the per-route throttle or a tenant quota. Retry-After carries the seconds until the window rolls over.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over