---
title: "List workspaces"
method: GET
path: "/api/workspaces"
tags: ["Workspaces"]
---

# List workspaces

`GET /api/workspaces`

## Request

- Base URL: `https://trydock.ai`
- URL: `https://trydock.ai/api/workspaces`
- Auth: HTTP bearer

List every workspace the caller can access. Pass `?archived=1` to list soft-archived workspaces only; the default view excludes them.

## Query parameters

- `archived` '1': Set to `1` to list archived workspaces only.

## Response `200`

Workspace list.

- object
  - `workspaces` 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

## Other responses

- `401`: Missing or invalid bearer token.

---

[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)
