Skip to content

Put a deleted test case back

POST
/v1/test-cases/{id}/restore
curl --request POST \
--url https://beta-api.plune.ai/v1/test-cases/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/restore \
--header 'Authorization: Bearer <token>'

The reverse of DELETE /v1/test-cases/{id} — for the account that owns the case (Settings → Bin) and for the owner of the deployment; everyone else gets 404, the same 404 an unknown id gets. A case that went with its suite comes back with the suite (POST /v1/suites/{id}/restore), not on its own: asking for it alone answers 409 and names the suite. A restored case is a live case again, so the project ceiling (testCasesPerProject) holds for it: a restore that would cross it answers 429 Cannot restore: you reached the limit … and changes nothing. The waiting queue entries about its results take places in the review queue again: with no room for them the answer is 429 (kind: pendingReviewItems) and the case stays in the Bin.

id
required
string format: uuid

Restored

Media type application/json
object
id
required
string
restored
required
boolean
Example generated
{
"id": "example",
"restored": true
}

No / invalid token or session

No such deleted case in the caller’s project (the deployment owner reaches every project)

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

The case belongs to a deleted suite — restore the suite instead

Media type application/json
object
error
required
string
code
required
string
Allowed values: suite_deleted
Example
{
"code": "suite_deleted"
}

Two refusals share this status, and what to do about them is opposite. Rate-limited — the per-route throttle, or the per-minute request limit of the plan an API token counts by (#1442, #2092): Retry-After carries the seconds until the window rolls over, and waiting that long is the way out. Quota reached — a ceiling on what the project holds (runs in the last 24 hours, test cases, items waiting in the review queue, rules in force in the project’s memory): { error, quota }. A retry straight away frees nothing, so do not loop on it; the message says what makes room — deleting cases, working the queue down, an operator raising the limit — and the run quota, a rolling 24 hours, frees its oldest runs as they age out. Tell the two apart by the body: a 429 whose body has a quota object is a quota, one without it is a throttle. quota carries kind, limit, used, remaining and resetsAt: the figures behind the sentence, and for the run quota the instant its oldest run ages out (#1258). Retry-After is sent on a quota only where there is such an instant (the run quota: the whole seconds, at least 1, until resetsAt); the case, review-queue and project quotas free only by an action, have resetsAt: null, and send no Retry-After. GET /v1/quotas reads the same figures without a refusal.

Media type application/json
One of:
object
error
required
string
Examples

A throttle: no `quota`; wait `Retry-After`

{
"error": "rate limit exceeded — slow down"
}
Retry-After
integer

Seconds until the window rolls over on a throttle; on a quota, until quota.resetsAt — sent only for the run quota, which has one