Use POST /v1/capsules//files/mkdir to create directories and POST /files/remove to delete files or directories inside a capsule.
Two endpoints let you manage the structure of a capsule’s filesystem: one for creating directories and one for removing files or directories. Both require the capsule to be in the running state.
POST https://app.wrenn.dev/api/v1/capsules/{id}/files/remove
Removes a file or directory at the specified path inside the capsule. Removal is recursive for directories — all contents are deleted.
This operation is irreversible. Entire directory trees are removed without confirmation. Make sure you have a copy of any data you need before calling this endpoint.
from wrenn import Capsulewith Capsule(wait=True) as capsule: # Create a directory (and any needed parents) capsule.files.make_dir("/app/data") # Remove a file capsule.files.remove("/app/old-script.py") # Remove an entire directory tree capsule.files.remove("/app/old")
remove works recursively for directories. There is no rmdir-style safe guard — it behaves like rm -rf.