A client workspace (workspace_type msp_client) is the isolated tenant for one of an MSP's customers. Creating one creates, in one transaction, the workspace, its single app (tenant_mode verify_only), an app key for that app and, when you send webhook_url, a webhook endpoint.
Two endpoint families do this:
| Family | Path workspace | Response wrapper |
|---|---|---|
| /v1/workspaces/:workspace_id/clients | The MSP workspace (UUID or slug) | client_workspace |
| /v1/workspaces/:workspace_id/children | The Master workspace with msp_id in the body, or the MSP workspace | child_workspace |
Each response object is the client app's fields (as returned by the app endpoints: name, origin, callback_url, logo, slug, primary_color, custom_domain and others) merged with the workspace fields. Where both have a field, the workspace value wins: id is the workspace UUID and the app's public ID is in app_id.
Authentication#
Send a workspace key in Authorization. These endpoints do not read X-Authorization, so you can send the same header pair as the MSP endpoints.
- /clients: the key must belong to the MSP workspace in the URL or to its direct parent (the Master). App keys are not accepted.
- /children: the key must belong to the workspace in the URL or to its direct parent. An app key works for reads and writes on the workspace its app is in.
| Status | Body | When |
|---|---|---|
| 401 | No valid key | |
| 403 | Workspace key does not match path workspace | /clients: the key is neither the MSP's nor its parent's |
| 403 | Not authorized for this workspace | /children: the key does not reach the URL workspace |
| 403 | error_code feature_not_available | The plan does not include client workspaces |
| 404 | MSP Workspace not found / Parent workspace not found | The URL workspace does not exist |
| 422 | Endpoint requires an MSP Workspace id | /clients: the URL workspace is not an MSP |
Create a client#
/v1/workspaces/:workspace_id/clientsWorkspace keycurl -X POST https://api.scute.io/v1/workspaces/$MSP_WORKSPACE_ID/clients \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Wayne Industries", "branding_color": "#0c2340", "countries": ["us", "ca"], "webhook_url": "https://example.com/scute/webhook" }'{ "client_workspace": { "id": "0193f8aa-5555-7666-8777-888888888888", "app_id": "app_3mxZRrzWxhPZ08dXvqq6", "msp_workspace_id": "0193f8aa-1111-7222-8333-444444444444", "parent_workspace_id": "0193f8aa-1111-7222-8333-444444444444", "workspace_name": "Wayne Industries", "workspace_slug": "wayne-industries", "workspace_type": "msp_client", "countries": ["us", "ca"], "name": "Wayne Industries", "origin": "https://verify.scute.io", "primary_color": "#0c2340", "api_key_token": "scapp_xxxxxxxxxxxxxxxxxxxxx", "api_key_id": 4821 }}The example shows a subset of the app fields.
Store the app key
api_key_token is the app key of the client's app. Only this response returns it.
A validation failure returns 422 with the message in error.
Create a client (Master path)#
Creates the same resources with the Master workspace in the URL. Send msp_id to place the client under that MSP. Without msp_id, the call creates a child of the URL workspace itself: on a Master that is an MSP workspace (with a workspace key named "MSP key" in api_key_token), not a client.
/v1/workspaces/:workspace_id/childrenWorkspace keyThe other body fields are the ones listed under Create a client.
curl -X POST https://api.scute.io/v1/workspaces/$SCUTE_WORKSPACE_ID/children \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "Content-Type: application/json" \ -d '{"name": "Wayne Industries", "msp_id": "msp_a4b2c1KQ7nVx9LpRsT2u", "countries": ["us"]}'{ "child_workspace": { "id": "0193f8aa-5555-7666-8777-888888888888", "app_id": "app_3mxZRrzWxhPZ08dXvqq6", "parent_workspace_id": "0193f8aa-1111-7222-8333-444444444444", "name": "Wayne Industries", "slug": "wayne-industries", "workspace_name": "Wayne Industries", "workspace_slug": "wayne-industries", "workspace_type": "msp_client", "child_workspaces_count": 0, "branding": { "display_name": "Wayne Industries", "color": null, "logo_url": null }, "msp_id": "msp_a4b2c1KQ7nVx9LpRsT2u", "msp_workspace_id": "0193f8aa-1111-7222-8333-444444444444", "msp_public_id": null, "countries": ["us"], "api_key_token": "scapp_xxxxxxxxxxxxxxxxxxxxx", "api_key_id": 4821 }}A standard workspace in the URL becomes an MSP when a key creates its first child; the response then has "workspace_became_msp": true.
| Status | error_code | When |
|---|---|---|
| 404 | msp_not_found | msp_id is not an MSP under the URL workspace |
| 422 | msp_workspace_missing | The MSP has no workspace |
| 422 | Validation failure, or the workspace cannot create children |
List clients#
Lists the client workspaces of an MSP.
/v1/workspaces/:workspace_id/clientsWorkspace keycurl https://api.scute.io/v1/workspaces/$MSP_WORKSPACE_ID/clients \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY"{ "msp_workspace_id": "0193f8aa-1111-7222-8333-444444444444", "clients": [ { "id": "0193f8aa-5555-7666-8777-888888888888", "app_id": "app_3mxZRrzWxhPZ08dXvqq6", "msp_workspace_id": "0193f8aa-1111-7222-8333-444444444444", "parent_workspace_id": "0193f8aa-1111-7222-8333-444444444444", "workspace_name": "Wayne Industries", "workspace_slug": "wayne-industries", "workspace_type": "msp_client", "countries": ["us", "ca"] } ]}GET /v1/workspaces/:workspace_id/children lists every child of the URL workspace in the child_workspace shape, under children, with workspace_id and saml_locks_on_first_client.
Retrieve a client#
/v1/workspaces/:workspace_id/clients/:idWorkspace keycurl https://api.scute.io/v1/workspaces/$MSP_WORKSPACE_ID/clients/0193f8aa-5555-7666-8777-888888888888 \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY"Returns {"client_workspace": {...}}. An unknown client returns 404 with Client Workspace not found. GET /v1/workspaces/:workspace_id/children/:id returns {"child_workspace": {...}}.
Update a client#
Send only the fields to change. Fields sent as an empty string are ignored, except countries: an empty array clears the list.
/v1/workspaces/:workspace_id/clients/:idWorkspace keyThe fields may also be nested under a client_workspace object.
curl -X PATCH https://api.scute.io/v1/workspaces/$MSP_WORKSPACE_ID/clients/0193f8aa-5555-7666-8777-888888888888 \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY" \ -H "Content-Type: application/json" \ -d '{"branding_color": "#059669", "countries": ["us", "ca", "gb"]}'Returns 200 with {"client_workspace": {...}}.
| Status | When |
|---|---|
| 404 | The client is not under the MSP |
| 422 | No updatable field was sent, or a value failed validation |
PATCH /v1/workspaces/:workspace_id/children/:id takes branding_display_name (also sets name), branding_color, branding_logo_url, countries, msp_id (an empty value unlinks the MSP), magic_link_expiry, verification_mode, verification_redirect_url_template, verification_redirect_delay and verification_success_message.
Delete a client#
Soft-deletes the client workspace and its app. Challenges against the app stop working. The rows are kept with discarded_at set.
/v1/workspaces/:workspace_id/clients/:idWorkspace keycurl -X DELETE https://api.scute.io/v1/workspaces/$MSP_WORKSPACE_ID/clients/0193f8aa-5555-7666-8777-888888888888 \ -H "Authorization: Bearer $SCUTE_WORKSPACE_KEY"Returns 204 with no body. DELETE /v1/workspaces/:workspace_id/children/:id does the same for any child of the URL workspace.