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
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/currentAuth: Required
Behavior: Returns the user's current active workspace. If
currentWorkspaceIdis 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
Suggested Fix
Add two new behavior contract entries:
GET /api/workspaces/:id— workspace detail retrievalGET /api/workspaces/current— current workspace retrieval (companion to WS-005 switch)Context