Workspace group
A workspace group allows you to control multiple workspaces (sub workspaces) from within a single admin workspace. Read on for more details about how this feature works.Using a single API key to manage sub workspaces
You can use a single API key to manage any of your sub workspaces. It works with all API endpoints. The API key must have the same scopes as it would when the endpoints are called normally.Call API endpoints “as” a specific sub workspace
You need to add an extra header to your requests calledx-as-workspace and set its value to the workspace id of the sub workspace.
That is the only difference between a regular API call and a call on behalf of a sub workspace. If you do not provide the x-as-workspace header, requests will go through as usual.
Limitations
There are a few limitations regarding this feature:- For privacy and security reasons, a workspace cannot be both an admin workspace and a sub workspace at the same time.
- If you own an admin workspace, it cannot be a sub workspace.
- If your workspace is managed by an admin workspace, it cannot be an admin workspace.
- Only workspace owners and admins can invite workspaces to join their workspace group.
- Only workspace owners and admins can remove sub workspaces from the admin workspace.
- Only workspace owners can leave a workspace group.
Adding sub workspaces
There are two ways to add sub workspaces — from the app and using the API. For both methods, you will need the ID of the workspace you want to invite. Important: both methods send an invitation to the workspace owner. The workspace becomes a sub workspace only after the invitation is accepted.Adding sub workspaces from the app
- Go to the Settings > Account page.
- Go to the Workspace Group tab.
- Click the Add sub workspace button.
- Paste the workspace ID into the text field.
- Press the Add sub workspace button to send the invitation.
Adding sub workspaces using the API
- Use the
POST /workspace-group-membersendpoint. - Set the
sub_workspace_idfield to the workspace ID you want to invite. - Send the request.
Removing sub workspaces
You can remove sub workspaces from the app or through the API.Removing sub workspaces from the app
- Go to the Settings > Account page.
- Go to the Workspace Group tab.
- Find the sub workspace under the Sub workspaces section.
- Click the Remove button.
- The workspace will be removed immediately.
Removing sub workspaces using the API
- Use the
GET /workspace-group-membersendpoint to fetch a list of sub workspaces for your current workspace. - Identify the item where
sub_workspace_idmatches the workspace ID you want to remove. - Send a request to
DELETE /workspace-group-members/:id, replacing:idwith theidfield of the workspace group member from the previous step. Note: theidis the workspace group member ID, not the workspace ID. - The workspace will be removed immediately.
Leaving a workspace group
As a sub workspace, you can always leave the workspace group. You can do it either through the app or through the API. Remember: only workspace owners can leave workspace groups.Leaving a workspace group through the app
- Go to the Settings > Account page.
- Go to the Workspace Group tab.
- Press the Leave workspace group button under the Admin workspace section.
- Your workspace will immediately leave the workspace group.
Leaving a workspace group through the API
- Call the
GET /workspace-group-members/adminendpoint. - Get the
workspace_group_member_idfield (this is theidfield of theworkspace_group_member). - Send a request to
DELETE /workspace-group-members/:id, replacing:idwith theworkspace_group_member_idfrom the previous request. - Your workspace will immediately leave the workspace group.