Delete a document or folder
doc_deleteRemove a document, a directory or a whole folder. Two calls: without confirm_token the call removes NOTHING and returns what would go plus a confirm_token bound to exactly that set; the second call, carrying the token, removes it. Needs manager on everything removed. Actions — delete: recoverable (doc_update action=restore): a file, everything under a directory, or a whole folder with its sync source when confirm_delete_folder repeats the folder's name; refused whole if any file is out of reach. Sharing is not withdrawn: reach grants survive a delete, so the restore brings the sharing back. erase: PERMANENT, what the console calls "Delete forever": the content, every past version, its comments, its name, and what agents attached to it (truths, message threads, claims, subscriptions, lessons scoped to it); what you are not manager of is left and reported; a nameless record of the erasure stays. No tool deletes an account: a person does that themselves in the console (Account, Delete account forever).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| node | No | erase: the document's id, as returned beside its location — survives a rename or a move, so a citation written into a stored document keeps pointing at the right thing. Give this OR location, never both. A console link (`/d/<Name-Slug>-<32 hex>`, whole or just its id) is accepted too. | |
| action | Yes | what to do; each action takes the arguments its line names | |
| location | No | delete: full path from the workspace root, e.g. "handbook/vendor/acme.md" (as printed by browse action=documents or search) · erase: full path from the workspace root, e.g. "handbook/vendor/acme.md". Give this OR node. A path is what a person reads; a node is what survives somebody reorganizing. | |
| confirm_token | No | delete: OMIT on the first call, which returns what would be deleted plus this token. Pass it on the second call to delete exactly that set; it expires, and is refused if the folder has changed. · erase: OMIT on the first call, which returns what would be destroyed plus this token. Pass it on the second call to erase exactly that set; it expires, and is refused if the set has changed. | |
| idempotency_key | No | Any unique string you choose for this write, e.g. a UUID. If you retry the call with the same key and the same arguments, the first answer is returned and nothing is done twice. Reusing a key for a different request is refused. Keys are kept 24 hours. | |
| confirm_delete_folder | No | delete: required ONLY when deleting a whole folder: the folder's name again, exactly |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | the answer as prose, for an action that answers in prose | |
| action | Yes | the action that answered |