Workspace Guide
Overview
The SYSTEM workspace domain defines where a user can operate, which workspace is considered the default, and how members and roles are managed. In the published docs the workspace surface is split between /web/v1/tenant/workspaces/* for user-scoped actions and /web/v1/workspaces/* for some creation and admin-style operations.
What This Domain Covers
- listing workspaces available to the current user
- creating a workspace for the authenticated user
- setting a default workspace
- role discovery and role creation
- invitation creation and member role assignment
Common Prerequisites
Authorization: Bearer <accessToken>X-PORTAL-ACCESS-CODE: <system-portal-code>- the current user's account is active and allowed to access workspace data
- secure-channel support for encrypted mutations when required by the gateway
Shared Headers
bash
X-PORTAL-ACCESS-CODE: <system-portal-code>
Authorization: Bearer <accessToken>
Content-Type: application/jsonEndpoint Families
User-scoped workspace endpoints
GET /web/v1/tenant/workspaces/minePOST /web/v1/tenant/workspaces/{workspaceBizId}/defaultPOST /web/v1/tenant/workspaces/{workspaceBizId}/leave
Workspace management endpoints
POST /web/v1/workspaces/selfGET /web/v1/workspaces/{workspaceId}/rolesPOST /web/v1/workspaces/{workspaceId}/rolesPOST /web/v1/workspaces/{workspaceBizId}/invitationsPOST /web/v1/workspaces/{workspaceId}/members/role/change
Typical Developer Sequence
- load the user's accessible workspaces
- create a workspace if none exist and the product supports self-service setup
- set the preferred default workspace
- list roles and create a custom role if member permissions need customization
- invite collaborators and update their roles after they join
Decision Points
- whether the user is allowed to self-create a workspace or must join through an invitation
- whether the current role can manage invitations and role assignments
- whether the app should always enter the default workspace or show a selector
- whether a workspace uses only the built-in owner role or also custom roles
Error Handling
WORKSPACE.ALREADY_OWNS_WORKSPACEmeans the user can no longer self-create a second owned workspace4010usually means a bad or expired JWT, not a broken workspace resourceWORKSPACE.ROLE_NAME_EXISTSmeans the caller should reuse or rename the role- invitation conflicts usually come from duplicate pending invites, not from email-delivery issues
- remember that the user-scoped and admin-style workspace paths are both valid in SYSTEM; do not normalize them blindly to a single prefix
Related Domains
Workspace logic is tightly connected to: