Delete and Restore

Projects and dataset versions deleted through the Python SDK are moved to the workspace Trash and retained for 30 days before being permanently cleaned up. Within the retention window you can restore them back to the workspace.

Any in-flight training jobs for a project or version are cancelled automatically when it is moved to Trash, so you don't continue spending credits.

Delete a Project

import roboflow

rf = roboflow.Roboflow(api_key="YOUR_API_KEY")
project = rf.workspace().project("my-detector")

project.delete()

The project is immediately hidden from the workspace project list and appears in the Trash view under Settings → Trash.

Restore a Project

If you still have a reference to the Project object, call restore() on it:

project.restore()

The SDK looks up the project in the workspace Trash by its slug and restores it. RuntimeError is raised if the project isn't currently in Trash.

Delete a Version

Move a single dataset version to Trash. Any in-flight training on the version is cancelled.

Restore a Version

The parent project must still be active (not itself in Trash) to restore a version. Restore the project first if necessary.

List Items in Trash

Use Workspace.trash() to see what's currently in the workspace Trash:

trash["sections"] groups the same items by projects, versions, and workflows for convenience.

Restore by ID

If you don't already have a Project or Version handle (for example, you're restoring something that was deleted in a previous session), use Workspace.restore_from_trash() with the id returned by trash():

For versions, pass the parent project id:

Workflows

The SDK doesn't currently expose a Workflow object, but you can soft-delete a workflow via the low-level rfapi helper and restore it with Workspace.restore_from_trash("workflow", ...):

Permanent Deletion

Permanent deletion is intentionally not available from the SDK — the actions to empty Trash and to immediately delete a single Trash item destroy data irrecoverably, and we don't want a stray script to be able to trigger them. These actions are available only through the Trash view in the Roboflow web app, which has an explicit confirmation dialog.

Items left in Trash are cleaned up automatically after the 30-day retention window, so you rarely need to act on them manually.

Last updated

Was this helpful?