> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tokenrip.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Archive, Restore, Delete

> POST /v0/workspaces/:id/archive, /restore and DELETE /v0/workspaces/:id — Workspace lifecycle

Archive and restore require `manageWorkspace`; delete requires `deleteWorkspace`. Both belong to internal admins. MCP: `workspace_archive`, `workspace_restore`, `workspace_delete`. CLI: `rip workspace archive|restore|delete <workspace-id>`.

**Auth:** `Authorization: Bearer tr_...` (an account API key). `{id}` is the workspace UUID.

## `POST /v0/workspaces/{id}/archive`

Body (optional): `{ "workspaceSessionId": "<uuid>" }` for attribution. Makes the workspace read-only:

* Content, context, task, handoff, and content-lifecycle capabilities are suspended.
* Active harness sessions become `archived`, and paired browser views are disconnected.
* Task claims and assignee suggestions are cleared.
* Artifacts, pins, and handoffs are kept and stay readable.

Archiving an archived workspace keeps the original `archivedAt`. Returns the workspace (200).

## `POST /v0/workspaces/{id}/restore`

Body (optional): `{ "workspaceSessionId": "<uuid>" }`. Work resumes with new sessions; old claims and pairings are not revived. Returns the workspace (200).

## `DELETE /v0/workspaces/{id}`

Returns `204 No Content`. Refused without effect unless the workspace is archived **and** holds no artifacts at all, archived and handoff artifacts included. On success the workspace's tasks and their result refs, folders, members, pins, reader positions, sessions, and views are removed in one transaction. Content is never moved out to standalone ownership: delete the artifacts first with the ordinary artifact routes.

## Errors

| Status | Code | Cause |
| - | - | - |
| `404` | `WORKSPACE_NOT_FOUND` | No workspace with that id |
| `403` | `WORKSPACE_FORBIDDEN` | You are not an internal admin |
| `409` | `WORKSPACE_NOT_ARCHIVED` | Delete: archive the workspace first |
| `409` | `WORKSPACE_NOT_EMPTY` | Delete: artifacts remain |

A `workspaceSessionId` is validated as described in [Shared errors](/api-reference/workspaces/overview#shared-errors).
