API reference

Workspaces

The workspace tree (Master, MSP, client), the keys that reach each tier and the endpoints that provision it.

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.

TierWhat it holds
MasterThe 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.
MSPIts 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.
ClientOne 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#

CredentialHeaderReaches
Workspace key (scworks_...)Authorization: BearerThe workspace it was issued on and, on most endpoints, the workspaces and apps below it
App key (scapp_...)Authorization: BearerOne app
M2M token (scm2m_...)X-Authorization: BearerSent 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:

EndpointsKeySecond header
MSPs, /v1/admin/mspsMaster workspace keyM2M token whose app is in the Master workspace or below it, or a member JWT
MSPs, /v1/workspaces/:workspace_id/mspsWorkspace key of the workspace in the URLM2M token whose app is in that same workspace, or a member JWT
ClientsWorkspace key of the workspace in the URL or of its direct parentNot read
User syncWorkspace key or app keyM2M token whose app is in the target app's workspace or above it
Custom domainApp key, or a workspace key above the appNot 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.

StatusWhen
401A key or the X-Authorization value is missing, invalid or expired
403The key or token does not reach the workspace or app in the URL
403 feature_not_availableThe plan does not include client workspaces
404The workspace, MSP, client or app does not exist

Pages#

MSPs
Create, list, update and delete MSP workspaces.
Clients
Provision client workspaces with their app and app key.
User sync
Load up to 500 users into a client app per call.
Branding
Read a workspace's branding and where each value comes from.
Custom domain
Serve an app's hosted pages from your own domain.