Delete forever the Bin entries named
const url = 'https://beta-api.plune.ai/v1/bin/purge';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"items":[{"kind":"suite","id":"6f1c2b3a-0000-4000-8000-0000000000a1"},{"kind":"case","id":"6f1c2b3a-0000-4000-8000-0000000000c1"},{"kind":"run","id":"6f1c2b3a-0000-4000-8000-0000000000d1"}],"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/purge \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "items": [ { "kind": "suite", "id": "6f1c2b3a-0000-4000-8000-0000000000a1" }, { "kind": "case", "id": "6f1c2b3a-0000-4000-8000-0000000000c1" }, { "kind": "run", "id": "6f1c2b3a-0000-4000-8000-0000000000d1" } ], "dryRun": true }'The way out of the Bin for good (#1020), for what a person selected on the list: a suite entry (the node, its subtree and the cases that went with it), a case deleted on its own, a run (with its results, its queue entries and its files), a bug (with its links to cases, watchers, comments and files, #2298; for an owner of the project alone, ADR 0057 §8). Irreversible — nothing brings these rows back, and the sweep that would have taken them after 30 days only comes later. For the owner of the project, in it, and the owner of the deployment in a project they are a member of — those who may restore, less a manager, who brings back but does not delete forever (ADR 0050 §10). A reader is refused at the boundary like every write (403); everybody else, and anything that is not an entry of the caller’s own Bin — a row that is live, another project’s, an id nobody has — is answered 404, the same 404 whichever it is, and nothing is deleted: all or nothing. The history stays, and a screen says so before the person confirms: it keeps the earlier versions of what was written in cases and suites, and changes made to a run after it was created, such as an edit, a corrected mark, a delete or a restore. The creation of a run, of its results and of their files was never in it, whether a reporter sent them or a person opened and marked a manual run. Every root item taken leaves one new delete entry with its id and the actor and none of the content. dryRun: true does the same work and rolls it back, answering the counts the real call would have; those are an estimate if the data changes between the two calls.
Authorizations
Section titled “Authorizations ”Request Body required
Section titled “Request Body required ”The Bin entries a call acts on — to delete forever (POST /v1/bin/purge, #1020) or to bring back (POST /v1/bin/restore): one to 200 of the kinds GET /v1/bin lists. All or nothing — when any of them is not in the caller’s project’s Bin, nothing is done and the whole call is answered 404.
object
object
suite names an ENTRY of the list — the node that was deleted, with its subtree and the cases that went with it; a node inside an entry is not one. case is a case deleted on its own, run a deleted run, bug a bug moved to the Bin (#2298).
Do all of it and roll it back: the answer carries the counts the real call would have, and nothing is deleted.
Example
{ "items": [ { "kind": "suite", "id": "6f1c2b3a-0000-4000-8000-0000000000a1" }, { "kind": "case", "id": "6f1c2b3a-0000-4000-8000-0000000000c1" }, { "kind": "run", "id": "6f1c2b3a-0000-4000-8000-0000000000d1" } ], "dryRun": true}Responses
Section titled “ Responses ”What was deleted — or, on a dry run, what would be
object
Echoes the request. false means these rows are gone.
What a delete forever removed — or, on a dryRun, would have: the rows of four 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.
Bugs deleted, with their links to cases, watchers, comments and files.
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
Example
{ "dryRun": true, "purged": { "suites": 3, "testCases": 12, "runs": 1, "bugs": 0, "results": 48, "reviewItems": 2 }, "skipped": []}Invalid body — no item, more than 200, an unknown kind, an id that is not text, a dryRun that is not a boolean
object
Examples
{ "error": "validation failed — items: Too small: expected array to have >=1 items"}No / invalid token or session
The caller may not delete forever in this project, or an item is not an entry of its Bin — one answer for both, and for every item, so nothing says which; nothing was deleted
object
Example
{ "error": "not found"}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.
object
Example generated
{ "error": "example"}Headers
Section titled “Headers ”Seconds until the window rolls over