Skip to content

docs: GET /api/workspaces/:id and GET /api/workspaces/current (GET) endpoints missing from behaviors.md #381

Description

@evan-zhang11

Documentation Gap

Two workspace GET endpoints are implemented but completely missing from behaviors.md:

1. GET /api/workspaces/:id (get_workspace)

Route: GET /api/workspaces/{id}
Auth: Required
Access control: User must be a member of the workspace
Response: 200 + {id, name, slug, ownerId, isPersonal, createdAt} / 401 / 403 (not a member) / 404 (not found or archived)
Handler: workspace_handlers.rs → get_workspace()

2. GET /api/workspaces/current (get_current_workspace)

Route: GET /api/workspaces/current
Auth: Required
Behavior: Returns the user's current active workspace. If currentWorkspaceId is set and valid, returns that workspace. Otherwise falls back to the first available workspace (personal first, then oldest).
Response: 200 + {id, name, slug, isPersonal} / 401 / 404 (no workspace found)
Handler: workspace_handlers.rs → get_current_workspace()

Note: WS-005 only documents PUT /api/workspaces/current (switch workspace). The GET method on the same path is a separate endpoint that is not documented.

Impact

  • Workspace detail view and current workspace retrieval are P0 features
  • Frontend depends on both endpoints for workspace management
  • Missing documentation makes it hard to understand the workspace API surface

Suggested Fix

Add two new behavior contract entries:

  • WS-011: GET /api/workspaces/:id — workspace detail retrieval
  • WS-012: GET /api/workspaces/current — current workspace retrieval (companion to WS-005 switch)

Context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions