Workspaces API
Whileorganizations represent standard B2B tenants, Wacht also supports a deeper layer of hierarchy called Workspaces. Workspaces typically exist within an Organization (e.g., an Organization is a “Company”, and Workspaces are “Projects” or “Departments”).
Reading Workspaces
listWorkspaces()
Retrieves a paginated list of all workspaces across your entire application.
getWorkspace(workspaceId)
Retrieves a specific workspace by ID.
The unique ID of the workspace you wish to resolve.
Mutating Workspaces
Note: The primary entry hook to create a workspace is normally executed viaclient.organizations.createWorkspaceForOrganization(), tying the workspace to a parent organization.
updateWorkspace(workspaceId, request)
Modify a workspace’s settings or metadata.
The ID of the target workspace.
deleteWorkspace(workspaceId)
Permanently destroy a workspace.
The target workspace ID.
Workspace Memberships
Just like Organizations, Workspaces have independent access control lists (ACLs) and Memberships.listWorkspaceMembers(workspaceId)
Retrieve all users who have explicit access to this workspace.
The target workspace ID.
addWorkspaceMember(workspaceId, request)
Grant a user access to the workspace.
The ID of the workspace.
updateWorkspaceMember(workspaceId, memberId, request)
Change a user’s role exclusively within the context of this workspace.
The ID of the workspace.
The target membership record ID.
removeWorkspaceMember(workspaceId, memberId)
Revoke a user’s explicit access to the workspace.
The ID of the workspace.
The target membership record ID.
Custom Workspace Roles
Workspaces maintain their own discrete set of RBAC Roles and Permissions, isolated from organizational roles.client.workspaces.listWorkspaceRoles(workspaceId)client.workspaces.createWorkspaceRole(workspaceId, request)client.workspaces.updateWorkspaceRole(workspaceId, roleId, request)client.workspaces.deleteWorkspaceRole(workspaceId, roleId)
