A workspace holds apps, team members, billing and the keypair that signs every token issued in it. Workspaces form a tree when one organization provisions others: an integrator's Master workspace holds MSP workspaces, and each MSP workspace holds client workspaces.
Tiers#
Master workspace workspace_type: "master" └── MSP workspace workspace_type: "msp" └── Client workspace workspace_type: "msp_client" └── App (one per client)A workspace with no parent and no children is standard. It owns its own apps and is outside the tree.
| Tier | What it holds |
|---|---|
| Master | The default verification app for every workspace below it, the plan the tree inherits, and the MSP workspaces. Every plan feature check passes for a Master workspace. |
| MSP | Its own branding (display name, color, logo), applied to the verification pages of every client below it, and its client workspaces. It has no app of its own; its challenges go through the Master's verification app. |
| Client | One app (tenant_mode verify_only), with its own users, sessions and credentials, isolated from every other client. |
workspace_type also accepts the legacy values parent, child and client.
What a workspace inherits#
Three values resolve by walking from the workspace up the tree and taking the first one that is set:
- Verification app: the client's own, else the MSP's, else the Master's. Workspace JSON reports it as effective_verification_app_id, with verification_app_source naming the workspace it comes from.
- Plan: the first workspace in the chain with a plan provides the features. With no plan anywhere in the chain, every feature is allowed.
- Branding color and logo: the client's own, else the MSP's, else the Master's. The display name does not inherit: a workspace with no display name shows its own name. See Branding.
Credentials#
| Credential | Header | Reaches |
|---|---|---|
| Workspace key (scworks_...) | Authorization: Bearer | The workspace it was issued on and, on most endpoints, the workspaces and apps below it |
| App key (scapp_...) | Authorization: Bearer | One app |
| M2M token (scm2m_...) | X-Authorization: Bearer | Sent with a key. Identifies the caller. Belongs to one app |
The API reads the last space-separated part of each header, so Bearer scm2m_... and a bare scm2m_... both work. See Authentication for how to issue each one.
How far a key reaches depends on the endpoint:
| Endpoints | Key | Second header |
|---|---|---|
| MSPs, /v1/admin/msps | Master workspace key | M2M token whose app is in the Master workspace or below it, or a member JWT |
| MSPs, /v1/workspaces/:workspace_id/msps | Workspace key of the workspace in the URL | M2M token whose app is in that same workspace, or a member JWT |
| Clients | Workspace key of the workspace in the URL or of its direct parent | Not read |
| User sync | Workspace key or app key | M2M token whose app is in the target app's workspace or above it |
| Custom domain | App key, or a workspace key above the app | Not read |
On most endpoints marked "API key + M2M token", the M2M token's app must be in the workspace named in the URL. A token issued on a Master workspace's app does not open a client workspace's endpoints of that kind.
M2M scopes#
An M2M token carries scopes. A GET needs the read scope and every other method needs write. A token without the scope gets 403 with error_code insufficient_scope and details.required_scope.
Errors#
Errors return {"error": "...", "error_code": "..."}. error_code is present where the endpoint sets one. See Errors.
| Status | When |
|---|---|
| 401 | A key or the X-Authorization value is missing, invalid or expired |
| 403 | The key or token does not reach the workspace or app in the URL |
| 403 feature_not_available | The plan does not include client workspaces |
| 404 | The workspace, MSP, client or app does not exist |