Empty the Bin — for good, in the background
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 }'#1388: the server empties the Bin as a job. The answer is 202 with the job (kind: bin-empty) — progress counts entries of the Bin, total what it held — and the job goes on whether or not anybody waits for it: GET /v1/jobs shows how far it got, and Cancel there (PATCH /v1/jobs/{id}/state, action: cancel) stops it after the piece in hand. One a project: while it runs, another call answers that job. It ends completed when the Bin holds nothing more the caller may delete (bugs are for an owner of the project alone, #2298), or failed with the reason — a suite that has to stay, or the caller no longer an owner. The deletions are the ones below, made one piece at a time and audited as the caller; so are the job’s start and end. With sync: true, or dryRun, the call is the one it was: it deletes forever the entries of the caller’s project’s Bin a piece at a time: the bugs first (#2298), then the cases deleted on their own, 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 bugs and 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. It also stops once the runs it took hold 100 000 results, taking the first run whatever it holds, so a Bin of big runs takes more calls of a few seconds each. 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): bugs first (#2298), then cases deleted on their own, 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. Without sync or dryRun, a job of the server’s does it (#1388).
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. Only with sync or dryRun: the job takes 500 a step.
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.
#1388: one call, answered 200 with what it deleted and what is left — the answer this route gave before it opened a job, for a script that calls again while remaining is not zero. Without it, the job.
Example
{ "confirm": "default", "dryRun": true}Responses
Section titled “ Responses ”With sync or dryRun: 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 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
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, "bugs": 0, "results": 48, "reviewItems": 2 }, "skipped": [], "remaining": { "suites": 0, "testCases": 0, "runs": 0, "bugs": 0 }}The job that empties the Bin — opened now, or the one already at it
One long AI operation. Seven states: in_progress, action_needed (waits for a person — reason says for what), paused (the quota is spent; Resume, or it resumes by itself), blocked (an outside service failed — reason names it; no button), completed, failed (reason is the raw error; a person may Dismiss it), cancelled (a person’s Cancel — reason is «Cancelled by completed). progress is null while the operation does not know its size — never 0 / 0.
object
Which operation: ingest, sync, auto-analysis, and bin-empty — the Bin emptied by the server (#1388) — and runs-delete — runs deleted in the background (#1423) — today; open-ended.
What it works on — a run id, an import id.
Its name as people know it — shown after the kind.
How far it got; null while the size is not known yet.
object
Why it stopped — only on action_needed, paused, blocked, failed, cancelled. A cancel reads «Cancelled by
The producer’s own token for where it resumes; null — a Retry starts from the beginning.
Which try this is: 1, and one more for each Retry. A producer sends it back in its reports (attempt), and a report of an earlier try is 409 stale_attempt.
Set on completed, failed and cancelled, and only there.
Only on a run-export job in GET /v1/jobs and in the answer of GET /v1/runs/{id}/export (202): the run the file is of, so «Export again» works from any browser. A completed export stays in the list 7 days (its file goes after 24 hours).
Only on a testrail-import or testrail-dry-run job in GET /v1/jobs while TestRail asked it to wait (its import is paused_rate_limit, #2269): when it goes on by itself. The job stays in_progress; no Resume is needed. Absent once that time has passed, while the step that goes on has not settled yet.
Example
{ "id": "6f1c2b3a-0000-4000-8000-0000000000a9", "kind": "bin-empty", "state": "in_progress", "subjectId": null, "subjectName": null, "progress": { "done": 0, "total": 412 }, "reason": null, "cursor": "0", "attempt": 1, "createdAt": "2026-09-16T10:02:00.000Z", "startedAt": "2026-09-16T10:02:00.000Z", "finishedAt": null, "updatedAt": "2026-09-16T10:02:00.000Z"}The confirmation is not the name of the project, or the body is invalid — a limit outside 1 to 500, a dryRun or sync 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: 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