Skip to content

The trash ​

What was deleted, restoring it and deleting it for good.

GET /v1/trash ​

The items in the trash, newest first.

Deleted templates, folders and libraries, kept for trash.retentionDays (default 30; 0 keeps them until purged). Needs template.read.

Parameters

NameInTypeRequiredDescription
kindquerytemplate, folder, library

Responses

StatusDescriptionBody
200object
400An unknown kind
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object

200 body (application/json)

FieldTypeRequiredDescription
itemsarray of TrashItem
retentionDaysinteger

DELETE /v1/trash ​

Empty the trash.

Purges every item but the libraries that published reports still pin, which it keeps and counts in kept. Needs trash.purge, which agent keys never have. Audited as trash.empty with the number of items purged.

Responses

StatusDescriptionBody
200
403The caller lacks trash.purge
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object

GET /v1/trash/{item} ​

One item in the trash.

Needs template.read.

Parameters

NameInTypeRequiredDescription
itempathstringyesA trash item's id, t_<hex>

Responses

StatusDescriptionBody
200The itemTrashItem
404No such item
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object

DELETE /v1/trash/{item} ​

Delete an item for good.

Removes the item and everything it holds from the template store or dataDir. Git history isn't rewritten: the commits from before the trash keep the published versions (docs/operations/trash.md says how to erase them by hand). A library is removed from every environment branch, releases and all, and is refused with 409 library-in-use while a published report pins one of its releases. Needs trash.purge, which agent keys never have. Audited as <kind>.purge.

Parameters

NameInTypeRequiredDescription
itempathstringyesA trash item's id, t_<hex>

Responses

StatusDescriptionBody
200
403The caller lacks trash.purge
404No such item
409Published reports still pin releases of the libraryobject
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object

POST /v1/trash/{item}/restore ​

Restore an item.

Needs what deleting it needed: template.write in every environment for an item that holds templates, library.write in every environment for a library, template.write otherwise. A library's marker goes and its draft comes back on each branch, with a commit "restore library <name>". Each template's trees go back with a commit "restore <id>" on the branches that had it, with its draft, edit log, history and conversations; its folders are made again. A folder item restores whole or not at all. Cancelled jobs and withdrawn approvals stay that way. Audited as <kind>.restore.

Parameters

NameInTypeRequiredDescription
itempathstringyesA trash item's id, t_<hex>

Responses

StatusDescriptionBody
200object
403The caller couldn't have deleted it
404No such item
409Something with the item's name has been made since
429The request's class is over its rate limit (limits.rate, or the API key's own rateLimits): {error: "rate-limited", class, message, retryAfter}. The MCP tool-call and agent edit limits answer the same body without class.object

200 body (application/json)

FieldTypeRequiredDescription
idstring
statusrestored
itemTrashItem