Standing up a workspace for a new team, renaming one after a reorg, or retiring one when a project ends has meant clicking through the account dashboard one workspace at a time. Now you can do all three through the mabl API:
-
Create a workspace with
POST /companies/{company_id}/workspaces. Name the workspace, pick which account it belongs to, and assign its owners. Owners must already be a member in one of your mabl workspaces. -
Rename a workspace with
PATCH /workspaces/{workspace_id}. -
Delete a workspace with
DELETE /workspaces/{workspace_id}.
For teams that keep a workspace per product, team, or client, workspace setup becomes a scripted step in your onboarding process instead of a manual one.
Account admins only
The three endpoints are authorized by a new company-scoped API key type, Workspace lifecycle, created from the account dashboard. The account dashboard is only available to workspace owners with account admin permissions.
Try it out
Workspace management endpoints require a company-scoped "Workspace lifecycle" API key. Admins can create one from the API keys section of the account dashboard.
A workspace lifecycle key acts across every workspace owned by your company. It carries permission for these three operations plus read access to workspace settings, and nothing else. It cannot read test results, manage users, or copy tests between workspaces.
You'll also need a few identifiers:
- Company ID: available in the API keys section of the account dashboard: View IDs
- Workspace ID: available from Settings > Workspace in the app
Set a credit allocation as you create
POST /companies/{company_id}/workspaces accepts credit_allocation and enforce_credit_limit, the same two settings available when you add a workspace from the account dashboard. A provisioning script can hand a new workspace its credit ceiling at creation time rather than leave it drawing on the account's shared pool until someone sets one. Enforcement requires an allocation.
Deleting workspaces
- Deleting a workspace is permanent and cannot be restored through the API. This action deletes the tests, plans, and run history along with it. Contact mabl support if a deleted workspace needs to be recovered.
- Deleting a workspace never cancels your subscription. A request to delete the last remaining workspace in an account is refused, so a decommissioning script cannot unsubscribe a billing account on its way through.
-
Deleting a workspace is not idempotent. Because mabl checks your permissions before it looks for the workspace, deleting one that is already gone returns
403, not a success. Worth handling in retry logic.