---
title: "Restore an archived workspace"
method: POST
path: "/api/workspaces/{slug}/unarchive"
tags: ["Workspaces"]
---

# Restore an archived workspace

`POST /api/workspaces/{slug}/unarchive`

## Request

- Base URL: `https://trydock.ai`
- URL: `https://trydock.ai/api/workspaces/{slug}/unarchive`
- Auth: HTTP bearer

Reverse a soft-archive. Idempotent on workspaces that aren't archived. Emits a `workspace.unarchived` event carrying the previous archive timestamp. Editor role required.

## Path parameters

- `slug` string, required

## Response `200`

Restored.

- object
  - `workspace` Workspace, required
    - `id` string, required
    - `slug` string, required
    - `name` string, required
    - `mode` 'table' | 'doc', required: Default-view hint (which tab opens first). A workspace can hold any combination of table + doc surfaces regardless of mode.
    - `visibility` 'private' | 'org' | 'unlisted' | 'public', required: Who can see and edit. `private` = explicit members only. `org` = every org member is virtual editor. `unlisted` = anyone with the URL can read. `public` = indexed by search.
    - `createdAt` string, date-time, required
    - `archivedAt` string, date-time, nullable, required
    - `pinnedAt` string, date-time, nullable, required: When the calling principal pinned the workspace; null if not pinned by them. Pin is per-user, not org-wide.
    - `role` 'owner' | 'editor' | 'commenter' | 'viewer', required: The calling principal's effective role.
    - `createdBy` object, nullable, required: Null on legacy rows from before attribution shipped.
      - `principalType` 'user' | 'agent', required: Whether the actor is a human user or a Dock-managed agent.
      - `id` string, required
      - `name` string, required
      - `avatarUrl` string, nullable, required
    - `org` object, required
      - `slug` string, required
    - `primarySurface` Surface
      - `id` string, required
      - `slug` string, required
      - `kind` 'table' | 'doc', required

---

[API](https://skmtc.dev/trydock/apis/dock-rest-api.md) - [All operations](https://skmtc.dev/trydock/apis/dock-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/trydock/apis/dock-rest-api/revisions/dd96ae96a412?raw)
