Agent tools

delete

delete({ path })

Move a file or folder to the workspace recycle bin, where the user can get it back. Nothing is destroyed.

category: writerecoverablenot a real deletion
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

pathstringrequired

The file or folder.

It is a move into .trash

The item goes to .trash/<timestamp>/<original path>. Hidden folders are left out of listings, so it disappears from the agent's view while every byte stays.

Why there is no real deletion

An agent acts on text it has read

A page, a document, an instruction it was given. One mistaken step should not be final, so the destructive operation is simply not declared — what is declared is the reversible one.

Getting something back

await pc.files.move(".trash/2026-10-07T09-12-44-000Z/Notes/draft.md", "Notes/draft.md");
pc.files.move(".trash/2026-10-07T09-12-44-000Z/Notes/draft.md", "Notes/draft.md")

The bin is never emptied on its own

Deciding that something is really gone is the account holder's. It also counts against the workspace's space, so it is worth clearing deliberately.